Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 361561 - "umount /mnt/gentoo/dev" in chapter 10d fails
Summary: "umount /mnt/gentoo/dev" in chapter 10d fails
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: nm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-01 08:45 UTC by Bernhard Dunkl
Modified: 2011-05-09 19:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Simple umounts with lazy option for alpha book (hb-install-alpha-bootloader.patch,773 bytes, patch)
2011-04-09 19:01 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for arm book (hb-install-arm-bootloader.patch,759 bytes, patch)
2011-04-09 19:01 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for hppa book (hb-install-hppa-bootloader.patch,766 bytes, patch)
2011-04-09 19:01 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for mips book (hb-install-mips-bootloader.patch,1.03 KB, patch)
2011-04-09 19:01 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for ppc64 book (hb-install-ppc64-bootloader.patch,733 bytes, patch)
2011-04-09 19:02 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for ppc book (hb-install-ppc-bootloader.patch,1.09 KB, patch)
2011-04-09 19:02 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for sparc book (hb-install-sparc-bootloader.patch,841 bytes, patch)
2011-04-09 19:02 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for x86+amd64 book (hb-install-x86+amd64-bootloader.patch,1.17 KB, patch)
2011-04-09 19:02 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for x86 raid/lvm quickinstall (gentoo-x86+raid+lvm2-quickinstall.patch,1.04 KB, patch)
2011-04-09 19:03 UTC, Sven Vermeulen
Details | Diff
Simple umounts with lazy option for x86 quickinstall (gentoo-x86-quickinstall.patch,735 bytes, patch)
2011-04-09 19:04 UTC, Sven Vermeulen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Dunkl 2011-04-01 08:45:09 UTC
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.
Comment 1 nm (RETIRED) gentoo-dev 2011-04-01 22:31:38 UTC
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?
Comment 2 Sven Vermeulen 2011-04-02 05:41:44 UTC
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?
Comment 3 Bernhard Dunkl 2011-04-02 23:03:55 UTC
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.
Comment 4 Sven Vermeulen 2011-04-08 16:05:15 UTC
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).
Comment 5 nm (RETIRED) gentoo-dev 2011-04-08 23:40:39 UTC
(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.
Comment 6 Sven Vermeulen 2011-04-09 19:01:02 UTC
Created attachment 269205 [details, diff]
Simple umounts with lazy option for alpha book
Comment 7 Sven Vermeulen 2011-04-09 19:01:17 UTC
Created attachment 269207 [details, diff]
Simple umounts with lazy option for arm book
Comment 8 Sven Vermeulen 2011-04-09 19:01:31 UTC
Created attachment 269209 [details, diff]
Simple umounts with lazy option for hppa book
Comment 9 Sven Vermeulen 2011-04-09 19:01:46 UTC
Created attachment 269211 [details, diff]
Simple umounts with lazy option for mips book
Comment 10 Sven Vermeulen 2011-04-09 19:02:00 UTC
Created attachment 269213 [details, diff]
Simple umounts with lazy option for ppc64 book
Comment 11 Sven Vermeulen 2011-04-09 19:02:15 UTC
Created attachment 269215 [details, diff]
Simple umounts with lazy option for ppc book
Comment 12 Sven Vermeulen 2011-04-09 19:02:31 UTC
Created attachment 269217 [details, diff]
Simple umounts with lazy option for sparc book
Comment 13 Sven Vermeulen 2011-04-09 19:02:52 UTC
Created attachment 269219 [details, diff]
Simple umounts with lazy option for x86+amd64 book
Comment 14 Sven Vermeulen 2011-04-09 19:03:12 UTC
Created attachment 269221 [details, diff]
Simple umounts with lazy option for x86 raid/lvm quickinstall
Comment 15 Sven Vermeulen 2011-04-09 19:04:51 UTC
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.
Comment 16 nm (RETIRED) gentoo-dev 2011-05-09 19:39:45 UTC
All fixed in CVS. Thanks a lot for the patches!