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"