Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

[Solved] Can't write to nas drive

Wed Aug 14, 2013 12:08 pm

Hello, Been trying with many suggestions for hours now.

In fstab i have...


//192.168.1.3/admin /Desktop/U cifs username=admin,password=mypassss,workgroup=WORKGROUP,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid 0 0

I goto the desktop open the folder "U" and it opens the nas drive and can see files, I goto create a folder etc and I do not have permissions.

I have installed deluge not sure if this could have messed this up ?

Many Thanks in advance.
Gareth

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Can't write to nas drive

Tue Aug 20, 2013 3:00 am

did you try:

Code: Select all

chmod 777 /Desktop/U
and

Code: Select all

//192.168.1.3/admin /Desktop/U cifs rw,username=admin,password=mypassss,workgroup=WORKGROUP,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid 0 0
and

Code: Select all

ls -hal /Desktop/U
echo "test" > /Desktop/U/test.txt
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

Re: Can't write to nas drive

Sun Aug 25, 2013 3:30 pm

Many thanks for your reply,

I have tried the first by typing into the terminal and got no change, the second attempt also did not change anything when trying to write a file, the 3rd came back with a list of files first for example....


-rwxrw-r-- 1 500 users 1.5G Aug 9 15:07 Man.of.Tai.Chi.2013.720p.Webrip.x264.AC3-FooKaS.mkv
drwxrwsr-x 9 500 users 0 Jan 4 2007 Movies

The other command just said permission denied, i also tried to sudo it still denide, one thing i noticed on these I have to type /home/pi/Desktop/U not just the /Desktop/U does this mean I may have played the mount somewhere wrong ?

I don't get how something that should be straight forward can be giving me such a problem, I really dont want to format the sd and start again but looks like I may be left to try this :( I shall paste my line from fstab....

//192.168.1.3/admin /Desktop/U cifs rw,username=admin,password=mypassword,workgroup=WORKGROUP,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid 0 0

What should i check on the nas drive should I make any changes there maybe ? its odd how windows and mac both have no issue with this nas drive and folder.

Many Thanks again.
Gareth

Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

Re: Can't write to nas drive

Sun Aug 25, 2013 4:27 pm

May have found a solution :)

I tried first without sudo and it failed but...


Sudo chmod -R a+rwx /the folder it's still running but in the root directory it's allowed me to make a folder woo awesome :)

Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

Re: Can't write to nas drive

Sun Aug 25, 2013 4:46 pm

Okey I can now create folders in folders that excited before the chmod only thing now is if I try to write a folder inside a folder I make I get the permission denied again so what exactly is causing this? And how can I fix because if I download files that are folders I'm guessing I can't write the actual files because I won't have the permission inside the new folder arghh

Many thanks for any previous help.
Gareth

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Can't write to nas drive

Sun Aug 25, 2013 5:19 pm

change your umask to fix that.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

Re: Can't write to nas drive

Sun Aug 25, 2013 5:59 pm

Thanks for your reply do you know how I would change that? Thanks Gareth

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Can't write to nas drive

Mon Aug 26, 2013 1:07 am

man mount | grep umask
umask=value
Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal.
Set the umask applied to directories only. The default is the umask of the current process. The value is given in octal.
Set the umask applied to regular files only. The default is the umask of the current process. The value is given in octal.
dir_umask=n, file_umask=n, umask=n
Set the umask used for all directories, all regular files, or all files and directories. Defaults to the umask of the current process.
umask=value
Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal.
uid=value, gid=value and umask=value
Set the file permission on the filesystem. The umask value is given in octal. By default, the files are owned by root and not readable by somebody else.
umask= Set the default umask. The value is given in octal.
or umask for the fatfs).
or
http://en.wikipedia.org/wiki/Umask
or
http://www.ss64.com/bash/umask.html

so maybe

Code: Select all

umask 0000
and / or

Code: Select all

//192.168.1.3/admin /Desktop/U cifs umask=0000,rw,username=admin,password=mypassss,workgroup=WORKGROUP,uid=pi,gid=pi,forceuid,forcegid 0 0
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Gazzanet
Posts: 8
Joined: Wed Aug 14, 2013 11:59 am

Re: Can't write to nas drive

Sun Sep 01, 2013 9:18 am

Thanks for your reply, tried the top one and restarted no change, tried the second one by adding the umask=0000 and a couple of others i had removed previously for not working think it was the uid=pi and gip=pi along with forceuid and forcegid so then the mount wouldn't boot at all, just fiddling to get the mout back played arround then finally removed the umask=0000 and to it mounted again, not sure why i tried but i tried to create a folder and then a folder in that folder and to my amazement it worked wow awesome, here is my new fstab for anyone else having problems and for me in future :)


//192.168.1.3/admin /home/pi/admin cifs username=admin,password=MYPASSWORD,workgroup=WORKGROUP,uid=pi,gid=pi,forceuid,forcegid,file_mode=0777,dir_mode=0777,users,auto,user_xattr 0 0

Thanks again

DeanoAus
Posts: 3
Joined: Thu Jun 22, 2017 10:31 am

Re: [Solved] Can't write to nas drive

Thu Jun 22, 2017 10:33 am

Just registered to say that line fixed the same issue for me - which I had been trying to solve for an entire day!

Thanks man! :lol:

Return to “Troubleshooting”