Plex Media Server: Won't find media External Hard Drive
Solution 1:
You have to make sure that the user plex
has access not only to the drive, but the folder that the drive is mounted in. After a lot of tinkering I wound up going this route:
Edit the Mount Options (Disks -> "More Actions" (the two gears under the "Volumes" map) -> Edit Mount Options) such that:
nosuid,nodev,nofail
is in the area for storing the options in the /etc/fstab file (the textbox under "Symbolic Icon Name")
and set the Mount Point to be:
/media/<user>/<HDD Name>
and remount your HDD so that it will appear in the specified location.
Next, add yourself to the plex
user group by going to the Terminal and enter:
sudo adduser "$USER" plex
Now, you can modify the ownership of the relevant files and directory so that they are owned by ${USER}:plex
. You can give plex read-access to the drive by going to the Terminal and enter:
sudo chgrp plex "/media/${USER}/"
sudo chmod g+rX "/media/${USER}/"
sudo chgrp plex "/media/${USER}"/<HDD Name>/
sudo chmod g+rX "/media/${USER}"/<HDD Name>/
It may also be necessary to ensure that ACL permissions are properly configured, so the following might also be necessary:
sudo setfacl -m g:plex:rx /media/<user>/
FYI: If a file/directory displays a
+
symbol as part of its permissions (e.g.drwxr-xr-x+
) that means that ACL controls are active for that file/directory.
Now that Plex has access to the drive, you need to make sure that it has access to all files in the relevant directories. This can be done by repeating the following for all of your media library folders:
chmod -R g+rX /media/<user>/<HDD Name>/<Library Folder>
This solved my issues for the two extra drives I've added to my HTPC. Hope it helps.
PS: As @douggro mentioned, Plex has a good article on the subject, but they changed up the structure of their site, so it took me a while to find it from his link, so here's a more current link to the page: Plex Linux Permissions Guide
Solution 2:
As several people have mentioned, the issue is likely due to the plex
user not having the correct permissions. I had a similar problem, and was able to fix it using a few easy steps.
Open this config file:
sudo nano /etc/default/plexmediaserver
Find this line:
PLEX_MEDIA_SERVER_USER = plex
Replace plex
with your username, and save the file. Once I restarted my computer, Plex was able to access the folders on the external drive.
You may be able to run sudo mount -a
and/or sudo service plexmediaserver restart
instead of rebooting.
Credit: htpcguides.com
Solution 3:
I don't know what's going on, but the only thing that helped me with ext4 drive was setting in "Disks" app "Automatic Mount Options" - "OFF" and setting "Mount Point" "/mnt/foobar" instead of "/media/username/foobar".
Solution 4:
Try adding Plex to the plugdev group.
Open a terminal (Press ControlAltT) and enter
sudo gpasswd -a plex plugdev
Verify that plex was added to the plugdev group by entering:
groups plex
which should display what groups plex belongs too. Next, reboot the computer and start plex to verify this corrected the problem.
Solution 5:
You need to configure fstab to set the proper permissions.
There is a whole page about how to do this on the Plex site, see: https://support.plex.tv/hc/en-us/articles/200288606-Mounting-NTFS-Drives-on-Linux
To make it short:
-
Find the UUID of your drive:
sudo blkid | grep ntfs
-
create a directory where you will mount the drive:
sudo mkdir /media/ext_NTFS_USB_Drive
-
edit file /etc/fstab with command:
gksu gedit /etc/fstab
-
add a line to this file and save.
UUID=485CBF485CBF3014 /media/ext_NTFS_USB_Drive ntfs-3g permissions,auto 0 0
where the UUID is the one your drive and the mount point is the folder you created.
-
now mount the drive:
sudo mount /media/ext_NTFS_USB_Drive
(you might get an error saying the drive is already mounted, in Nautilus for example. Just unmount it - Safely Remove Drive, or click the Eject Icon in Nautilus)
Now in Plex, you need to change the location of the media folder you were trying to add to somewhere inside: /media/ext_NTFS_USB_Drive