Shutdown / Unmount

When I try to shutdown my laptop, sometimes remote shares and/or local partitions are not unmounted. I see this as message on the screen, shortly before the laptop power off.

Most of the time, the problem seems to be running applications. For example application “xy” has an open file handle for file “0815” on partition “etc”.

From Windows usage, most applications and open file handles are closed, before shutting down the PC or logging of the user. But here, in Manjaro, this seems to be no more the case. Is there anything i can do, to have the same behavior here, so that unmounts can be successful automatically on shutdown?

How are you mounting your network shares, and what type are they? For example, I use /etc/fstab, and the x-systemd.automount,auto options work well for me when using SMB shares (which is the type of network share I guess you’re using in Windows). For example I use this template:

//$SERVER_ADDRESS cifs credentials=$YOUR_CREDENTIALS,uid=$YOUR_UID,gid=$YOUR_GID,vers=$VERSION_REQUIRED,x-systemd.automount,auto,iocharset=utf8,file_mode=$FILE_PERMISSIONS,dir_mode=$DIR_PERMISSIONS  0 0

There is a good tutorial on systemd mount units if you prefer those.

For this is mostly the case by using a WebDAV share via davfs. Im using also fstab file for mount, but I’m not sure if I use the systemd entry, only the auto option exist.

I will check that tomorrow and read also the link you mentioned.

I wish there would be some sync tool, to sync a single file or directory between a WebDAV share and a local folder, but I have not find such tool as of yet. The server didn’t use nextcloud, so I can’t use the client. I don’t want to use a other protocol, because all other devices use the same share and protocol. Directly mounting is the easiest solution so far.

I think that the x-systemd.automount option might help; it could also be worth adding _netdev. I’m under the impression (but could well be wrong) that the latter option is probably redundant with systemd for network filesytems; however, if davfs is not being correctly identified as network dependent then _netdev should mark it as so. I also don’t think it should hurt adding it to any network share.

Have you looked at rsync for synchronisation? It might be able to do what you want; syncthing might also be another option. I have used both for slightly different scenarios and found them to work well.

Also probably very useful for you: Archi wiki davfs2

See if rclone fulfills your needs.

It seems that adding x-systemd.automount does the trick. At least, it worked fine the last reboots. Many thx for the tip and all the other suggestions.


Great, glad to hear it’s sorted!

I can only confirm that it works because I have been using this for my NFS mount from the very beginning and I’ve never encountered with the issue you described.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.