You are not logged in.

#1 2015-06-11 19:00:38

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

[SOLVED] Slow shutdown/reboot due to failing cifs unmount

I have a few cifs (samba) shares in my fstab like so:

#NAS
//xxx.xxx.xxx.xxx/video /media/nas/video cifs credentials=/home/f3bruary/.samba_creds 0 0
//xxx.xxx.xxx.xxx/downloads /media/nas/downloads cifs credentials=/home/f3bruary/.samba_creds 0 0
//xxx.xxx.xxx.xxx/music /media/nas/music cifs credentials=/home/f3bruary/.samba_creds 0 0
//xxx.xxx.xxx.xxx/public /media/nas/public cifs credentials=/home/f3bruary/.samba_creds 0 0
//xxx.xxx.xxx.xxx/logs /media/nas/logs cifs credentials=/home/f3bruary/.samba_creds 0 0

And my reboots and shutdowns are a bit slow and I notice the mounts aren't being unmounted properly. They timout which takes about 2 minutes and then the reboot/shutdown continues.

...snip...
Jun 11 20:31:26 ultracool systemd[1]: Stopped TLP system startup/shutdown.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Bluetooth service...
Jun 11 20:31:26 ultracool systemd[1]: Stopped target Multi-User System.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Multi-User System.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Daily locate database update.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Daily locate database update.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Periodic Command Scheduler...
Jun 11 20:31:26 ultracool systemd[1]: Stopped Weekly pkgstats submission.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Weekly pkgstats submission.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
Jun 11 20:31:26 ultracool systemd[1]: Stopping D-Bus System Message Bus...
Jun 11 20:31:26 ultracool systemd[1]: Stopped Daily verification of password and group files.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Daily verification of password and group files.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Login Service...
Jun 11 20:31:26 ultracool systemd[1]: Stopped Daily man-db cache update.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Daily man-db cache update.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Permit User Sessions...
Jun 11 20:31:26 ultracool systemd[1]: Stopped target Login Prompts.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Login Prompts.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Daily rotation of log files.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Daily rotation of log files.
Jun 11 20:31:26 ultracool bluetoothd[717]: Terminating
Jun 11 20:31:26 ultracool avahi-daemon[716]: Got SIGTERM, quitting.
Jun 11 20:31:26 ultracool bluetoothd[717]: Stopping SDP server
Jun 11 20:31:26 ultracool bluetoothd[717]: Exit
Jun 11 20:31:26 ultracool crond[712]: (CRON) INFO (Shutting down)
Jun 11 20:31:26 ultracool connmand[729]: D-Bus disconnect
Jun 11 20:31:26 ultracool avahi-daemon[716]: avahi-daemon 0.6.31 exiting.
Jun 11 20:31:26 ultracool connmand[729]: Remove interface eno1 [ ethernet ]
Jun 11 20:31:26 ultracool connmand[729]: Remove interface wlo1 [ wifi ]
Jun 11 20:31:26 ultracool systemd[1]: Stopping Initialize hardware monitoring sensors...
Jun 11 20:31:26 ultracool systemd[1]: Stopping Samba NetBIOS name server...
Jun 11 20:31:26 ultracool nmbd[799]: [2015/06/11 20:31:26.471220,  0] ../source3/nmbd/nmbd.c:58(terminate)
Jun 11 20:31:26 ultracool nmbd[799]: Got SIGTERM: going down...
Jun 11 20:31:26 ultracool nmbd[799]: [2015/06/11 20:31:26.474074,  0] ../source3/libsmb/nmblib.c:873(send_udp)
Jun 11 20:31:26 ultracool nmbd[799]: Packet send failed to 192.168.1.255(138) ERRNO=Invalid argument
Jun 11 20:31:26 ultracool nmbd[799]: [2015/06/11 20:31:26.474862,  0] ../source3/libsmb/nmblib.c:873(send_udp)
Jun 11 20:31:26 ultracool nmbd[799]: Packet send failed to 192.168.1.255(138) ERRNO=Invalid argument
Jun 11 20:31:26 ultracool systemd[1]: Stopped Periodic Command Scheduler.
Jun 11 20:31:26 ultracool systemd[1]: Stopped D-Bus System Message Bus.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Bluetooth service.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Permit User Sessions.
Jun 11 20:31:26 ultracool systemd[1]: Stopped target Remote File Systems.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Remote File Systems.
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/music...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/video...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/downloads...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/public...
Jun 11 20:31:26 ultracool systemd[1]: Stopped target Remote File Systems.
Jun 11 20:31:26 ultracool systemd[1]: Stopping Remote File Systems.
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/music...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/video...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/downloads...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/public...
Jun 11 20:31:26 ultracool systemd[1]: Unmounting /media/nas/logs...
Jun 11 20:31:26 ultracool systemd[1]: Stopped Initialize hardware monitoring sensors.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Login Service.
Jun 11 20:31:26 ultracool systemd[1]: Stopped target User and Group Name Lookups.
Jun 11 20:31:26 ultracool systemd[1]: Stopping User and Group Name Lookups.
Jun 11 20:31:26 ultracool kernel: [UFW AUDIT] IN= OUT=wlo1 SRC=0.0.0.0 DST=224.0.0.22 LEN=40 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 MARK=0xe4 
Jun 11 20:31:26 ultracool kernel: [UFW ALLOW] IN= OUT=wlo1 SRC=0.0.0.0 DST=224.0.0.22 LEN=40 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 MARK=0xe4 
Jun 11 20:31:26 ultracool connmand[729]: eno1 {remove} index 2
Jun 11 20:31:26 ultracool connmand[729]: wlo1 {remove} index 3
Jun 11 20:31:26 ultracool connmand[729]: Exit
Jun 11 20:31:26 ultracool systemd[1]: Stopped Connection service.
Jun 11 20:31:26 ultracool systemd[1]: Stopped Samba NetBIOS name server.
Jun 11 20:32:56 ultracool systemd[1]: media-nas-logs.mount unmounting timed out. Stopping.
Jun 11 20:32:56 ultracool systemd[1]: media-nas-downloads.mount unmounting timed out. Stopping.
Jun 11 20:32:56 ultracool systemd[1]: media-nas-video.mount unmounting timed out. Stopping.
Jun 11 20:32:56 ultracool systemd[1]: media-nas-music.mount unmounting timed out. Stopping.
Jun 11 20:32:56 ultracool systemd[1]: media-nas-public.mount unmounting timed out. Stopping.
Jun 11 20:33:16 ultracool systemd[1]: Unmounted /media/nas/video.
Jun 11 20:33:16 ultracool systemd[1]: Unit media-nas-video.mount entered failed state.
Jun 11 20:33:16 ultracool systemd[1]: Unmounted /media/nas/logs.
Jun 11 20:33:16 ultracool systemd[1]: Unit media-nas-logs.mount entered failed state.
Jun 11 20:33:16 ultracool systemd[1]: Unmounted /media/nas/music.
Jun 11 20:33:16 ultracool systemd[1]: Unit media-nas-music.mount entered failed state.
Jun 11 20:33:16 ultracool systemd[1]: Unmounted /media/nas/public.
Jun 11 20:33:16 ultracool systemd[1]: Unit media-nas-public.mount entered failed state.
Jun 11 20:33:42 ultracool systemd[1]: Unmounted /media/nas/downloads.
Jun 11 20:33:42 ultracool systemd[1]: Unit media-nas-downloads.mount entered failed state.
Jun 11 20:33:42 ultracool systemd[1]: Stopped target Remote File Systems (Pre).
Jun 11 20:33:42 ultracool systemd[1]: Stopping Remote File Systems (Pre).
Jun 11 20:33:42 ultracool systemd[1]: Stopped target NFS client services.
Jun 11 20:33:42 ultracool systemd[1]: Stopping NFS client services.
Jun 11 20:33:42 ultracool systemd[1]: Stopping GSSAPI Proxy Daemon...
Jun 11 20:33:42 ultracool systemd[1]: Stopped target Network is Online.
Jun 11 20:33:42 ultracool systemd[1]: Stopping Network is Online.
Jun 11 20:33:42 ultracool systemd[1]: Stopped target Network.
Jun 11 20:33:42 ultracool systemd[1]: Stopping Network.
Jun 11 20:33:42 ultracool systemd[1]: Stopping Network connectivity (wlo1)...
Jun 11 20:33:42 ultracool systemd[1]: Stopped GSSAPI Proxy Daemon.
Jun 11 20:33:42 ultracool systemd[1]: Stopped Network connectivity (wlo1).
Jun 11 20:33:42 ultracool systemd[1]: Removed slice system-network.slice.
...snip...

