View previous topic :: View next topic |
Author |
Message |
creaker l33t
Joined: 14 Jul 2012 Posts: 651
|
Posted: Mon Nov 19, 2012 2:16 pm Post subject: unmounting network filesystem |
|
|
Hello!
How to unmount network filesystems (like samba) if server hangs or powered off?
The one solution I found is unmounting with 'lazy' and 'force' options:
Code: | echo "password" | sudo -S umount -f -l /media/share |
This works but takes a lot of time (up to 50-60 secs). All this time filemanager is inaccessable (hangs).
Also, if I fogot to unmount network and trying to halt or reboot PC, system hangs on shutdown stage and should be reseted with hardware reset button.
Is there solution (or workaround) for fixing this problem? |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Mon Nov 19, 2012 3:12 pm Post subject: |
|
|
Hello,
you can create if not, an executable script like /etc/local.d/local.stop who the contain will be
Code: | #!/bin/bash
/bin/umount -a -t cifs |
Code: | chmod +x etc/local.d/local.stop |
That will ensure that Samba shares will be unmount at shutdown preventing long delay.
I do not have any trick to unmount Samba shares remotely if the server hang or die before they can be umounted. Give a try to the command script should not give better result than the one you use. _________________ Paul |
|
Back to top |
|
|
creaker l33t
Joined: 14 Jul 2012 Posts: 651
|
Posted: Mon Nov 19, 2012 5:06 pm Post subject: |
|
|
Logicien, thanks for reply.
Yes, it works and I've added script into local.d directory.
But any way delay on shutdown is here.
Let it be temporary solution.
Also I tried to mount share with 'timeo' options in order to reduce umount timeout, but got an error:
Code: | echo "password" | sudo -S mount -t cifs //192.168.1.5/share /media/share -o timeo,workgroup=WORKGROUP,ip=192.168.1.5
Password:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) |
Looks like 'timeo' is not valid option for cifs. |
|
Back to top |
|
|
|