I have been racking my brain over this, i have a Raspberry Pi4, i want to connect to a Qnap NFS share and have PLEX on the Pi read it.
I have created a folder /srv/nas, i chmod that folder 777
I mounted the NFS share and have edited my fstab file so it auto connects.
Terminal can “ls” the /srv/nas/Movies folder, VNC can see the /srv/nas/Movies folder…
VNC as the pi user can see the movies folder and play a file.
VNC cannot browse through the “TV Shows” subfolders tho.
Plex can see the mounted folders, but no content.
Plex is running as user “pi”
I also have a “TV Shows” folder that i can “ls” to in Terminal, but i cant view any files as there are subfolders.
My Qnap is setup with NFS (all versions enabled, with no Root Squash and everyone read access) This has been fine for my Kodi boxes, and Windows machines forever…
Can anyone please assist?
What are directory permissions before the mount? (that’s important)
Permissions on all the directories should be 755.
I offer one of my NFS fstab entries for additional info.
(I also have UID/GID matching setup in the QNAP)
I mount each share individually.
# movies
vienna:/movies /vie/movies nfs sec=sys,intr,rw,vers=4,timeo=15,auto,rsize=1048576,wsize=1048576,async,nofail,bg 0 0
Windows will use SMB - Doesn’t count here 
Did you remember to add NFS access rules in the share itself on QNAP?
hi, thanks for the reply.
I have * for NFS access, and as a “rule it out” i also added the IP of my Pi (10.1.1.2)
I have spoken to a friend at work, who mentioned i should run a recursive chmod on my mount folder.
eg.
sudo chmod -R /srv/nas 775
he also said to run
ls -al /srv/nas
and check what the read write \ owner etc. is.
Would you mind taking a screenshot of your Qnap NFS settings
and also a share permission settings?
Also, is there a way to install \ use SMB on a pi ?
Sure, you can install cifs-utils
The key words to help you in the future when searching is to search for CIFS . SMB in Linux won’t get you where you want.
ok, i will have a look tonight after work and first check my permissions with ls -al and then perhaps look at trying to use CIFS , but if you could maybe help me with some screenshots that would be great and i can also take some and pop up here too.
Can you show me your fstab entry for the QNAP mount?
Regarding recursive chmod, not necessary but will make it more legible on the desktop side (actual nice color instead of everything 777 monochrome.
You can also see that unless done by my username, nothing can delete the media.
I have, which I do from the QNAP for speed but is self maintaining after initial setup.
cd /share/CACHEDEV2_DATA (my main storage)
find ./movies* ./tv* ./music* -type d -exec chmod 755 {} \;
find ./movies* ./tv* ./music* -type f -exec chmod 644 {} \;
With this, you can get nice listings.
Here is a LS on my mounted folder from the Pi.
pi@raspberrypi:/srv/nas $ ls -al
total 244
drwxrwxrwx 16 root root 4096 Jan 23 20:02 .
drwxr-xr-x 3 root root 4096 Jan 28 19:08 …
drwxrwxr-x 2 pi pi 4096 Jan 23 20:02 ‘?’
-rwxrwx— 1 503 users 15364 Dec 25 2012 :2eDS_Store
-rwxrwx— 1 503 users 368 May 7 2017 ..apdisk
-rwxrwx— 1 503 users 296 Oct 5 2012 .apdisk
drwxrwx— 2 root nogroup 4096 May 5 2013 .AppleDesktop
-rwxrwx— 1 root root 368 May 7 2017 ..DS_Store
-rwxrwx— 1 root root 12292 Aug 17 2017 .DS_Store
drwxrwx— 2 99 root 4096 Sep 21 2013 .hccache
drwxrwxrwx 3 503 users 65536 Jan 27 20:21 Movies
drwxrwx— 3 503 users 4096 Jul 28 2011 ‘Network Trash Folder’
drwxrwx— 2 root root 4096 Nov 30 2015 .nvr
drwxrwx— 3 root root 4096 Nov 30 2015 .record_nvr_tmp
drwxrwx— 3 root root 4096 Nov 30 2015 .record_nvr_unf
drwxrwxrwx 7 root root 4096 Nov 18 2017 .streams
-rwxrwx— 1 503 users 368 May 7 2017 ._.TemporaryItems
drwxrwx— 4 503 users 4096 Sep 14 2013 .TemporaryItems
drwxrwx— 3 503 users 4096 Jul 28 2011 ‘Temporary Items’
drwxrwx— 4 root root 4096 Dec 26 2012 .@__thumb
drwxrwx— 2 503 users 4096 Jul 2 2016 .Trashes
drwxrwxrwx 150 503 users 4096 Jan 15 23:07 'TV Shows’
pi@raspberrypi:/srv/nas $
Here is my Fstab entry
10.1.1.15:/Multimedia /srv/nas nfs noauto,x-systemd.automount 0 0
an LS -al of my Movies folder shows some are users, some root…
pi@raspberrypi:/srv/nas $ cd Movies
pi@raspberrypi:/srv/nas/Movies $ ls -al
total 2094261204
drwxrwxrwx 3 503 users 65536 Jan 27 20:21 .
drwxrwxrwx 16 root root 4096 Jan 23 20:02 …
-rwxrwx— 1 root root 733937664 Dec 2 2017 ‘101 Dalmations [1961].avi’
-rwxrwx— 1 503 users 368 May 8 2017 ‘._127 Hours.mp4’
-rwxrwx— 1 503 users 951435278 Jun 5 2011 ‘127 Hours.mp4’
-rwxrwx— 1 503 users 774426624 May 24 2013 ‘12 Rounds Reloaded.avi’
-rwxrwx— 1 root root 1967808512 Jan 3 2014 ‘12 Years a Slave [2013].avi’
-rwxrwx— 1 root root 992468908 Mar 23 2014 ‘13 [2010].mp4’
-rwxrwx— 1 root root 1433619259 Jul 12 2019 ‘13 Ghosts [1960] [1080p].mp4’
LS- al of my “/srv/nas/TV Shows” (note these are folders)
pi@raspberrypi:/srv/nas/Movies cd "/srv/nas/TV Shows" pi@raspberrypi:/srv/nas/TV Shows ls -al
total 1304
drwxrwxrwx 150 503 users 4096 Jan 15 23:07 .
drwxrwxrwx 16 root root 4096 Jan 23 20:02 …
drwxrwx— 4 root root 4096 May 22 2018 ‘13 Reasons Why’
-rwxrwx— 1 503 users 24580 Dec 25 2012 :2eDS_Store
drwxrwx— 3 root root 4096 Mar 23 2019 ‘After Life’
drwxrwx— 4 503 users 4096 Nov 18 2017 ‘All Aussie Adventures’
drwxrws— 11 503 users 4096 Sep 19 21:40 ‘American Horror Story’
drwxrws— 7 503 users 4096 Nov 18 2017 ‘American Restoration’
Notice, i cannot enter those folders from terminal
pi@raspberrypi:/srv/nas/TV Shows $ cd “13 Reasons Why”/
-bash: cd: 13 Reasons Why/: Permission denied
pi@raspberrypi:/srv/nas/TV Shows $ cd “/srv/nas/TV Shows/13 Reasons Why”
-bash: cd: /srv/nas/TV Shows/13 Reasons Why: Permission denied
pi@raspberrypi:/srv/nas/TV Shows $
On the QNAP, cat /etc/fstab and look at the UID/GID of pi.
Start matching up / tracking down where the UIDs are coming from.
If your system is line mine, I simply edited /etc/passwd on the QNAP and reapplied chown to my login’s home directory via the ssh shell.
Notice I kept the UID of my Linux system and the GID from the QNAP.
[~] # hostname
wien
[~] # grep chuck /etc/passwd
chuck:x:1026:100:chuck,,,:/root:/bin/sh
[~] #
You might benefit from asserting setuid on the directories.
Once setup, the owning UID will always be locked to that of the parent directory.
It’s a nice way to automate file management .
While I wrote this to help DVR, it’s also helpful when multiple UIDs are working and there isn’t an IPA/LDAP style server to coordinate everything.
Please give a careful read. Play with it in /tmp as the example shows. If you like it, become comfortable with it before you implement.
Sorry i dont understand, i only use the GUI on the nas and not terminal.
Interesting… i ran the following and now i can change through TV Shows folders and user is listed as pi pi
Plex can also see the files when im adding share… its still not added them but its better than before.
pi@raspberrypi:~ sudo chown -R pi:pi /srv/nas
pi@raspberrypi:~ ls -al /srv/nas
total 244
drwxrwxrwx 16 pi pi 4096 Jan 23 20:02 .
drwxr-xr-x 4 root root 4096 Jan 29 18:55 …
drwxrwxr-x 2 pi pi 4096 Jan 23 20:02 ‘?’
-rwxrwx— 1 pi pi 15364 Dec 25 2012 :2eDS_Store
-rwxrwx— 1 pi pi 368 May 7 2017 ..apdisk
-rwxrwx— 1 pi pi 296 Oct 5 2012 .apdisk
drwxrwx— 2 pi pi 4096 May 5 2013 .AppleDesktop
-rwxrwx— 1 pi pi 368 May 7 2017 ..DS_Store
-rwxrwx— 1 pi pi 12292 Aug 17 2017 .DS_Store
drwxrwx— 2 pi pi 4096 Sep 21 2013 .hccache
drwxrwxrwx 3 pi pi 65536 Jan 29 18:24 Movies
drwxrwx— 3 pi pi 4096 Jul 28 2011 ‘Network Trash Folder’
drwxrwx— 2 pi pi 4096 Nov 30 2015 .nvr
drwxrwx— 3 pi pi 4096 Nov 30 2015 .record_nvr_tmp
drwxrwx— 3 pi pi 4096 Nov 30 2015 .record_nvr_unf
drwxrwxrwx 7 pi pi 4096 Nov 18 2017 .streams
-rwxrwx— 1 pi pi 368 May 7 2017 ._.TemporaryItems
drwxrwx— 4 pi pi 4096 Sep 14 2013 .TemporaryItems
drwxrwx— 3 pi pi 4096 Jul 28 2011 ‘Temporary Items’
drwxrwx— 4 pi pi 4096 Dec 26 2012 .@__thumb
drwxrwx— 2 pi pi 4096 Jul 2 2016 .Trashes
drwxrwxrwx 150 pi pi 4096 Jan 15 23:07 ‘TV Shows’
I did a bit more, (probably too much ownership etc.) but its finally looking like its working.

The following shows a working vs not working folder
Windows can still access it and its properties show “Unix User\1000” as the owner…
Since it can now read your media. Anything which doesn’t match is going to be a naming problem.
The cleaner you can name them, the faster and easier they match.
Yep, it was working away overnight processing it all.
I will check tonight to make sure any new files copied to those shares from my Windows machine get picked up and have the inherited permissions…
What a pain tho, this was so much harder than it should have been.
I guess, i dont have much linux experiance.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.








