You are not logged in.
Pages: 1
Hello All,
I am wondering what is the best way to handle mounts on shutdowns/reboots.
Lemme give some context:
Very often when powering off, I would get the following error on a mount:
Broadcast message from user@host on pts/0 (Thu 2024-12-05 22:34:84 CET):
The system will power off now!
[FAILED] Failed unmounting /mnt/Games.
[*** ] A stop job is running for User Manager for UID 1000 (28s / 1min 49s) and I can then see in journalctl
Dec 05 22:25:37 host umount[38823]: umount: /mnt/Storage: target is busy.
Dec 05 22:25:37 host systemd[1]: Unmounting /mnt/Storage...
Dec 05 22:25:37 host systemd[1]: Failed unmounting /mnt/Storage.To me seems pretty clear that this happens because some process is still accessing the mount, that cannot then be unmounted during shutdown.
To circumvent this I have modified /etc/systemd/logind.conf with the following/
KillUserProcesses=yes
KillExcludeUsers=rootThis seems to have done the trick, but imo it is not a very elegant way to handle the situation.
What are the best practices/suggestions to handle it? Am I doing something wrong?
Thanks!
adding fstab below for more details
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# Swap
UUID=fe20320c-29c1-4906-a4a3-ee724a45f1a3 none swap defaults 0 0
# Boot/EFI
UUID=3B2A-57B7 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# Computer
UUID=b4b8e732-c30f-480c-b597-2b497898c712 / ext4 rw,relatime 0 1
# Games
LABEL=Games /mnt/Games btrfs compress-force=zstd,nosuid,nodev,nofail,relatime 0 0
# Storage
LABEL=Storage /mnt/Storage btrfs compress-force=zstd,nosuid,nodev,nofail,relatime,autodefrag 0 0
/dev/md0 /mnt/Games auto nosuid,nodev,nofail,x-gvfs-show 0 0Offline
you have two lines mounting to /mnt/Games:
LABEL=Games
and
/dev/md0
you should clean this up first
then - as "games" gives a hint: how about game launchers like steam, heroic, lutirs, etc? do you manual quit them before logging off - or do you do it the windows way: having a metric ton of crap in the background and just kill the current session by force reboot?
how about a
lsof /mnt/Games
before shutting down to see what processes have open handles on that mount point
Offline
you have two lines mounting to /mnt/Games:
LABEL=Games
and
/dev/md0
you should clean this up firstthen - as "games" gives a hint: how about game launchers like steam, heroic, lutirs, etc? do you manual quit them before logging off - or do you do it the windows way: having a metric ton of crap in the background and just kill the current session by force reboot?
how about a
lsof /mnt/Games
before shutting down to see what processes have open handles on that mount point
thanks cryptearth, I did not even notice the final line on fstab, that one should not be there at all. In any case with a clean fstab the situation does still happen.
This thing is not really regular, sometimes I can poweroff with a game still running, and I will not receive any error. Other times, if I close up all apps I do get the error. And this happen on /Storage as well, so it should not be related to a specific program hitting the mount.
And is not really about "the windows way" (whatever that means ¯\_(ツ)_/¯ ) or not, I know this happen because there is some process still working on the specific mount. I am interested in knowing what is the "best practice" in handling those while shutting down, if not forcefully killing them all via conf or manually.
Offline
https://wiki.archlinux.org/title/System … _on_logout may be relevant ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
https://wiki.archlinux.org/title/System … _on_logout may be relevant ?
thanks Lone_Wolf, this is what I needed to see! What the wiki suggests is pretty much what I did, I just wanted confirmation that this was the right way to go about it.
Offline
Pages: 1