Linux Tips

Using other hard drives (Windows or Linux) with PMS

This How-To is written to help with Internal and External drives. It also is written to demonstrate how to cope with NTFS and EXT4 formatted drives. By logical extension, any format supported by Linux can be handled using the technique shown here. In all cases, the goal is to give user plex permission to read your media files which Linux doesn’t allow by default due to its strict security model.

We will walk through the steps needed to add these external USB hard drives and internal hard drives, either formatted as NTFS or ext4, to your Linux configuration so Plex Media Server can access it.

Three disks will be added.

  • An external ext4-formatted disk.
  • An external NTFS-formatted disk.
  • An internal hard drive which, in this example, happens to be NTFS formatted. It may also be HPFS formatted as Linux supports this natively.

Any disk formats which Linux supports, regardless of whether internal or external, can be added as shown below.

For reference purposes, this document was created using Fedora 24 Linux with the Gnome desktop and the Nautilus graphical file manager. Linux shell (command line) commands are bold face text.

A. Identify the disk(s) you want to add in the graphical disk manager

We get the device names, which we only need temporarily, using the command df

[chuck@lizum ~]$ df
Filesystem  1K-blocks      Used  Available Use% Mounted on
/dev/sda5   128884388  19057076  103257328  16% /
/dev/sda2      487652    146960     310996  33% /boot
/dev/sda7   970737276 159145788  762923072  18% /home
/dev/sda1   831543292 149144996  682398296  18% /run/media/chuck/8E7025AD70259D49
/dev/sdb1  1922728752  11372564 1911339804   1% /run/media/chuck/Media-3
/dev/sdc1  1953480700  91720372 1461760328  26% /run/media/chuck/Chuck 2T

We have identified internal disk partition /dev/sda1 and external USB disks “Chuck 2T” and “Media-3” as the disks we want made available to Plex .
Now we use this information to obtain the rest of the information we need.

The following steps must be performed as the Super-User (root).

[chuck@lizum ~]$ sudo sh
Passwd:
[root@lizum chuck]# 

B. Get the ‘Block Id’ or device name (/dev/sdxx) of the disk partition(s) we are interested in

Get the label UUIDs for the USB drives (format does not matter) because their device names can change. This ensures they always mount at the same location. This step also provides us with the partition’s format.
We will need this.

[root@lizum chuck]# blkid /dev/sda1
/dev/sda1: UUID="8E7025AD70259D49" TYPE="ntfs" PARTUUID="000ac519-01"

[root@lizum chuck]# blkid /dev/sdb1
/dev/sdb1: LABEL="Media-3" UUID="50f1a141-bc8a-48ba-9b29-8a7bee8043e9" TYPE="ext4" PARTUUID="d456a9a6-9727-4143-be3e-f946400ec3ba"

[root@lizum chuck]# blkid /dev/sdc1
/dev/sdc1: LABEL="Chuck 2T" UUID="56EA5848EA582691" TYPE="ntfs" PARTUUID="542c75ae-01"

We now have both the UUID and partition formatting. Both pieces are needed below.

C. Create the locations where we will graft everything into Linux

