I set up a CIFS share on my ubuntu
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
using an fstab entry:
//mystr.myserver.com/backup /mnt/mystr cifs iocharset=utf8,rw,_netdev,credentials=/etc/smb/mystr-credentials,uid=someuser,gid=0,file_mode=0660,dir_mode=0770 0 0
which works as expected.
now i do have smbd
running to provide this share to users on my LAN with this section in /etc/samba/smb.conf
[mystr]
path = /mnt/mystr
public = yes
writeable = yes
browsable = yes
guest ok = yes
force user = someuser
which also works fine.
However there seems to be an issue if the IP address of the entry mystr.myserver.com
changes. The share says "Host is down."
and mount
shows me the outdated IP address.
As this does not happen very often it is not easy to reproduce.
This morning I wanted to fix it manually and tried to unmount it first which gave me Resource is busy
as I think the smbd
process is blocking the share.
Stopping the smbd
process, unmounting the share, using mount -a
and restarting smbd
solved the issue.
So my questions are:
Can this be done automatically?
Can I tell fstab
to force re-mounting the share if it is down?
Is this even related to smbd
having a handle on the directory?
I checked lsof
, but could not find anything related.
Can I tell samba to "let go" of unreachable directories?
Thanks in advance for any ideas/Suggestions.