Solved umount on shutdown

Here is a question I have wanted to ask for a while.
Lets say I have several USB drives plugged in and hand mounted and recently written data onboard.
Now lets say I don't do a umount and just shutdown -p now.
I that an acceptable way to exit or must I umount ?
I assume the 'syncing disks' I see on shutdown is flushing all the buffers?
 
Yes. Aditionally, all services are called with faststop in reverse order from rc.shutdown(8):
Bash:
...
files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null`

for _rc_elem in `reverse_list $files`; do
        debug "run_rc_script $_rc_elem faststop"
        run_rc_script $_rc_elem faststop
done
...
which includes to unmount all relevant stuff: fgrep umount /etc/rc.d/*
Code:
/etc/rc.d/automount:28: /sbin/umount -At autofs
/etc/rc.d/gbde:113:                     umount "/dev/${parent}.bde" 2>/dev/null
/etc/rc.d/geli:119:                     umount "/dev/${provider}.eli" 2>/dev/null
/etc/rc.d/mdconfig:167:                         umount ${_dev}
/etc/rc.d/mdconfig2:197:                                umount ${_dev}
/etc/rc.d/root:33:      umount -a >/dev/null 2>&1
I.e. all automounted & from fstab(5), but does not include manually mounted filesystems. So it depends how picky the filesystem type is. It might check that it was left unclean, but all data has been commited, and thus it can emit a warning, but still mount on the next attempt.
 
The night after your question, this came to my mind. Sorry for the delay, there's just too many interesting stuff here in the forum distracting my attention...
  • Since all processes receive a kill(1) signal(9) on shutdown(8), all filesystems mounted via a utility, e.g. a USB thumb drive mounted with a GUI tool, should be cleanly unmounted if that utility is implemented correctly.
 
Back
Top