Linux Tips

Mounting NFS network shares for Plex use

The basic checklist

  • Prepare the NAS:
  • Create a ‘mount point’ directory structure on your Linux machine which will be where all your media shares are grafted and made available for Plex use.
  • Create an entry in /etc/fstab for each share you wish to mount.
  • Mount and debug as needed

A. Prepare the NAS.

This is unique to each NAS. In general, you only need grant read permission. Should you desire Read/Write for yourself, we will allow for it

On Linux, Plex uses username plex. The username plex is the most desirable username to use for your NAS as well.

  • Add username plex to the NAS. If it requires a password, assign it one and you can use it later if/when needed.
  • Edit the share permissions for your NAS to either export.
    • “Read-only” to your LAN (all hosts) for all usernames -or-
    • “Read-write” for your username, and Read-only for plex

B. Create the Mount Point directory structure

It usually makes the most sense to create a structure which mirrors your NAS’s shares

An example structure might be:

/nas
/nas/movies
/nas/movies2
/nas/children
/nas/tv
/nas/cartoons
/nas/photos
/nas/music

To create this, we simply supply the Linux commands to create the structure and supply the basic permissions to those directories:

sudo sh
mkdir /nas  /nas/movies /nas/movies2 /nas/children /nas/tv /nas/cartoons /nas/photos /nas/music
chmod -R 755 /nas
exit

C. Create the entries to mount the NAS shares at their target locations.

Each nas vendor has a different pathname conventions. Please follow the documentation for your NAS.
In this example, Synology’s and QNAP’s conventions will be shown.
The photos library will be mounted Read-only to prevent accidental deletion by anyone.

The example systems are a twin volume Synology DiskStation and a single volume QNAP system

You will notice the two nas units are seamlessly blended together here. In the end, Plex will complete the blending into a single library if so desired.

/etc/fstab has the following entries added to it. These will require testing and possible adjustment for your NAS and configuration. NFS is shown here first.

if you have defined the hosts syno and qnap in /etc/hosts, you may use their names here otherwise use their IP addresses.
You may always use hostname or IP address interchangeably as long as there is a definitive resolution.

syno:/volume1/movies     /nas/movies           nfs    auto,defaults,nofail 0 0
qnap:/share/movies2      /nas/movies2          nfs    auto,defaults,nofail 0 0
syno:/volume1/children   /nas/children         nfs    auto,defaults,nofail 0 0
syno:/volume2/tv         /nas/tv               nfs    auto,defaults,nofail 0 0
qnap:/share/cartoons     /nas/cartoons         nfs    auto,defaults,nofail 0 0

# QNAP is .21
192.168.0.21:/share/Photos       /nas/photos           nfs    auto,defaults,nofail,ro 0 0

# Syno is .23
192.168.0.23:/volume2/music      /nas/music            nfs    auto,defaults,nofail 0 0

Save the file and now we begin testing.

D. Begin verifying and testing the new mount points

sudo sh
mount -avt nfs      # each will attempt to mount and give dialog as it does.   Look for "successfully mounted"

# follow up by seeing what actually is mounted
df

# check to see if you have visibility into each share

cd /nas
ls *     # This will list all the top level output from each share and will be voluminous so be prepared

If you have made any errors, you may work at the individual mount level

sudo sh
mount /nas/movies

ls /nas/movies

# Um,  That didn't work right   ... Change mount in /etc/fstab
umount /nas/movies

# after editing, try it again 
mount /nas/movies 

Repeat the above until you’re happy with all

There is one final step which will often help avoid permission issues on Linux systems (should the NAS be very security conscious)
This sets the permissions of the directories after they have been mounted too, effectively tweaking the NAS permissions a bit looser (read-only)

sudo chmod 755 /nas/*

All your network (NAS) media is now available to PMS starting with the /nas folder at the top.

Back to top

1 Like
Adding a NAS share to a Raspberry Pi Plex Server?
I'm struggling - Ubuntu, not finding new media
Ubuntu Plex Server
Linux setup-Server on one computer, files on NAS device
Linux Mint 19
Unable to see NFS mount in PMS
PlexMediaServer doesn't see subfolders under NFS-mount
Cannot Find Network Drive to Add Folder as a Library on Plex Ubuntu Server
How do I mount my shared media folders Ubuntu
Can't Add Folders to Library - Plex Server Can't See User Folder -LINUX-
Cannot get linux permissions to work with Ubuntu and an NFS mount
Add content from ip location
Hilfe: Automount von Netzwerklaufwerk funktioniert nicht
Plex Server and Movies on Different Computer
Remote libraries
Plex cannot read SMB or NFS mounted directory
PMS doesn't see subdirectories (Ubuntu)
PMS in distrobox: how to access NFS folder?
Creating plex user in Synology NAS for NFS mounts
Plex doesn't see files upon reboot
Can't install Plex
No write access to destination
Linux Mint Server Accessing WD EX4100 NAS with NFS
Network Plex directory displays folders on 1st mounted drive folders, not new 2nd mounted drive
Error code: s1001 (Network)
Centos 7 and Library Permissions
Library empty when mounting network volumes in Ubuntu
Media files not showing
Bitte um Hilfe: Mount Ordner bzw. Inhalt wird von Plex nicht gefunden bei "Ordner hinzufügen"
Harware and how to connect?
Ubuntu 20.04 PMS: Folders invisible to the "add folder" explorer in PMS
PMS Directories Disappearing
FritzNas als Medienserver für Plex
Plex and Mounted drives
Not enough disk space to convert this item
Movie folder is empty
Adding Folders on ReadyNAS RN516 to Plex Library Not Working
Moving metadata to NAS results in SQlite lock issues and other problesm. Have read FAQs
Adding Second Folders to Libraries
Set up Plex on Linux - access to SMB on NAS
Tv Shows library no longer detecting changes to folders automatically
Unable to end any files to my server
Help with PMS on ubuntu - no files scanned but mapped drives works
New PMS install on Ubuntu, cannot mount existing share on Synology
Syno NFS Permissions
X265 files randomly stopped being scanned (X265 changing permission at file level)
[How To] Installing Plex Media Server on Ubuntu Linux
[How To] Installing Plex Media Server on Ubuntu Linux
Newer PMS versions not adding content
Plex Media Server doesn't see any of my files when scanning
Plex permissions are not working - need help please
Easiest way to set up a plex server on linux?