I have a file share server (samba daemon) running on a Debian server at a local network. My never-ending problem is that whenever I leave the local network (take my notebook to work, or outside) my Ubuntu system freezes. Investigation shows gnome-shell and nautilus stuck in D state. This happens due to kernel not being able to access to the server (since I am not in the network anymore). Apparently, these processes can't be recovered without giving access to the server. Sometimes, this is not possible at all. In the past, I needed to force-reboot the system. With newer kernels, I can at least kill them.

What I would like to have, is to have access to file share automatically, whenever I am in the network. And whenever I leave local network, my system shouldn't freeze. I don't want to manually mount/unmount the file server each time I leave network. I want to simply access the shares whenever possible and a simple error message if they are not accessible.

The other Windows PC can do this and also required access.

Do I need to switch to NFS? Another protocol? A mount parameter? (I tried nointr and soft parameters)

My current mount line in /etc/fstab:

//server/media  /media/networkshare  cifs soft,credentials=/home/user/.credentials,iocharset=utf8,uid=useruid,vers=3.0 0  0

autofs is also blocking gnome-shell and other applications, if I leave the network before idle time. Or for some reason some application keeps accessing the network drive (such as nautilus or gnome-shell).

If I connect via bookmarks in nemo (Connect to server), this time gnome-shell or nemo won't enter D state but gnome-shell freezes when PC wakes up (sleep/wake up) in a new network (different local network, without access to file servers).

This has nothing to do with Issues with autofs "problem reading master map, maximum wait exceeded"

  • 2
    My suggestion would that you remove the entry from /etc/fstab, because that file declares the filesystems that must be mounted at boot. Instead, move across to the automounter (autofs), which mounts filesystems "on demand". – roaima Apr 15 at 13:57
  • I tried that now and it seems to be better in terms of automatically mounting the shares. However, if I lose the connection before the timeout, my system freezes like before. – Genom Apr 15 at 15:45
  • 1
    @MrShunz, it has nothing to do with the linked question. Not even remotely. – Genom Apr 16 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.