You are not logged in.

#1 2014-04-24 09:04:51

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Can't unmount network drive on shutdown

I have a Drobo FS that I use a my network storage drive and I'm mounting via fstab on my 2 Arch boxes this way:

//192.168.0.4/Media /media/drobofs cifs iocharset=utf8,uid=af,gid=users,guest,dir_mode=0775,user 0 0

my problem is now that when I turn off my machines they try to unmount the external drive but fail every time. They simply time out after 90 seconds and when write giving up and I don't understand why?

Last edited by fettouhi (2014-04-24 09:09:26)

Offline

#2 2014-04-24 16:58:35

dennis123123
Member
Registered: 2009-07-02
Posts: 72

Re: Can't unmount network drive on shutdown

It's probably killing your network connection before it unmounts. Try either adding "soft" as an option, which will not continue attempting to find it... or unmount it via a script that executes as soon as you hit "shutdown" in your WM

Offline

#3 2014-04-25 13:50:26

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

dennis123123 wrote:

It's probably killing your network connection before it unmounts. Try either adding "soft" as an option, which will not continue attempting to find it... or unmount it via a script that executes as soon as you hit "shutdown" in your WM

Where should I add the soft option you are talking about?

Offline

#4 2014-05-01 11:24:43

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

I've been looking at different options and I found this on the forum

https://bbs.archlinux.org/viewtopic.php … 6#p1169746

he has in his fstab til option x-systemd.automount could this be the solution here?

Last edited by fettouhi (2014-05-01 11:26:06)

Offline

#5 2014-05-01 11:35:45

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

Re: Can't unmount network drive on shutdown

On my netbook, I unmount nfs filesystems via networkmanager's dispatcher when I disconnect from my local AP.

On my desktop, I mount nfs filesystems with "noauto,x-systemd.automount,x-systemd.device-timeout=5".

Offline

#6 2014-05-01 13:02:01

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

lucke wrote:

On my netbook, I unmount nfs filesystems via networkmanager's dispatcher when I disconnect from my local AP.

On my desktop, I mount nfs filesystems with "noauto,x-systemd.automount,x-systemd.device-timeout=5".

How did you set up your nfs unmount via networkmanager's dispatcher? Because that's what I'm looking for.

Offline

#7 2014-05-01 13:18:37

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

Re: Can't unmount network drive on shutdown

https://wiki.archlinux.org/index.php/Ne … dispatcher

fstab:

192.168.1.1:/export/pacman /var/cache/pacman/pkg nfs4 noatime,nodiratime,noauto 0 0
192.168.1.1:/export/lucke /home/lucke/painkiller nfs4 noatime,nodiratime,users,noauto 0 0

dispatcher script:

#!/bin/sh
case "$2" in
    up)     
        if [ "$CONNECTION_UUID" = "df312f48-a744-4501-929e-e0bc4ac5dc23" ]; then
                mount /home/lucke/painkiller &
                mount /var/cache/pacman/pkg &
        fi
        ;;
    down)
        umount -a -l -t nfs4
        ;;
esac

Offline

#8 2014-10-02 08:47:25

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

lucke wrote:

https://wiki.archlinux.org/index.php/Ne … dispatcher

fstab:

192.168.1.1:/export/pacman /var/cache/pacman/pkg nfs4 noatime,nodiratime,noauto 0 0
192.168.1.1:/export/lucke /home/lucke/painkiller nfs4 noatime,nodiratime,users,noauto 0 0

dispatcher script:

#!/bin/sh
case "$2" in
    up)     
        if [ "$CONNECTION_UUID" = "df312f48-a744-4501-929e-e0bc4ac5dc23" ]; then
                mount /home/lucke/painkiller &
                mount /var/cache/pacman/pkg &
        fi
        ;;
    down)
        umount -a -l -t nfs4
        ;;
esac

What is this "$CONNECTION_UUID" = "df312f48-a744-4501-929e-e0bc4ac5dc23"? This that your local AP so that it only mounts these partitions when you are on your home network?

Offline

#9 2014-10-02 09:13:32

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

Re: Can't unmount network drive on shutdown

Yes, it is the UUID of my local AP. You can see UUIDs wiith "nmcli c".

Offline

#10 2014-10-02 11:25:17

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

lucke wrote:

Yes, it is the UUID of my local AP. You can see UUIDs wiith "nmcli c".

OK. So if I wanted to make a similar script with my set up. I mount via cifs this way in fstab:

//192.168.0.4/Media /media/drobofs cifs iocharset=utf8,uid=af,gid=users,guest,dir_mode=0775,user 0 0

then my dispatcher script would look like

#!/bin/sh
case "$2" in
    up)     
        if [ "$CONNECTION_UUID" = "mylocalAPsUUID" ]; then
                mount /media/drobofs &
        fi
        ;;
    down)
        umount -a -l -t cifs
        ;;
esac

Offline

#11 2014-10-02 16:46:47

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

Tried the script but still I have to wait 90 seconds until my laptop shuts down.

Offline

#12 2014-10-02 21:15:33

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

Re: Can't unmount network drive on shutdown

Have you followed the steps in https://wiki.archlinux.org/index.php/Ne … dispatcher?

Does it mount/unmount the share when you connect to/disconnect from your AP?

Offline

#13 2014-10-03 06:42:26

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

lucke wrote:

Have you followed the steps in https://wiki.archlinux.org/index.php/Ne … dispatcher?

Does it mount/unmount the share when you connect to/disconnect from your AP?

Yes I have and yes it mounts and unmounts the share when I connect and disconnect from my AP.

Offline

#14 2014-10-03 07:00:23

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

Re: Can't unmount network drive on shutdown

Are you sure it takes long to shut down because of the network shares? Does it shut down quickly when they aren't mounted?

I very rarely reboot my netbook, but I am sure this worked okay.

Offline

#15 2014-10-03 07:11:24

fettouhi
Member
Registered: 2007-05-07
Posts: 645

Re: Can't unmount network drive on shutdown

lucke wrote:

Are you sure it takes long to shut down because of the network shares? Does it shut down quickly when they aren't mounted?

I very rarely reboot my netbook, but I am sure this worked okay.

Yes, because when I'm on a different AP the laptop shuts down right away and if I disconnect manually from my AP before shutdown the laptop shuts down right away also.

Last edited by fettouhi (2014-10-03 08:04:20)

Offline

Board footer

Powered by FluxBB