What I'm trying to achieve is mounting some drives shared on my network (one a Time Capsule, 3 shared drives from a Windows 10 machine) on a Raspberry Pi 2 running Ubuntu 14.04 with read and write permissions.

I have been able to get the drives to mount by using this:

// /home/kev/NetworkDrives/Movies cifs username=user,password=password 0 0

Obviously using the correct info for username and password.
Using this line in the /etc/fstab file achieves mounting the drives.
I am able to read the files and copy them to my local storage but I can not write to the mounted drives and I can not find out what is wrong.
This is new territory for me so your help is appreciated.

migrated from raspberrypi.stackexchange.com Sep 28 '15 at 16:05

This question came from our site for users and developers of hardware and software for Raspberry Pi.

  • Are you trying to do the write as root, or as a regular user? If a regular user, can you cp something to it via sudo? This should help determine if the restriction is in the local access mode or on the CIFS protocol. – BowlOfRed Oct 1 '15 at 21:26
  • Great question. If I attempt to cp normally permission is denied. If I do it with sudo it works. – Meph88 Oct 4 '15 at 13:09
  • Hmm. Then I would have expected quintablet's answer to work, since the underlying account is authorized. Not sure why that fails and the other works. – BowlOfRed Oct 4 '15 at 18:00

try (add to entry)... username=user,password=password, file_mode=0777,dir_mode=0777

  • I tried your suggestion. Unfortunately no success. So the entry now reads "// /home/kev/NetworkDrives/Movies cifs username=user,password=pword, file_mode=0777,dir_mode=0777 0 0" The result from a sudo mount -a is [mntent]: line 5 in /etc/fstab is bad [mntent]: line 7 in /etc/fstab is bad [mntent]: line 9 in /etc/fstab is bad [mntent]: line 11 in /etc/fstab is bad – Meph88 Sep 29 '15 at 13:55
  • Ok, didn't think of this earlier, but try adding 'rw' (without quotes) after pword, instead of the file/dir_mode commands. 'rw' stands for read/write. – quintablet Sep 29 '15 at 20:27
  • Same result I'm afraid. Mounts, can read but can not write. – Meph88 Sep 30 '15 at 0:52

Try this command to see if it mounts:

sudo mount -f cifs // /home/kev/NetworkDrives/Movies -o username-user,password=pword,iocharset=utf8,file_mode=0777,dir_mode=0777

(I tried to put this in the comments, but ran everything together and was hard to read). I use this method and it works for me. I store it in a file (mountMovies for example) and make it executable chmod +x mountMovies.

  • So I finally got a chance to try this and using this it mounts in the specified location with read AND write permissions!!!!! I can definitely store that as a file, make that file executable and tell it to run at startup. That being said, I need these drives mounted all the time which is why /etc/fstab is handy. What do you do to handle events like my network rebooting or the PC sharing the drives rebooting or some other similar occurrence? I could run a looping program at startup that re-executes those commands every few seconds but that's probably a big CPU suck. Any ideas? – Meph88 Oct 4 '15 at 13:24
  • Glad you got it to work. You can put the command into crontab to execute daily. Additionally, since you can put the command into a shell script, you can test if the location is mounted and if so, just exit or if not mount it. – quintablet Oct 5 '15 at 16:53

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.