0

I have managed to successfully mount a WD Livebook share (called tv with Public access) using the following command:

sudo mount -t cifs -o credentials=/smb-credentials,dir_mode=0777,file_mode=0777,rw,soft,sec=ntlm,vers=1.0 //192.168.0.18/tv /home/pi/livebook

However, I would like to do this automatically by amending /etc/fstab. But doing that just doesn't seem to work. Here is the line I added to the fstab file:

//192.168.0.18/tv /home/pi/livebook cifs credentials=/smb-credentials,dir_mode=0777,file_mode=0777,rw,soft,sec=ntlm,vers=1.0 0 0

Help would be much appreciated. I'm new to this but have got shares on a WDMirror mounting automatically but not with the WDLiveBook? Seems very odd.

Cheers

Andre

9
  • What exactly does "doesn't seem to work" mean? What have you done after inserting that line into /etc/fstab, and what was the result? Was there an error message?
    – Tilman
    Apr 9, 2020 at 15:59
  • Hi .. when I run the command line version a folder with a mount icon appears on the desktop and the files from the share arer visible in it .. when I reboot and the fstab runs I was expecting the same to happen but it isn't there. There is a /home/pi/livebook folder but nothing in it. Let me try again and make it clearer. I'm not sure where an error message will be. Also now I think about it I am wondering if the home folder is the right place for this?
    – dracstorey
    Apr 9, 2020 at 16:19
  • Messages from the processing of /etc/fstab should be in /var/log/syslog. Also try the command sudo mount -a and see whether it produces any error message.
    – Tilman
    Apr 9, 2020 at 16:27
  • Hi .. thanks I'll take a look at both those options. I've changed the folder from /home/pi/livebook to /wdmirror to avoid using the home folder ..still works for the command line version as /wdmirror now shows the files and directories of the share ... but the fstab didn't mount the share. Running sudo mount -a gives me a mount error(22) invalid argument refer to mount.cifs(8) manual page ...I'm checking the log but it's quite long and I'm scrolling down to the end!
    – dracstorey
    Apr 9, 2020 at 16:45
  • The log says CIFS VFS: cifs_mount failed w/return code = -22
    – dracstorey
    Apr 9, 2020 at 16:48

1 Answer 1

1

I now have this working.

There were two things which I changed:

  1. A typo in the /etc/fstab file .. the line in the question above is correct. however ...
  2. More importantly after some testing I created a new directory /wdmirror changed its ownership to the user I log in with pi. Changed permissions to read and write as well. Using the /wdmirror directory instead of /home/pi/livebook worked fine. It may something about the home directory it doesn't like - I'm no expert so will need to read more about that.

The correct line in fstab is now:

//192.168.0.18/tv /wdmirror cifs credentials=/smb-credentials,dir_mode=0777,file_mode=0777,rw,soft,sec=ntlm,vers=1.0 0 0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.