You are not logged in.

#1 2014-08-12 18:11:13

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Hi,

I have a share mounted in fstab with cifs which works fine. I have used it on other distros but on Arch it results in a 1 1/2 minute job every time I shut down. I have to sit and watch it count down. There's also a job running a boot, but it doesn't take very long. I assume it waits for my network to come up (wifi through network manager) and also that the delay in shutdown is systemd related since the other distros I have used this mount with are not systemd. Anyway, is there a way to prevent this delay?

Offline

#2 2014-08-12 21:22:45

Pse
Member
Registered: 2008-03-15
Posts: 415

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Try using systemd's automount feature. It seems another user experienced the same problem and fixed it that way. See the last post in this thread:

https://bbs.archlinux.org/viewtopic.php … 9#p1338249

Last edited by Pse (2014-08-12 21:23:24)

Offline

#3 2014-08-12 22:59:29

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Pse wrote:

Try using systemd's automount feature. It seems another user experienced the same problem and fixed it that way. See the last post in this thread:

https://bbs.archlinux.org/viewtopic.php … 9#p1338249

I've read that thread, thanks. I am using automount and that takes care of the delay I had during boot but not the 90 second timeout when shutting down. The timeout only happens when I'm on wi-fi. When on a wired connection I shutdown clean. My fstab entry:

//10.0.0.1/Media  /home/<user>/Media  cifs  x-systemd.automount,_netdev,<credentials>,iocharset=utf8,domain=WORKGROUP 0 0

Last edited by cdysthe (2014-08-13 12:54:15)

Offline

#4 2014-08-12 23:52:40

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Offline

#5 2014-08-13 00:22:00

Pse
Member
Registered: 2008-03-15
Posts: 415

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

//10.0.0.1/Media  /home/<user>/Media  cifs  x-systemd.automount,_netdev,<credentials>,iocharset=utf8,domain=WORKGROUP 0 0

AFAIK, for systemd's automount feature to work you also need to add 'noauto' to the list of options. Otherwise the filesystem will get mounted on boot (regardless of the x-systemd.automount option). See the list of options in the thread I mentioned in my previous post.

Last edited by Pse (2014-08-13 00:23:01)

Offline

#6 2014-08-13 12:53:07

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

I tried a new approach. I created my own mount units the systemd way but putting them in /etc/systemd/system They work great, but I am still getting the 90 second timeout when rebooting for some reason although I can  now see that the network is taken down after the umount of the cifs share. The two mount units looks like this:

/etc/systemd/system/home-<user>-media.automount :

[Unit]
Description=Mount Media Server
Require=network.target
After=network.target

[Automount]
Where=/home/<user>/Media

[Install]
WantedBy=multi-user.target

/etc/systemd/system/home-<user>-media.mount :

[Unit]
Description=Mount Media Server
Require=network.target
After=network.target

[Mount]
What=//10.0.0.1/Media
Where=/home/<user>/Media
Type=cifs
Options=<login credentials>,rw,iocharset=utf8,uid=500,gid=500,_netdev,x-systemd.automount

They are activated with the appropriate systemctl commands and they mount the share fine during boot. During shutdown I can see that the network is still up (wi-fi conection set up with Network Manager) when umount is initiated but I am still getting a 90 seconds timeout for the cifs share.

Wnen I'm on a wired connection there's never a timeout, so this only happens for a wi-fi connections. Ideas anyone?

Offline

#7 2014-08-13 15:52:16

Pse
Member
Registered: 2008-03-15
Posts: 415

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Did you try adding the 'noauto' option?

Offline

#8 2014-08-13 19:14:25

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

Pse wrote:

Did you try adding the 'noauto' option?

I have tried that also, It doesn't help. In fact I think this has to do with network-manager somehow. If I'm on a wired connection shutdown is clean, but when on wi-fi set up with network-manager I'm having this problem regardless of whether the mount is set up in fstab or in a unit.

Last edited by cdysthe (2014-08-13 19:22:41)

Offline

#9 2014-08-13 19:26:06

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

As was described in the topic linked by me, you can use networkmanager's dispatcher to unmount shares when the connection goes down.

Offline

#10 2014-08-13 19:58:32

cdysthe
Member
Registered: 2009-11-20
Posts: 62

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

lucke wrote:

As was described in the topic linked by me, you can use networkmanager's dispatcher to unmount shares when the connection goes down.

I have tried but I can't get it to work. I will look at that some more since it seems to be the only option left (except for ditching systemd).

Offline

#11 2014-10-15 17:46:10

slovdahl
Member
Registered: 2012-09-10
Posts: 10

Re: Share mounted with cifs in fstab delays shutdown 1 1/2 minute.

cdysthe wrote:
lucke wrote:

As was described in the topic linked by me, you can use networkmanager's dispatcher to unmount shares when the connection goes down.

I have tried but I can't get it to work. I will look at that some more since it seems to be the only option left (except for ditching systemd).

Please share some information if you managed to get it to work.

I'm experiencing the same problem (on WiFi), shutdown is delayed for 90 seconds because of a mounted cifs share. This is my fstab line:

//nas/share /media/nas    cifs   noauto,x-systemd.automount,guest,uid=1000,gid=1001,iocharset=utf8  0  0

I've also tried with auto instead of noauto.

Last edited by slovdahl (2014-10-15 17:49:30)

Offline

Board footer

Powered by FluxBB