Hi there!
I want to shrink [*] a partition that holds a 32-bit Gentoo chroot. But
I cannot unmount it, the device is busy because proc and /dev is
bind-mounted there. And I cannot unmount this /dev, again, the device is
busy:
weird ~ # umount /32/dev
umount: /32/dev: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
lsof /32/dev gives a lot of stuff, the same that lsof /dev gives. lsof
/proc also has some lines, but I had no problem unmounting /32/proc.
I could remove the /32/dev entry from fstab and reboot, but I need the
machine up at the moment, and I'm also curious why this is a problem.
Maybe you know?
[*] BTW, I just wrote a script so automatize this. It shrinks the file
system, then reduces the logical volume. It also reduces the size of a
LUKS crypto volume on the LVM.
Enlarging also works, but that already is easy using lvresize,
cryptsetup resize and resize2fs. Shrinking is more tricky though, you
have to calculate the sizes, and things could break if the underlying
partition is made too small.
Wonko
I want to shrink [*] a partition that holds a 32-bit Gentoo chroot. But
I cannot unmount it, the device is busy because proc and /dev is
bind-mounted there. And I cannot unmount this /dev, again, the device is
busy:
weird ~ # umount /32/dev
umount: /32/dev: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
lsof /32/dev gives a lot of stuff, the same that lsof /dev gives. lsof
/proc also has some lines, but I had no problem unmounting /32/proc.
I could remove the /32/dev entry from fstab and reboot, but I need the
machine up at the moment, and I'm also curious why this is a problem.
Maybe you know?
[*] BTW, I just wrote a script so automatize this. It shrinks the file
system, then reduces the logical volume. It also reduces the size of a
LUKS crypto volume on the LVM.
Enlarging also works, but that already is easy using lvresize,
cryptsetup resize and resize2fs. Shrinking is more tricky though, you
have to calculate the sizes, and things could break if the underlying
partition is made too small.
Wonko