Sunday, 16 December 2018

Fixing broken Samba Shares

I have NAS (Network Attached Storage) on my network to hold my music, pictures & movies. I attach (mount) the folders on it to my devices for easy access. I was using Samba as it allowed Windows & Linux devices to connect without too much drama.
Then it suddenly stopped working, wtf?

As it turns out a security change in the Samba code meant it couldn't connect unless the version was specified.
To debug and discover the issue the following command run in a terminal allows you to see responses to the "mount" command. Very handy :-)
journalctl -fb

With that running it was just a case of attempting to mount the folders in another terminal to see errors returned. To mount the folders run the following command:
sudo mount -a

Note:




The fix I needed was to simply specify the Samba version in use by adding
vers=1.0
to the mount command. Here's an example:
Before:
//192.168.1.14/Vol_1/pictures /media/pictures cifs  credentials=/home/joeking/sambacreds,uid=joeking,gid=joeking,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
After:
//192.168.1.14/Vol_1/pictures /media/pictures cifs  credentials=/home/joeking/sambacreds,uid=joeking,gid=joeking,iocharset=utf8,file_mode=0777,dir_mode=0777,vers=1.0,noperm 0 0