Adding mounted Linux Drive to Plex

Server Version#: Version 1.22.3.4523
Player Version#:4.54.5
Linux OS: Ubuntu 18.04

I suspect this maybe a bug within Plex, but I have been having issues with using secondary drives within Plex. I can access the drive without issues via windows and SSH’d into the machine but Plex is unable to located any files. One day I noticed my mappings where reset to default as my Media was no longer accessible (after the media failed to play). But attempting to add that directory back left me without any content. Plex just doesn’t seem to see anything.


image

$df
dev/sdb       7814026580 7813981968     44612 100% /Media

Part of the issues is I am unable to navigate to the /Media folder within plex, normally I would just use the entire UNC path but that has, or recently failed.

May 15, 2021 22:58:27.465 [0x7fc3ee813780] DEBUG - Performing a scan with 'Plex Series Scanner' (language: en virtual: 0).
May 15, 2021 22:58:27.465 [0x7fc3ee813780] DEBUG -   * Scanning /Media/Videos/TV Shows
May 15, 2021 22:58:27.465 [0x7fc3ee813780] DEBUG -   * Marking media not available in /Media/Videos/TV Shows
May 15, 2021 22:58:27.465 [0x7fc3ee813780] DEBUG -   * Taking 0 items out of the map (which has 0 items) for being unavailable.
May 15, 2021 22:58:27.465 [0x7fc3ee813780] DEBUG -   * Taking 0 directories out of the map (which has 0 dirs) for being unavailable.

How’s your fstab?

As I stated this worked before, not sure why this would be giving issues now but open to ideas (as I’m out)

$sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=8f023616-d8d5-4f0a-a19b-ea650b4382d0 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=F4BA-361D  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda3 during installation
UUID=a74079f7-6425-484d-ab7b-05871bcd9d63 none            swap    sw              0       0
# Maping media
UUID=1AAF28E80B2EC336 /Media auto nosuid,nodev,nofail,x-gvfs-show 0 0

It may help to know that this server was down for a while, as I was moving systems around. Came this this. Normally just adding the paths back would address it, but I not a clue here.

If I may suggest?

Conduct this simple experiment.

  1. sudo mkdir /test
  2. sudo chmod 755 /test
  3. sudo mount /dev/sdb2 /test

This creates the mount point, sets permissions of the mount point dir prior to mount so Plex can read, then let’s the OS set default options when mounting.

  1. Now create a library section pointing at /test/xxxx (whatever is underneath as appropriate.

I suggest this because:

  1. Many often overlook the permissions of the mount point directory which, on some distros, defaults to 700 (no permissions for anyone but root)
  2. Micromanaging the mount often leads to troubles. Best practice is to use minimal control, e.g. ro,nofail,bg

I’ve trying your suggest with the bellow results:

$sudo mount /dev/sdb /plex
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.

Which makes since as the drive is already mounted as /Media. I did look at the folder permission as seen bellow

$ll
drwxrwxrwx   1 root root  4096 May 15 22:49 Media/

So permission wise it should be ok. Looking into I check the folder I created for the test and noticed it was also not visible to plex. So I tried the following

$sudo mkdir /home/test

With these permission it seem to have work, amd am able to locate the file with Plex, however it fails if done within the root directory. The issues seem to exist with the location, as any newly created folders are not see by Plex

$sudo mkdir /test

Ended up as expected not visible, I may try editing my fstab file too see if that helps.

doh…

  1. ls -la /

  2. Look at the value for . (dot)

  3. Now make the root readable.


sudo chmod 755 /

It sounds like you have ACLs / perms on the root directory itself which are super strict.

$ls -la /
drwxr-xr-x  27 root root  4096 May 16 01:54 .
drwxr-xr-x  27 root root  4096 May 16 01:54 ..

Seem it was already made readable, just for kicks I tried

$sudo chmod 777 /
drwxrwxrwx  27 root root  4096 May 16 01:54 .
drwxrwxrwx  27 root root  4096 May 16 01:54 ..

But Plex was still unable to see the folders

I am working going thought Using EXT, NTFS, or other format drives (internal or external) on Linux atm.

Changed the mount to ‘ntfs’ and to 0 1 instead of 0 0, which did not help, then changed it to ‘ext4’ and that seem to have worked.

I’ve also noticed that Plex is creating a duplicate server whenever the PC reboots. Reference to the old one seem to fails (causing the pinned ‘Movies’ and ‘TV Shows’ to fail). But the new instance seem to work by using ‘ext4’ for the mounting.

Interesting, changing it back and ‘ntfs’ causing it to fail, I changed it back to ‘ext4’ and they no longer worked. So I just calling it just being lucky the first time it worked. But this at least suggest it be and issue with mounting the driver over a permission issues. Bellow is my current fstab with relationship to the drive

nano /etc/fstab

# Maping media
UUID=1AAF28E80B2EC336 /Media ntfs defaults,auto,rw,nofail 0 1

Which device is that UUID ?

df and look for it.

sudo blkid /dev/sdXX

verify the file system type

Show me the error. I suspect you don’t have the ntfs package installed if it’s NTFS

$df
/dev/sdb       7814026580 7813981968     44612 100% /Media

$blkid /dev/sdb
/dev/sdb: LABEL="Media" UUID="1AAF28E80B2EC336" TYPE="ntfs" PTTYPE="dos"

No errors that I can find.

ok.

now dpkg -l | grep ntfs

you should find ntfs-3g

Bellow as requested

$dpkg -l | grep ntfs
ii  libntfs-3g88                               1:2017.3.23-2ubuntu0.18.04.2                        amd64        read/write NTFS driver for FUSE (runtime library)
ii  ntfs-3g                                    1:2017.3.23-2ubuntu0.18.04.2                        amd64        read/write NTFS driver for FUSE

I see you don’t have a partition table on the drive. Unfortunate but it should still work.

sudo mount -t ntfs-3g  /dev/sdb  /mnt      (use "ntfs" if "ntfs-3g" fails)
sudo ls -la /mnt

You should now get a listing of the NTFS drive.

Confirm please ?

When I tried to mount I got

$sudo mount -t ntfs-3g  /dev/sdb  /mnt
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command

So I unmounted and tried again

$ sudo umount /dev/sdb
$ sudo mount -t ntfs-3g  /dev/sdb  /mnt

And got the expected results

$ sudo ls -la /mnt
total 352
drwxrwxrwx  1 root root   4096 Jun  3 19:59 .
drwxrwxrwx 27 root root   4096 Jun  4 06:34 ..
drwxrwxrwx  1 root root   4096 Mar  5 18:36 LinuxScripts
drwxrwxrwx  1 root root 348160 Apr 12 08:46 OBS
drwxrwxrwx  1 root root      0 Jul  1  2020 Videos

Then went into the Plex and selected the new path, which seem to have resolve it. However I find it odd that this worked prior. Maybe a linux/plex update broke the interaction? Could the issues with mounting the drive the root folder be the main issues?

Oh… that error?

Where is it mounted? In the file manager Nautilus?

If so, sudo umount /dev/sdb

Now try it all again.

It was mounted at \Media

yeah… That’s the automounter. It’s a PAIN.

It’s also what blocked plex from seeing the contents because it was exclusive to your username.

Linux is VERY strict about permissions.

One user cannot see another’s files without expressly granted permissions.
(The chmod commands I’ve shown)

1 Like

Ah, so Nautilus automount was the issues? Interesting, as I though i fixed that issue. (Used to automount as root, which prevent me as a user from access it)

Nautilus is aggressive. Gnome runs as root so it’s going to get you anyway .