You are not logged in.

#1 2015-12-12 07:11:22

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

dismount cifs at reboot/poweroff

With the help of the arch wiki for network manager and this post: https://bbs.archlinux.org/viewtopic.php?id=83275 I was able to mount my network shares on boot with network manager dispatcher. The script the wiki says to use to dismount is this:

#!/bin/bash
umount -a -l -t cifs

Something in the wiki I didn't notice until I was almost done was this:

Note: Ever since NetworkManager 0.9.8, the 'pre-down' and 'down' actions are not executed on shutdown or restart, so the above script will only work if you manually disconnect from the network. See this bug report for more info.

As far as I can tell the bug report still active, I don't see that it's been closed or fixed. I haven't had my laptop freeze at shut down or reboot but I do notice it does take a bit longer to shut down now.

Is there a way to force my dismount script to run at shut down and reboot? Or somewhere else I can add a script to make sure network shares are dismounted at power down? Or do I not need to?

Offline

#2 2015-12-13 20:54:48

masterdisaster
Member
Registered: 2013-05-12
Posts: 14

Re: dismount cifs at reboot/poweroff

I'm not familiar with NetworkManager and it's peculiarities, but have you considered using network share automounting instead?

Offline

#3 2015-12-14 06:27:05

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: dismount cifs at reboot/poweroff

masterdisaster wrote:

I'm not familiar with NetworkManager and it's peculiarities, but have you considered using network share automounting instead?

I did see that, I'll check into it a bit more. I decided to try the dispatcher because it would allow me to only mount when I was connected to a certain network(s). I'm running arch on my laptop and its the one that goes with me everywhere, so if I'm not on my home network auto mounting wouldn't work. If there's a way to have it not attempt to mount when I 'm not at home it may be an option.

Thank you for your input

Offline

#4 2015-12-14 07:13:59

masterdisaster
Member
Registered: 2013-05-12
Posts: 14

Re: dismount cifs at reboot/poweroff

I understand. In the case of AutoFS the automonting is performed on demand, when filesystem is accessed. So when you try to use it away from home your attempt will return 'No such  file or directory' error. There's a few second timeout if a share fails to mount, but your boot & poweroff times should not be influenced.

Offline

Board footer

Powered by FluxBB