You need to unmount the ext3 filesystem in order to shrink it. umount -l
means that the filesystem will be unmounted when there is no more open file on it.
Run lsof /tmp
to see what files are open on /tmp
. If you're running an X server, you'll see its socket /tmp/.X11-unix/X0
. You can't remove that socket¹ and still be able to connect to the X server. Other than that, most files tend to be short-lived or to belong to programs that can be restarted.
If you really want to perform the operation on a live system, you'll need to migrate to a different /tmp
filesystem, at least for the duration of the operation. You could transition to tmpfs, in which /tmp
is stored in RAM or swap; see this guide. In fact, tmpfs for /tmp
is a common setup; you might want to stick to that and remove the /tmp
partition altogether (and perhaps enlarge your swap a little instead).
Once you've been able to close everything from /tmp
, you'll be able to unmount it. Don't use umount -l
, it's useless here since it frees the mount point but not the device, whereas what you want is to free the device. Once /tmp
is unmounted, run fsck
, run resize2fs
to shrink it, and shrink the LVM logical volume accordingly. Or you might in fact save time by directly shrinking the LVM volume and creating a new filesystem for /tmp
. (If you have any data you want to keep in /tmp
, you're doing it wrong. /tmp
is for data that need not be saved between reboots, and closed files in /tmp
are fair game for deletion.)
If all this seems daunting, reboot to a recovery system (live CD or USB) and operate from there.
¹ Nor can you move it to another filesystem: that would be removing the original and creating a new socket.