Here is the sequence I used to create my mount points:
sudo bash
mkdir /nas
cd /nas
mkdir movies moves2 tv tv2 tv3 music oldmusic animated uhd
chown -R chuck.chuck /nas
chmod -R 755 /nas
At this point,
- User
chuck.chuck has full ownership of the directories for administrative need (without need of root).
- Base directory permissions grant
chuck.chuck full RWX, and everything else gets R-X (where ‘X’ is traverse / transit through )
I prepare to make the mount
- Create a user
plex on the Synology if Plex isn’t installed there (It doesn’t need to login)
- I already have user
chuck on the Synology as well.
- On the Synology, I grant:
a. User chuck - R/W permissions to the media shares
b. User plex - R/O permissions to the media shares
- I come back to Linux:
# Elevate to root privilege level
sudo bash
# if NFS isn't already installed. Ubuntu doesn't by default
apt install -y nfs-common
# Mount the movies share manually
mount ip.addr.of.syno:/volume1/movies /nas/movies
# Mount the movies2 share manually
mount ip.addr.of.syno:/volume1/movie2 /nas/movies2
# Now test in PMS
When confirmed, Add entries to /etc/fstab
ip.addr.of.syno:/volume1/movies /nas/movies nfs defaults,auto,nofail,bg 0 0
ip.addr.of.syno:/volume1/movies2 /nas/movies2 nfs defaults,auto,nofail,bg 0 0
# if not root, elevate again
sudo bash
# Stop Plex and change to the automatic mount
systemctl stop plexmediaserver
# mount the shares by referencing the target directories to verify /etc/fstab is correct
mount /nas/movies
mount /nas/movies2
# There should be no errors in the above 2 commands. If so, find and repair the typo
# errors in /etc/fstab
# Restart Plex
systemctl start plexmediaserver
# Continue normally
As one final check, see what mount reports
sudo mount | grep /nas
It will report the mounted shares and the options used.
Helped a lot but when I try and add the directory to plex media server it doesn’t see the various folders unless I change the nfs permissions and enable mapping on the nas. What should I do?
I’m sorry, I left out a few details (I think).
- On the Synology:
a. Control Panel - Users - Add user plex (no login needed) if one doesn’t already exist. Make certain to use lowercase “plex” as the name.
b. Now go to each media share which Linux user plex needs to read – Control Panel - Shared Folders - EDIT - Permissions tab - Add user plex.
c. Save those changes
- Return to Linux
- Now you should see everything show up without any special changes to your NFS settings.
Do I need to create a user and group called gordon on my nas? The created mount point is showing as unreadable.
If you’re going to use gordon to write to the NAS,
- Create an account for
gordon.
- Place it in the
users group (what Synology wants)
Plex is also in the users group.
The first two are the permissions when it’s not mounted and the last pic is the permissions when rooted.
I just used the admin user on nas before and my gordon account on my pc.
Not sure what’s going on but I think I’ve done the permissions correctly.
It looks like you have.
On Synology,
- Synology actually creates all files as user
root:root.
- They use their internal database and ACL mechanism (Control Panel - Shared Folders - Permissions) to manage what can be seen, read, and written.
- If you notice the screenshot of the permissions:
rwxr-xr-x
This means that everyone can read the files via NFS (‘group’ and ‘other’ permissions octets) which confirms to the default for directories of 755.
- Go to the Synology and give
gordon permission to write to the shares and test.
gordon should be able to write without any alterations to what Linux sees.
- That succeeding, you’ll be set.
If anything gives you difficulty, we’ll adjust.
Still the same issue. Can’t access the mount point. When it’s not mounted gordon has ownership but seems when I mount that root takes over and then I can’t access it. Is this due to the sudo command prior to mount?
Did you create user gordon, group users on the Synology?
Yep. When applying permissions to folder on pc should I use gordon:users or is gordon:gordon right?
First, on the Synology:
Do the shares mounted under /NAS have appropriate permissions?
Use ls -la and copy/paste the text please. (much easier)
admin@DiskStation:/volume1$ cd DiskStation
admin@DiskStation:/volume1/DiskStation$ cd Media
admin@DiskStation:/volume1/DiskStation/Media$ ls -al
total 20
drwxrwxrwx+ 4 admin users 4096 Jun 8 02:00 .
drwxrwxrwx+ 6 root root 4096 Jun 8 01:32 …
drwxrwxrwx+ 2 admin users 4096 Jun 8 01:59 Movies
drwxrwxrwx+ 2 admin users 4096 Jun 8 02:34 TV Shows
Sorry was it permission for the mount point on the pc you wanted or permissions on synology?
Yes. I want to see what Linux sees.
gordon@Ubuntu:/NAS$ cd DiskStation
gordon@Ubuntu:/NAS/DiskStation$ ls -al
total 8
drwxr-xr-x 2 gordon gordon 4096 Jun 8 01:34 .
drwxr-xr-x 3 gordon gordon 4096 Jun 8 01:34 …
gordon@Ubuntu:/NAS/DiskStation$
that’s correct.
Verify for me what you have in /etc/fstab for the shares.
192.168.1.10:/volume1/DiskStation /NAS/DiskStation nfs defaults,auto,nofail,bg 0 0
The share on the Synology is named DiskStation ?
Yes, then Media folder within that, Movies in that etc
Ok… now to walk the sequence ( just to be sure )
User gordon, which you created on the Synology, and placed in group users, has permission to R/W for the share DiskStation