Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] How to unmount bind-mounted /dev?
Date: Fri, 29 Apr 2011 23:45:04
Message-Id: 4DBB4CDD.80306@wonkology.org
1 Hi there!
2
3 I want to shrink [*] a partition that holds a 32-bit Gentoo chroot. But
4 I cannot unmount it, the device is busy because proc and /dev is
5 bind-mounted there. And I cannot unmount this /dev, again, the device is
6 busy:
7
8 weird ~ # umount /32/dev
9 umount: /32/dev: device is busy.
10 (In some cases useful info about processes that use
11 the device is found by lsof(8) or fuser(1))
12
13 lsof /32/dev gives a lot of stuff, the same that lsof /dev gives. lsof
14 /proc also has some lines, but I had no problem unmounting /32/proc.
15
16 I could remove the /32/dev entry from fstab and reboot, but I need the
17 machine up at the moment, and I'm also curious why this is a problem.
18 Maybe you know?
19
20 [*] BTW, I just wrote a script so automatize this. It shrinks the file
21 system, then reduces the logical volume. It also reduces the size of a
22 LUKS crypto volume on the LVM.
23 Enlarging also works, but that already is easy using lvresize,
24 cryptsetup resize and resize2fs. Shrinking is more tricky though, you
25 have to calculate the sizes, and things could break if the underlying
26 partition is made too small.
27
28 Wonko

Replies

Subject Author
Re: [gentoo-user] How to unmount bind-mounted /dev? Thomas Ulrich Nockmann <tun.nospam-daf1b990@×××××.de>