View previous topic :: View next topic |
Author |
Message |
dcljr Tux's lil' helper
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Tue Aug 05, 2014 11:56 am Post subject: [resolved] Handbook: why not unmount sys before reboot? |
|
|
In the Handbook (both AMD64 and x86 versions), after configuring the bootloader and before rebooting, we see:
Code: | # exit
cdimage ~# cd
cdimage ~# umount -l /mnt/gentoo/dev{/shm,/pts,}
cdimage ~# umount -l /mnt/gentoo{/boot,/proc,}
cdimage ~# reboot |
Why isn't mnt/gentoo/sys included here? That is, why not
Code: | cdimage ~# umount -l /mnt/gentoo{/boot,/proc,/sys,} |
for the second umount command?
After all, it was mounted at the "Chrooting" step (just before the actual chroot command):
Code: | # mount -t proc proc /mnt/gentoo/proc
# mount --rbind /sys /mnt/gentoo/sys
# mount --rbind /dev /mnt/gentoo/dev |
I ask mainly because I prefer to install new Gentoo systems (working on my 4th at the moment) "a little at a time" from within a current running Gentoo system, not "all at once" using an installation CD. So often I will be unmounting the /mnt/gentoo stuff and then not rebooting (until much later).
In fact, specifically what I've been doing on this latest installation (each time I'm ready to "pause" in the process to do something more interesting) is:
Code: | (chroot) ~ # exit
~ # cd
~ # umount -l /mnt/gentoo/dev{/shm,/pts,}
~ # umount -l /mnt/gentoo/{boot,proc,sys}
~ # umount /mnt/gentoo
~ # exit |
Which just exits the X terminal I'm working in. Anything wrong with that?
Anyway, so why doesn't the Handbook tell users to unmount /mnt/gentoo/sys?
Last edited by dcljr on Fri Aug 29, 2014 4:32 am; edited 1 time in total |
|
Back to top |
|
|
Oniryczny Guru
Joined: 01 Dec 2011 Posts: 419 Location: Poland
|
Posted: Tue Aug 05, 2014 12:04 pm Post subject: |
|
|
Code: |
~ # umount -l /mnt/gentoo/{boot,proc,sys} |
umounts:
/mnt/gentoo/boot
/mnt/gentoo/proc
/mnt/gentoo/sys
_________________ cogito ergo sum |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Tue Aug 05, 2014 2:43 pm Post subject: |
|
|
Which just exits the X terminal I'm working in. Anything wrong with that? No.
Anyway, so why doesn't the Handbook tell users to unmount /mnt/gentoo/sys? A Good Question, suggest filing a bug. _________________ Defund the FCC. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Tue Aug 05, 2014 3:14 pm Post subject: |
|
|
Well i don't read the handbook if anyone file a bug, ask to correct the only thing that seems stupid :
umount -l /mnt/gentoo/boot
As this might damage boot. Nobody should lazy umount boot that hold real datas (kernel, grub... some hdd or controller may have not flush datas to disk yet).
And proc sys and dev, nobody cares about them anyway. So umount them with a hammer or not umounting them change nothing. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Wed Aug 06, 2014 1:31 am Post subject: |
|
|
I agree with krinn. If you use a lazy unmount on a filesystem backed by real storage, you need to wait for the unmount to complete before you reboot. The unmount will begin when the filesystem is unused. If you have processes with open files or directories on that filesystem, then the filesystem does not become unused until those processes release the descriptors. Lazy unmount can be used freely for NFS and virtual filesystems. For real filesystems, it should be used only if you know exactly why you need a lazy unmount instead of an eager unmount. |
|
Back to top |
|
|
dcljr Tux's lil' helper
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Fri Aug 08, 2014 12:25 pm Post subject: |
|
|
To those who are complaining about lazily unmounting /mnt/gentoo/boot: it is true, is it not, that my solution...
Code: | (chroot) ~ # exit
~ # cd
~ # umount -l /mnt/gentoo/dev{/shm,/pts,}
~ # umount -l /mnt/gentoo/{proc,sys,boot}
~ # umount /mnt/gentoo
~ # exit |
is technically still safe, since the 3rd (non-lazy) umount command should complain if /mnt/gentoo/boot has not been unmounted yet. Right?
So perhaps I should suggest that for the Handbook? (And readers should probably be warned about what to do if the last umount command doesn't work.) |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Sat Aug 09, 2014 12:59 am Post subject: |
|
|
No, your solution is not technically safe. A lazy unmount immediately detaches the specified mount from the namespace, so after umount -l /mnt/gentoo/boot, you can immediately unmount /mnt/gentoo even if the filesystem formerly mounted at /mnt/gentoo/boot is still in use. That is why I said "For real filesystems, it should be used only if you know exactly why you need a lazy unmount instead of an eager unmount." Both root and boot are real filesystems, so both of them need a non-lazy unmount unless you know exactly why you need a lazy unmount. |
|
Back to top |
|
|
dcljr Tux's lil' helper
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Sun Aug 10, 2014 8:21 am Post subject: |
|
|
Right. OK, so this then:
Code: | (chroot) ~ # exit
~ # cd
~ # umount -l /mnt/gentoo/dev{/shm,/pts,}
~ # umount -l /mnt/gentoo{/proc,/sys}
~ # umount /mnt/gentoo{/boot,}
~ # exit |
(I've decided to put the slashes inside the curly-braces in the 2nd lazy umount this time just for the sake of "symmetry".) |
|
Back to top |
|
|
Cyker Veteran
Joined: 15 Jun 2006 Posts: 1746
|
Posted: Sun Aug 10, 2014 11:40 am Post subject: |
|
|
Interesting... I don't think I bothered doing any of that and just rebooted the system |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Sun Aug 10, 2014 4:01 pm Post subject: |
|
|
dcljr: right, that would be safe. You usually do not need to use a lazy unmount even for virtual filesystems, but using it there is not dangerous as it can be for real filesystems.
Cyker: if you skip the umount process, then the system may automatically perform eager unmounts of the filesystems on the way down, which is safe, equivalent to what dcljr posted, and uses fewer keystrokes. If you mean that you used lazy unmounts for real filesystems and it worked, then that just means you got lucky. Getting lucky is likely in this case, since a lazy unmount will probably free the filesystem within a few seconds if you do not have any processes using it. The eager unmount has the advantage that it will fail if the filesystem is in use, rather than detaching immediately and releasing it at some unspecified later time, which may or may not occur before the kernel turns off the device. |
|
Back to top |
|
|
dcljr Tux's lil' helper
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Mon Aug 18, 2014 9:40 am Post subject: |
|
|
Bugs submitted (first by me, second by someone else) and acted upon:
|
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Mon Aug 18, 2014 10:42 am Post subject: |
|
|
I'm the one who made the 2nd report, because of bad privacy policies of gentoo bugzilla. |
|
Back to top |
|
|
|