The directory `/disks’ has been chosen because Gnome “Nautilus” and Ubuntu (in general) claim exclusive access to anything found in /media. This prevents conflicts with those desktop components.

In this example, the username ‘chuck’ should be replaced with your actual Linux username . This allows you to maintain full ownership and control of the media without needing to use the superuser (root) account each time.

# The location 
[root@lizum chuck]# mkdir /disks /disks/c /disks/media3 /disks/chuck2t
[root@lizum chuck]# chown -R chuck:chuck /disks

[root@lizum chuck]# ls -la /disks
drwxr-xr-x   3 chuck chuck 4096 Jul 27 11:14 .
dr-xr-xr-x. 30  root  root 4096 Jul 27 11:14 ..
drwxrwxrwx   4 chuck chuck 4096 Jul 27 11:04 c
drwxrwxrwx   4 chuck chuck 4096 Jul 27 11:04 chuck2t
drwxrwxrwx   4 chuck chuck 4096 Jul 27 11:04 media3
[root@lizum chuck]#

Having created the directories as root, verify empty (unmounted) directory permissions are 0755 before mounting

D. Create the entry in the file system table where to mount the disk each time the system boots

Edit the file system table Linux uses to mount all drives using your favorite text editor. Text editors commonly found are: vi, gedit, nano, and xed.

Gedit is a graphical-based editor (WYSIWYG) and may be easier as it’s more like Microsoft editors.

For the USB drives:

Create lines for your system like the lines below, pasting UUID= value and TYPE (ntfs or ext4) from above, plus the directory locations just created where the external drives will always be found.

Best practice for USB drives is to use the UUID= method. USB drives will change physical device name from use to use. UUID= guarantees they always are mounted in the same location.

Use caution editing /etc/fstab. Mistakes can force you to take manual recovery/editing steps in command line mode ONLY** comment out the erred line(s) during recovery**

[root@lizum chuck]# vi /etc/fstab  (or use whatever text editor is available / favorite  and add the following lines, using your information)

# Addtions for external and internal drives
# Mount Media-3 (ext4)  at /disks/media3 for Plex
UUID=50f1a141-bc8a-48ba-9b29-8a7bee8043e9 /disks/media3  ext4  defaults,auto,rw,nofail 0 1

# Mount Chuck-2T (NTFS) at /disks/chuck2t for Plex
UUID=56EA5848EA582691                     /disks/chuck2t ntfs  defaults,auto,rw,nofail 0 1

# Mount /dev/sda1 directly  READ-ONLY,  and use the device name because it will never change
/dev/sda1                                 /disks/c       ntfs  defaults,auto,ro,nofail 0 1

Save and test. (Both Redhat & Debian shown here)

# See where the disks are currently mounted and unmount
# (This is from Redhat)
df
umount /run/media/chuck/Media-3
umount /run/media/chuck/Chuck2T

# (This is from Ubuntu/Debian)
df
umount /media/chuck/Media-3
umount /media/chuck/Chuck2T


# mount each one individually to verify no errors
[root@lizum chuck]# mount /disks/media3
[root@lizum chuck]# mount /disks/chuck2t
[root@lizum chuck]# mount /disks/c
[root@lizum chuck]# ls  /disks/*         # this will produce a lot of output if correct.  Be prepared

E. Restart the computer and verify all is as expected**

[chuck@lizum ~]$ ls /disks/*    # The output here should be the same as the previous test above


[chuck@lizum ~]$ df 
Filesystem  1K-blocks      Used  Available Use% Mounted on
/dev/sda5   128884388  19057076  103257328  16% /
/dev/sda2      487652    146960     310996  33% /boot
/dev/sda7   970737276 159145788  762923072  18% /home
/dev/sda1   831543292 149144996  682398296  18% /disks/c
/dev/sdb1  1922728752  11372564 1911339804   1% /disks/media3
/dev/sdc1  1953480700 491720372 1461760328  26% /disks/chuck2t

[chuck@lizum ~]$

F. Correct (set) Linux file permissions (ext4 drives only)

Drives are now mounted. Verify PMS can read them.
NTFS drives do not require permissions to be set for Linux because they use a different mechanism.
We will only address the ext4 formatted drive.

[chuck@lizum ~]$ su
Password:

# change the default permissions to owner='rwx', everyone else to 'r-x' 
#  'x' means to traverse the directory to subdirectories & files
[root@lizum chuck]# find /disks/media3 -type d -exec chmod 755 {} \;

# change the default permissions to owner= 'rw-',  everyone else 'r-only'
[root@lizum chuck]# find /disks/media3 -type f -exec chmod 644 {} \;

G. Open Plex and add the external disk to your library

With the drives now mounted and permissions set, open PMS and add the media directories (folders) to the appropriate sections.

H. Update your Library

Manually invoke a Library update if you configuration isn’t configured to do so.

Back to top

10 Likes
Raspberry Pi Plex Server not seeing files on flash drive
Plex Media Server on Raspberry Pi3
Ubuntu 18.04 - PMS Permission denied while scanning media library
Playback Error Conversion failed. The transcoder exited due to an error
Raspberry Pi not able to setup
Trying to add my external harddrive as my media folder
Scan Library Files finds no items on USB flash drive
New library is listed but not scanned
Permissions Problem @ChuckPa or anyone else lol
PMS doesn't see subdirectories (Ubuntu)
Using USB drive for media
3 drives present, one cannot be added by PMS (Ubuntu 22.04LTS)
There was not enough free disk space to start the recording
Plex doesn't see files upon reboot
Plex cannot see raspberry pi external drives
Setting up library plex can't find folder
Interest in Raspberry Pi and OpenMediaVault
Unable to map external hard drive and pull videos
Lost access to my video folders - again!
Restoring library after computer crash
Unable to map external hard drive and pull videos
No write access to destination
Plex cant see directory / permissions
Plex doesn't scan all music sub folders
Commercial skipping not working - An error occurred while postprocessing
Issue Copying Configuration Files
Server cannot upload/load local media assets
I am absolutely lost with drive permissions on Linux
I am absolutely lost with drive permissions on Linux
Plex Media Server cannot see my video files
Can I have two identical sources for the same drive and not cause conflicts?
Can't add movies to library
PMS Migration Install Fail
Unable to add files from external database
Problem with adding files on newly installed Linux Mint
Using second drive (ext4) in Linux--tried the tip
Using second drive (ext4) in Linux--tried the tip
Plex on Raspbian won't load all files
Network Plex directory displays folders on 1st mounted drive folders, not new 2nd mounted drive
Plex Permissions on Raspberry Pi OS
Floundering newb needs help
Error code: s1001 (Network)
What do you get when you mix a Linux server + Auto Delete episodes + an NTFS external drive?
External drive not visible in Plex
External drive not visible in Plex
USB Stick on Raspberry Pi
The libraries are empty on Linux Mint last edition
Plex did not create a linux user for itself?
Folders not seen on drives for building Library in Linux Mint 21.1
Can't Add Folders to Library - Plex Server Can't See User Folder -LINUX-
Plex won't run anymore
Plex won't load library - raspberry pi 4
Media unavailable raspberry pi 3
WD my cloud home + Raspberry Pi 4 + PLEX
Errors moving / creating / accessing files and directories - permissions denied
Server can't find My HDD ubuntu 24.04
Setting up libraries
Ubuntu 20.04 PMS: Folders invisible to the "add folder" explorer in PMS
Plex Server on Raspberry Pi 4 64-bit Bookworm Denied Access to USB Drive
Help i cant see the folders
Playback error - Please check that the file exists and that the required hard disk is available
Can't add existing mp4 movies to Movies library
How to access windows ntfs drive on plex server dual-boot [BUG?]
Linux USB HDD
Mounting My Linux Library
Migrating Plex from Windows 10 to Ubuntu 20.04 and related questions
PMS can't access media folders on external drive
Not seeing folders or files on external hard drive
Can't select and view Folders inside HDD
New library location not seeing files
PLEX USB drive access?
Mounting My Linux Library
Raspberry Pi 3 Plex Server can't find the files in USB drive
Media library is empty
Cannot access Movies and TV Shows directories
Snap Installation vs deb installation
Trouble adding external HDD
Not Scanning New Directory after Moving Server
Web app says connected, but nothing is accessible
Getting plex to see folders on my external mounted hard drive in raspberry PI
Server with external usb 6tb hard drives (3)
Help for installing Plex Server on Ubuntu
Help for installing Plex Server on Ubuntu
Plex Media Server Not Recognizing My Movies
No media displayed in libraries Ubuntu 20.04.2
Can't see any files inside my external disk
This library is currently empty
Can't access the files in my media folders that are on a second hard drve
How to add movies on usb sticks to library
Plex wont read drive
How can i change the install directory when i downloaded plex media server from the snap store?
All files have red trash icon after hardware upgrade
Suggested Update to the Linux Tip for Mounting External Hard Drives
Trouble seeing shared folders on external HDD
Plex will not find videos within the folder that I associate with a library
File permissions on new external usb drive
UBUNTU 20.x PMS 1.28.2.6106
[Ubuntu 22.04] Unable to find media
Linux-based Plex not cooperating with my Wifi network
Read usb key content
Plex server does not recognise my usb stick
Tv Shows library no longer detecting changes to folders automatically
Btrfs partition vs Gpt partition and plex problem debian 12
Moving data from 2 HDDs to 1 HDD -
Ubuntu Plex recognized everything correctly except for my TV shows
Server won't update metadata
Unable to Add/Scan Library with new install
I upgraded my Ubuntu server to 22.04.1 and reinstalled plex, now Plex cannot find any of my files
Start PMS at boot with QSV hardware transcoding
Unable to end any files to my server
Manjaro - Cannot add Libraries on Mounted Drive
Help with PMS on ubuntu - no files scanned but mapped drives works
Linux mounts not seen by plexmedia server
[How To] Installing Plex Media Server on Ubuntu Linux
RAM disk full - expand?
Plex not Seeing RAID Array
[How To] Installing Plex Media Server on Ubuntu Linux
Help hard drive permissions/user & directory missing
Plex Media Server Unable to see Library on Raid
Cannot get media files to display, wondering if it is permissions or something else
Trying to Move from Windows 10 to Ubuntu Desktop
Trying to Move from Windows 10 to Ubuntu Desktop
Large Raspberry Pi Library Completely Local Files
Server with external usb 6tb hard drives (3)
Migrating from Windows to Linux. Need guidance on mounting NTFS on Linux
Migrating from Windows to Linux. Need guidance on mounting NTFS on Linux
Cannot scan library
Server with external usb 6tb hard drives (3)
Libraries and 6TB External Hard Drives
Plex Media Server doesn't see any of my files when scanning
Cannot add library folder from second drive
PMS deletes all media and disk is not mountable
Plex Media Server on Raspberry Pi
Changed to SSD and now Plex wont find my library
Problem installing server on laptop after Linux re-installation from backup
Easiest way to set up a plex server on linux?
Can not find attached HDD after updating mediaserver
Ubuntu - permissions changes to fix to access media files