The rbind option in "mount --rbind /dev /mnt/gentoo/dev" in chapter 6a includes submounts which prevent /mnt/gentoo/dev from being unmounted later on.
Sven, you were one of the guys that pushed for the --rbind change in bug #253681. Got any ideas why the unmount isn't working? To the original bug poster -- you did remember to cd out of the mounted directory before attempting to unmount, right?
Yes, rbind recursively binds, so we'll need to umount the subdirectories as well. If they're still in use, it might be better to use lazy unmounting. In my installation scripts, I use ~# umount /mnt/gentoo/dev/* ~# umount -l /mnt/gentoo/dev ~# mount -o remount,ro /mnt/gentoo ~# umount -l /mnt/gentoo This always works. The RO-remount ensures that changes are definitely written to disk first. Might be a good option to use a similar approach?
Yes, I left chroot, did a cd and then tried to unmount as described in the handbook. But unmounting of /mnt/gentoo/dev failed with resource busy message. A look into /proc/mounts gave me the submounts (pts and shm I think). After unmounting them I was able to unmount the rest too.
Any objections if I create a patch for the umount process? Something akin to ~# cd ~# umount -l /mnt/gentoo/boot /mnt/gentoo/dev/* /mnt/gentoo/proc /mnt/gentoo ~# reboot Or would you rather see the submounts be mentioned (like pts/shm)? I'd rather use a wild card in case more mounts are created in the /dev structure (not totally unimaginable). I also like to keep the lazy umount as I found a few mentions of it in the forums (and all those that tried it reported success).
(In reply to comment #4) > Any objections if I create a patch for the umount process? > > Something akin to > > ~# cd > ~# umount -l /mnt/gentoo/boot /mnt/gentoo/dev/* /mnt/gentoo/proc /mnt/gentoo > ~# reboot > > Or would you rather see the submounts be mentioned (like pts/shm)? I'd rather > use a wild card in case more mounts are created in the /dev structure (not > totally unimaginable). I also like to keep the lazy umount as I found a few > mentions of it in the forums (and all those that tried it reported success). Whatever results in the fewest additional commands required to unmount is fine with me. What you posted here is less cumbersome than what's in comment #2.
Created attachment 269205 [details, diff] Simple umounts with lazy option for alpha book
Created attachment 269207 [details, diff] Simple umounts with lazy option for arm book
Created attachment 269209 [details, diff] Simple umounts with lazy option for hppa book
Created attachment 269211 [details, diff] Simple umounts with lazy option for mips book
Created attachment 269213 [details, diff] Simple umounts with lazy option for ppc64 book
Created attachment 269215 [details, diff] Simple umounts with lazy option for ppc book
Created attachment 269217 [details, diff] Simple umounts with lazy option for sparc book
Created attachment 269219 [details, diff] Simple umounts with lazy option for x86+amd64 book
Created attachment 269221 [details, diff] Simple umounts with lazy option for x86 raid/lvm quickinstall
Created attachment 269223 [details, diff] Simple umounts with lazy option for x86 quickinstall This is a set of patches that uses umounts like so: ~# umount -l /mnt/gentoo/dev{/pts,/shm,} ~# umount -l /mnt/gentoo{/boot,/proc,} If no processes are using any of the bindmounts, then everything will umount as it should. If processes are still using it, the mounts are hidden (so no "new" processes can use it) and the moment the last process drops out (for instance during the shutdown, where processes are killed) the kernel automatically umounts the file system.
All fixed in CVS. Thanks a lot for the patches!