Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
unmounting network filesystem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
creaker
Guru
Guru


Joined: 14 Jul 2012
Posts: 501

PostPosted: Mon Nov 19, 2012 2:16 pm    Post subject: unmounting network filesystem Reply with quote

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?
_________________
Intel Core i3-2120 / 4Gb RAM / 250Gb HDD / NVidia GeForce-550Ti
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 789
Location: Montréal

PostPosted: Mon Nov 19, 2012 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
creaker
Guru
Guru


Joined: 14 Jul 2012
Posts: 501

PostPosted: Mon Nov 19, 2012 5:06 pm    Post subject: Reply with quote

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.
_________________
Intel Core i3-2120 / 4Gb RAM / 250Gb HDD / NVidia GeForce-550Ti
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum