Score:1

Ubuntu - Plex Media Server: not seeing additional drives

tw flag

Good Afternoon Everyone,

I have successfully installed Plex Media Server on my SSD which has access to my Synology NAS. I have an additional drive (NFS HDD) installed (photo below) which I would like Plex Media Server which is inside a docker (Dockstarter) to have visibility of:

additional drives - VHDs(/dev/sdc5 is what I want to use.)

When I go into Plex, it seems that this drive is not visible:

The structure doesn't include the additional drive (/dev/sdc5)

I have checked and the drive is mounted, but feel like I am missing something. I now know how to mount an external hard drive (nfs) but do I need to do the same thing for an internal? Could someone please advise?

System details:

Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy

Thank you for your time.

-- edit

I've now managed to mount the NFS drive manually. I changed the mount point to my home directory (/home/dandy/mnt/additionaldrive) so Plex could see it. Next up, fstab. I think it's likely to be:

'/dev/sdc5 /home/dandy/mnt/additionaldrive nfs nofail,defaults,rw,user 0 0' but I'm not sure?

Is there a way to also make it so it never disconnects?

Score:1
do flag

Looks like your problem is a combination of mounting a drive permanently and defining it in Plex with the proper ownership/permissions.

Mounting

To mount a drive manually, use the following command:

sudo mount /dev/sdc5 /home/dandy/mnt/additionaldrive

The problem with this command, however, is that the mount won't survive a reboot. Therefore, to have it mounted during boot, you need to edit your /etc/fstab file. But first, you need to find the UUID of the particular partition that you want to mount. Use the command ls -l /dev/disk/by-uuid to find the UUID. On my system, I get the following:

$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jul  2 16:13 0b132a87-938e-4654-b734-6a4a4105ca9c -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  2 16:13 10442e1e-b19d-4b3a-8bb0-37c6dfb2e8ef -> ../../sdc1
lrwxrwxrwx 1 root root 10 Jul  2 16:13 2797e94e-82c5-4f66-8911-ad32fe5c8e73 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul  2 16:13 2ae71809-1068-4d24-b611-9e3d9270cc71 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jul  2 16:13 fa789f63-a537-47cb-8f16-6348e4182b31 -> ../../dm-1

Once you identify the UUID for your partition, edit the /etc/fstab file as follows. Be sure to substitute xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with the UUID of your partition:

# mount /dev/sdc5 /home/dandy/mnt/additionaldrive
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx   /home/dandy/mnt/additionaldrive  nfs defaults 0 0

If you notice, the options I used are simply defaults. This will allow rw access along with a couple other settings. For more information about the options and editing /etc/fstab, see the documentation here. Adjust as necessary for your situation.

If you don't want to manually type out the UUID while editing /etc/fstab, you can use the following commands to append the UUID to /etc/fstab. After that, edit /etc/fstab as needed.

Switch to root:

sudo bash

Make backup:

cp /etc/fstab /etc/fstab.bak

Append UUID to /etc/fstab:

ls -l /dev/disk/by-uuid | grep sdc | awk '{print $9}' >> /etc/fstab

Plex Library Ownership/Permissions

Next, you need to make sure that this folder and its contents have the proper ownership/permissions for Plex to be able to read and write to. Plex Media Server runs as user plex. Therefore the media and directories need to allow read and write access to user plex. This is done with the following command:

sudo chown -R plex:plex /home/dandy/mnt/additionaldrive

For more information, a good tutorial for Plex is here, and the official documentation is here.

Side Note

I don't recommend creating your Plex library directory within your home directory. Instead, mount it somewhere like /mnt/addionaldrive.

Also, you might want to consider using a group other than plex for your library. On my system, the directory and file ownership for my Plex Media Server library uses plex as the user but a different group, boden. This allows me more flexibility. Plex still needs to own the files, but I also want to have the directory accessible as a network drive via SMB. In order to do this, I defined a new group called boden that user plex and any other specific users are added to. Then within my Samba config file, I set it up for users to access this share point via the network. Additionally, if a file is written to the directory, it automatically defines ownership of plex:boden. This is handy when adding media to the library. But this is another topic you can explore on your own.

Dan Daley avatar
tw flag
Thank you so much for responding, that helped! Have a fantastic day.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.