0

I've a Raspberry Pi acting as a NAS server. It correctly mounts my drive and shares it through Samba, however, even though I can connect to the share and read stuff, I can't write anything to the drive via the Samba share.

I'm assuming it's a permission issue but I couldn't handle it. Here are the related permissions and my Samba config for my mount.

ls -al /media:

total 37
drwxr-xr-x  12 root   root   4096 Dec  9 20:59 .
drwxr-xr-x  23 root   root   4096 Nov 30 11:03 ..
drwxrwxr-x   1 root   root     25 Dec  9 21:48 HDD
drwxr-x---+  2 root   root   4096 Oct 15 13:38 pi
drwxrwxr-x   1 root   root     25 Dec  9 21:48 usb0
drwxr-xr-x   2 archie archie  512 Jan  1  1970 usb1
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb2
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb3
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb4
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb5
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb6
drwxr-xr-x   2 root   root   4096 Nov 12 15:18 usb7
lrwxrwxrwx   1 root   root      4 Nov 12 15:18 usb -> usb0

ls -al /media/HDD(my mounted disk):

total 52658332
drwxrwxr-x  1 root root          25 Dec  9 21:48 .
drwxr-xr-x 12 root root        4096 Dec  9 20:59 ..
drwxrwxrwx  1   99   99           9 Dec 19  2016 Apple
drwxrwxrwx  1   99   99          37 Sep  6 08:20 Archive
drwxrwxrwx  1   99   99           4 May  1  2017 Development
d--x--x--x  1   99   99           8 Oct 21 06:48 .DocumentRevisions-V100
drwxrwxrwx  1   99   99          45 Oct 12 18:24 Films
drwxrwxrwx  1   99   99          16 May  3  2016 Fitness
drwx------  1   99   99         119 Oct 21 06:49 .fseventsd
dr-xr-xr-t  1 root root           2 Dec 23  2017 .HFS+ Private Directory Data?
drwxrwxrwx  1   99   99          13 Oct 20 18:01 iTunes
drwxrwxrwx  1   99   99          12 Sep  7 10:34 Other
drwxrwxrwx  1   99   99           8 Sep  6 08:17 Photos
drwx------  1   99   99           5 Dec 23  2017 .Spotlight-V100
d-wx-wx-wt  1   99   99           3 Sep  6 10:27 .TemporaryItems
d-wx-wx-wt  1   99   99           4 Oct 12 18:24 .Trashes
drwxrwxrwx  1   99   99          10 Sep 11  2017 Tutorials
drwxrwxrwx  1   99   99          13 Oct  4 17:42 TV Shows
drwxrwxrwx  1   99   99           9 Sep 29 17:07 Videos
-rw-r--r--  1   99   99 53687213568 Oct 15 08:08 .cache.dmg
-rw-r--r--  1   99   99           0 Sep  7 08:49 .com.apple.timemachine.donotpresent
-rw-r--r--  1   99   99       22532 Oct 21 06:48 .DS_Store
----------  1 root root   234881024 Dec 23  2017 .journal
----------  1 root root        8192 Dec 23  2017 .journal_info_block

/etc/samba/smb.conf:

[NAS]
comment = NAS Folder
path = /media/HDD
valid users = @users
force group = users
create mask = 0775
directory mask = 0775
read only = no
force user = walter
1

It looks like you have the mount permissions as read/write for root but only read for anyone else. I think you would need to set the permissions on /media/HDD to be writeable for the walter user or the users group.

sudo chown -R root:users /media/HDD will set the group permissions to users (I presume this exists?) or sudo chown -R walter:users /media/HDD will make it owned by walter.

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.