You are not logged in.

#1 2012-04-30 14:38:10

4on6
Member
Registered: 2011-10-05
Posts: 172

[SOLVED] Forgetting umount - what consequences?

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

#2 2012-04-30 15:30:36

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Forgetting umount - what consequences?

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

#3 2012-04-30 15:37:58

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: [SOLVED] Forgetting umount - what consequences?

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

#4 2012-05-01 07:15:41

4on6
Member
Registered: 2011-10-05
Posts: 172

Re: [SOLVED] Forgetting umount - what consequences?

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

Board footer

Powered by FluxBB