0

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:

//10.0.1.2/Movies /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.

3
  • 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
    Commented Oct 1, 2015 at 21:26
  • Great question. If I attempt to cp normally permission is denied. If I do it with sudo it works.
    – Meph88
    Commented Oct 4, 2015 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
    Commented Oct 4, 2015 at 18:00

2 Answers 2

0

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

3
  • I tried your suggestion. Unfortunately no success. So the entry now reads "//10.0.1.2/Movies /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
    Commented Sep 29, 2015 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
    Commented Sep 29, 2015 at 20:27
  • Same result I'm afraid. Mounts, can read but can not write.
    – Meph88
    Commented Sep 30, 2015 at 0:52
0

Try this command to see if it mounts:

sudo mount -f cifs //10.0.1.2/Movies /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.

2
  • 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
    Commented Oct 4, 2015 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
    Commented Oct 5, 2015 at 16:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .