You are not logged in.

#1 2008-01-26 09:50:55

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Samba share can't be unmounted after server reboot

Here's my scene:
I've got a debian fileserver serving up a samba share, which I mount on my Arch workstation. Anytime the server reboots or restarts the samba service, I lose the connection to the share, and lots of things start getting screwy since the workstation tries to stat the share for things. For example, df takes ages to realize that the share isn't there anymore. Of course, I figure remounting the share oughta solve that, but try as I might, I can't get it unmounted.
A normal unmount throws a "device or resource busy", and lazy umount does this:

umount -l vault
usage: smbumount mountpoint

Please be aware that smbfs is deprecated in favor of cifs
usage: smbumount mountpoint

Please be aware that smbfs is deprecated in favor of cifs

So, apparently, smbumount doesn't know the lazy flag (force is the same story).
lsof or fuser (to find out what's keeping the share busy) fail as well, since they can't stat the share. The only thing that seems to work is a reboot, but that seems really excessive. Could someone help me out here?

(I also have no Idea what cifs is.)


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#2 2008-01-26 10:21:55

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Samba share can't be unmounted after server reboot

The simple answer is that smbfs is deprecated and the newer one cifs supports files with more than 2 G. The longer answer can be found here http://en.wikipedia.org/wiki/Server_Message_Block and the use of it is described in "man mount.cifs". If your samba server works before with smbfs than you don't have to change anything on the server. The easiest way is to put the lines in the fstab.

If you don't want to have your password in the fstab take a look at the "credentials" feature in the manpage. The credentials file and the path to it should be accessible only for root. Here is an example of my fstab (the use of rsize and wsize is optional):

//SERVER/SHARE /MOUNTPOINT cifs auto,rw,credentials=credentials_file,rsize=32768,wsize=3276 0 0

Offline

#3 2008-01-26 21:08:54

_will
Member
Registered: 2004-07-08
Posts: 123

Re: Samba share can't be unmounted after server reboot

if you've still got the smbfs mount you can try adding the -i switch to umount.

man umount wrote:

-i     Don't  call  the  /sbin/umount.<filesystem>  helper  even  if it
              exists. By default /sbin/umount.<filesystem> helper is called if
              one exists.

to forcefully remove the samba mount

umount -ifl /mnt/samba_share

Offline

#4 2008-01-27 03:29:30

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: Samba share can't be unmounted after server reboot

_will: Thank you, this is awesome!
Does anybody know whether this weird behavior occurs with cifs as well?


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#5 2008-01-27 08:46:38

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Samba share can't be unmounted after server reboot

kamagurka wrote:

Does anybody know whether this weird behavior occurs with cifs as well?

Here with samba 3.0.22 (opensuse) on the server the second run of df takes <1 s longer after restarting smb and i don't have any errors. To switch from smbfs to cifs for a test is uncomplicated so give it a try.

Offline

Board footer

Powered by FluxBB