Last edited by f3bruary (2015-06-28 13:57:17)


-f3b

Offline

#2 2015-06-15 11:58:43

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

If anyone could give me a kick in the right direction to fix this, I'd appreciate it.


-f3b

Offline

#3 2015-06-26 11:29:05

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

Changed to:

//192.168.1.200/video /media/nas/video cifs x-systemd.automount,uid=f3bruary,gid=users,sec=ntlmv2,credentials=/home/f3bruary/.samba_creds 0 0
//192.168.1.200/downloads /media/nas/downloads cifs x-systemd.automount,uid=f3bruary,gid=users,sec=ntlmv2,credentials=/home/f3bruary/.samba_creds 0 0
//192.168.1.200/music /media/nas/music cifs x-systemd.automount,uid=f3bruary,gid=users,sec=ntlmv2,credentials=/home/f3bruary/.samba_creds 0 0
//192.168.1.200/public /media/nas/public cifs x-systemd.automount,uid=f3bruary,gid=users,sec=ntlmv2,credentials=/home/f3bruary/.samba_creds 0 0
//192.168.1.200/logs /media/nas/logs cifs x-systemd.automount,uid=f3bruary,gid=users,sec=ntlmv2,credentials=/home/f3bruary/.samba_creds 0 0

But it's still the same. They mount without any errors now. But the unmounting keeps timing out


-f3b

Offline

#4 2015-06-26 12:49:25

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

It times out because the network is shut down before the shares are unmounted, so umount gets stuck. It used to be possible to unmount shares before the connection goes down using networkmanager's dispatcher functionality, but they "fixed" it in one of the updates so it does not work anymore. The only possibility I know of is to either manually unmount cifs shares before shutting down, or somehow replace shutdown with a bash script that first unmounts cifs shares, then calls the actual shutdown executable (haven't tested this).


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#5 2015-06-26 13:21:00

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

I am using connman however, and masked networkmanager ? Doesn't that matter?


-f3b

Offline

#6 2015-06-26 13:37:49

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

You could set them up as systemd mount points or have a script that manually umounts them, and have either the mount units depend on the network, or shutdown require the script unit to be executed first. I made a similar suggestion here, and it worked (see the following post). NFS, but the issue's similar.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#7 2015-06-26 14:13:39

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

skanky wrote:

You could set them up as systemd mount points or have a script that manually umounts them, and have either the mount units depend on the network, or shutdown require the script unit to be executed first. I made a similar suggestion here, and it worked (see the following post). NFS, but the issue's similar.

systemd is already mounting them. If I create a custom unit for unmounting the shares, how do I make sure that happens before the network connection is killed ? Would it perhaps be easier if I could somehow decrease the timeout interval to 1s ?


-f3b

Offline

#8 2015-06-26 14:47:15

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

f3bruary wrote:
skanky wrote:

You could set them up as systemd mount points or have a script that manually umounts them, and have either the mount units depend on the network, or shutdown require the script unit to be executed first. I made a similar suggestion here, and it worked (see the following post). NFS, but the issue's similar.

systemd is already mounting them. If I create a custom unit for unmounting the shares, how do I make sure that happens before the network connection is killed ? Would it perhaps be easier if I could somehow decrease the timeout interval to 1s ?

You're right about the script...maybe it could be executed in the connman shutdown?
Or could the mount unit for systemd require network?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#9 2015-06-26 23:44:28

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

Tried to add 'x-systemd.requires=connman.service' to mount options in fstab but didn't seem to work.
Noticed a new error in the logs.

media-nas-music.automount: Couldn't open autofs ioctl fd: No such file or directory

for each mount...


-f3b

Offline

#10 2015-06-27 22:07:48

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

I previously suffered the same issue with cifs shares. It only happens with wireless. Ethernet is ok.

Unfortunately I have found most network managing software suffers the same problem of the wireless network connection being broken (mostly with wpa_supplicant going down too early) before unmounting takes place. The only network managing software I have found it works perfectly with is systemd-networkd and netctl.

Using any other network software, unfortunately you are going to have to unmount manually before shutting down/re-booting.

The other thing I do, to ensure wpa_supplicant remains active, is to modify wpa_supplicant@.service:

# cp /usr/lib/systemd/system/wpa_supplicant@.service /etc/systemd/system/
# nano /etc/systemd/system/wpa_supplicant@.service

and modify the following line as follows:

Before=remote-fs.target systemd-networkd.service systemd-resolved.service

Cheers.

Last edited by Padfoot (2015-06-27 22:08:36)

Offline

#11 2015-06-28 13:56:58

f3bruary
Member
From: /root
Registered: 2015-06-06
Posts: 58

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

I did 2 things, and I'm not 100% certain which one of them solved it. Feel free to test it out.

1. I added _netdev to the mount options (thanks demize)
2. Switched from connman to netctl

Marking as SOLVED


-f3b

Offline

#12 2021-03-17 12:23:46

WhyNot
Member
Registered: 2021-03-17
Posts: 1

Re: [SOLVED] Slow shutdown/reboot due to failing cifs unmount

Hello, pretty new to Arch/Manjaro but I would like to understand how to set the point 2 from above post. I put the _netdev option but I still have the 90sec timeout before shutdown
I am trying to mount below two partitions

//192.168.1.80/NAS      /mnt/NAS-Shared/        cifs    uid=WhyNot,gid=wheel,username=admin,password=xxxxx,_netdev,x-systemd.automount,x-systemd.device-timeout=10
#
//192.168.1.80/Raw      /mnt/Raw/        cifs    uid=WhyNot,gid=wheel,username=admin,password=xxx,_netdev,x-systemd.automount,x-systemd.device-timeout=10

Offline

Board footer

Powered by FluxBB