Server won't show external hard drive when selecting folder for library

Image Version#: 1.19.3.2764-ef515a800 (latest)

I want to run my own plex server on my Ubuntu machine inside a docker container. The media (movies) are on my external exfat hard drive that is usb connected to the server.

First I pulled the official image from docker hub, then I followed the guide on the docker hub page. I created volume directories for the config- and transcode files inside /var/lib/plex on the host machine. Then I started the container with the following command:

sudo docker run \
> -d \
> --name plex \
> --network=host \
> -e TZ="Europe/Paris" \
> -e PLEX_CLAIM="claim-6XRtSSkkCQ4WWyGGrSSH" \
> -v /var/lib/plex/config:/config \
> -v /var/lib/plex/transcode:/transcode \
> -v /media/wd_external:/data \
> plexinc/pms-docker

I then opened 198.51.100.0:32400/web on my client in the same network and got greeted by the familiar Plex interface. There were no libraries, so I opened up the settings. When setting the folder for the library, I noticed that my /media/wd_internal mount would not show up in the list.

After some research I found this step for step guide. The docker run command was edited and -v /media/wd_external:/data \ got replaced by -v /disks/wd_external:/data \ . I worked through it until Step C where you should set the permissions for the newly created /disks directory with chown -R peter:peter /disks . When using that command, I’ve got the error Operation not permitted . Then I used the command chattr -iR /disks because I’ve read the issue might be the immutable attribute set but got the error Inappropriate ioctl for device while reading flags on /disks/wd_external . To solve this error I tried to edit the /etc/fstab file and add the umask=022 option but it also did not work. Excerpt:

#Additional external drives
#Mount Western Digital 8TB at /disks/wd_external for Plex
UUID=208D-AFDA /disks/wd_external exfat defaults,auto,rw,nofail,umask=022 0 1

How can I mount the hard drive or set its permissions so that it is visible for plex?

Private information was randomized.

Before getting to the container, make sure it works outside it.
You then need make certain the PUID and PGID of the container have access.

On your advice I installed the non-docker version. The drive shows up there.

You then need make certain the PUID and PGID of the container have access.

How would I do that?

Edit:

I could solve it myself. I will explain it for other people stumbling about this issue. This guide helped me with it: Understanding PUID and PGID - LinuxServer.io

First you have to understand that you can not use chown when using a exfat-fuse.
That’s why, when you try to go through the guide I mentioned, you won’t be able to finish all steps. What you have to do is to set the permission automatically when the disk gets mounted by fstab. Also, inside the container your user e.g. “Peter” is unknown. You have to pass IDs when creating the docker so that the volume can be accessed. This is what I did:

The “< >” are placeholders for your personal values!

  1. Find out your UID and GID with this command and remember them / copy them
    id $user
  2. Edit you /etc/fstab file, edit the line where you automount you external drive:
    UUID=208D-AFDA /disks/<your-drive> defaults,auto,rw,nofail,uid=<UID>,gid=<GID> 0 1
    Edit this example where needed. You just have to append the uid/gid part at the end.
    Reboot the server after that to update the mounts.
  3. Stop and remove your docker container
  4. Edit the run command you use to start the docker; Add this after the Volumes (-v). Run it
    -e PUID=<UID> -e PGID=<GID>
  5. Enter your IP + Port to access the plex web-interface like ususal. When adding a library, the drive should show up now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.