Why is umount network drives with systemd before shutdown?
Apparently the network gets disconnected before all the drives are unmounted. To do this automatically I tried to create a systemd service but it doesn’t work, i.e. it doesn’t seem to do the unmount in time and the shutdown process still takes quite long.
How does systemd know when to unmount a disk?
SystemD picks up on the fact that it has an inactive unit file (inactive because the block device has gone away) which should be mounted to that path, decides there’s a conflict, and that it knows better, and unmounts your mount again If you’re in this position, then, you should be able to briefly resolve with a single command
Can a network drive be unmounted before shutting down?
My shutdown takes quite a long time (I’m on Debian 8.1) and I found out that it can be fixed by unmounting the network drive before shutting down the system. Apparently the network gets disconnected before all the drives are unmounted.
Where do I find the Mount line in syslog?
However, if you look in syslog (e.g. /var/log/messages, journalctl or /var/log/syslog) you may well see this logged again with a couple of additional relevant lines kernel: XFS (sde): Mounting V5 Filesystem kernel: XFS (sde): Ending clean mount systemd: Unit cache2.mount is bound to inactive unit dev-sdc.device.
How to shut down a filesystem in Linux?
On Linux the halt command just calls the shutdown command unless the run level is already 0 (shutting down) or 6 (rebooting) anyway; so no loss there. The act of unmounting a filesystem using umount will sync the data to the disk before it unmounts it.
Is it safe to unmount a filesystem using umount?
The act of unmounting a filesystem using umount will sync the data to the disk before it unmounts it. If you’ve been running sync; sync; halt on Linux you’ll have been okay with the filesystem state because the developers have ensured that halt does the right thing; however it would be more correct to use: shutdown now