You are not logged in.
Hi List,
I often mount usb sticks or ntfs hard disks by hand, and then use umount before the shutdown command. I don't really want autodetection, but I ask myself what are the risks when I forget to unmount before shutting down (which I will inevitably do)?
Does the shutdown script unmount all mounted devices anyway and I don't have to worry (and not even use umount) - or may I end up with a corrupted filesystem and much headache and regret?
Last edited by 4on6 (2012-05-01 07:16:00)
Offline
Woah, now you've got me wondering. I always assumed Linux automatically unmounts all mounted drives.
After a quick Internet search, this says that, yes, all mounted drives are unmounted on halt.
Anyway, I've never had any problems or corruption after shutting down with hand-mounted devices.
Offline
Hello
At shutdown time the init process calls the /etc/rc.shutdown script which in turn calls the umount_all() function; this function is defined in /etc/rc.d/functions.
If you look into the source code, you'll see that it uses the 'findmnt' command to search all the mounted file systems, looking in /etc/mtab.
So the answer to your question seems there. Study the scripts yourself to understand better what is going on at boot time or shutdown time.
Have a good day.
Offline
Ok, thanks for the answers, now I feel reassured. And yes, I should read the scripts by myself, and I do sometimes, but its not always 100% obvious to me what they do.
Offline