Announcement

Collapse
No announcement yet.

External Hard Drive use with Plex

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    External Hard Drive use with Plex

    I previously used Plex on a prior install of Kubuntu with all my movie, TV, sports, and other video files on that Seagate exernal drive. Everything is neatly categorized in folders on that external drive, but Plex was having a problem letting me tell it to use that external hard drive in Plex, and I really didn't want to bloat up my internal hard drive with all that stuff. So I ran a bunch of commands and made a directory on the main drive that I pointed over to the external hard drive.

    My Seagate external drive is:
    Code:
    /dev/sdb2
    And it's UUID is:
    Code:
    UUID=BA96D5AD96D56A81
    My Kubuntu home directory is:
    Code:
    /home/tom
    Here's what I did in the konsole:

    Code:
    sudo umount /dev/sdb2
    sudo gpasswd -a plex plugdev
    sudo gpasswd -a plex root
    sudo gpasswd -a plex sudo
    sudo gpasswd -a tom
    sudo gpasswd -a tom plex
    
    mkdir TomsPlexMedia
    sudo gedit /etc/fstab
    Then I edited the fstab file as follows:

    Code:
    # Plex TomsPlexMedia USB External Mount
    UUID=BA96D5AD96D56A81 [hit tab here] /home/tom/TomsPlexMedia [hit tab again] ntfs [tab again] 0 [tab again] 0
    So I got it working! There are just a few problems. First, I can no longer simply go into that external hard drive with Dolphin and just delete stuff I've already watched and copy over things I plan to watch. Turns out that hard drive that I bought thinks I don't own it. I tried running the chmode 777 command from the console without any luck. Do I need to run some kind of take file permissions command within the fstab file, something like this?:

    Code:
    sudo chmod 777 /dev/sdb2
    Would that work or do I need to do it in some way specify that it's the user “tom” who gets all the permissions?

    Plex is also being annoying. I've got it pointed at my TomsPlexMedia to find all my shows, movies, training vids, etc., but when I make a Plex category like “Movies,” it doesn't let me select a sub folder under TomsPlexMedia. I could ONLY pick TomsPlexMedia or a folder on the internal hard drive. So it dumped all movies, TV shows, sports shows, and work videos into the category “Movies” and then it didn't put anything into “TV Shows” even though I have a lot of those. Then in “Other videos” it dumped all movies, TV shows, work videos, etc. Into “other videos.” It runs, but it's one big mess.

    Do I need to make a bunch of folders to point over to the exact sub-folder on the external drive, named things like this?:
    Code:
    TomsPlexMovies
    TomsPlexTV
    TomsPlexOther
    Then will it work in the fstab file to do what I did before except multiple times? For example:
    Code:
    UUID=BA96D5AD96D56A81 [hit tab here] /home/tom/TomsPlexMovies [hit tab again] ntfs [tab again] 0 [tab again] 0
    UUID=BA96D5AD96D56A81 [hit tab here] /home/tom/TomsPlexTV [hit tab again] ntfs [tab again] 0 [tab again] 0
    UUID=BA96D5AD96D56A81 [hit tab here] /home/tom/TomsPlexOther [hit tab again] ntfs [tab again] 0 [tab again] 0
    Would that work or can I only use that UUID once? Or is there some other way I need to tell Plex, “movies are only in this folder and folders under it”, “TV shows are in this folder and folders under it” and so on?

    So, I need to:
    1. Permanently take back all file permission rights of my external drive. (Via terminal or within fstab?)
    2. Get Plex categories only directed to the folders I want.

    One more thing: I'm in Kubuntu 19.10. Last time I got caught with my pants down and suddenly Kubuntu's updating no longer worked. Do I need to soon run the upgrade command in Discover? Will it upgrade me to 20.04 or 20.10? And will one of those end up being LTS? I thought I was getting LTS last time I upgraded, but I don't think that happened.
    Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
    ================================

    #2
    This guide proved invaluable to me, and a great read for Linux users (whether they run Plex or not). It most likely has to do with a 'sticky bit'. I run Plex with all media on a 2nd "storage" drive (it sounds like that's what you're trying to do as well), and with a little fiddling via this guide all is working as intended.

    Linux Permissions Guide
    ​"Keep it between the ditches"
    K*Digest Blog
    K*Digest on Twitter

    Comment


      #3
      Not using an external drive here but permissions can be handled differently if that's the issue. Plex is on my server and I also export the same files via NFS. In my world, I created a special group I named "shared", set the group of the media folders to this group, forced the group setting on all the files using the GID stickybit, then put Plex and my user in the "shared" group. This gives Plex full access to the files without locking out my user or forcing my to use "wide-open" permissions.

      Here's my movies folder:

      drwxrwsr-x 1 nobody shared 58K Nov 15 06:52 '@Movies'/

      Notice the "s" in the group permissions? This means every file and folder placed into the Movies folder get the GID of "shared".

      Please Read Me

      Comment


        #4
        Okay, so the file permission problem I've overcome. I'm able to just grab permission with chmode before doing any deleting from or copying to that drive. No big deal. What I'm still stuck on is getting a Plex category to aim only at the right folder on the external hard drive. Right now, my TomsPlexMedia pseudo-folder isn't really a folder in /home/tom. It looks like the folder /home/tom/TomsPlexMedia, but it's actually the external Seagate hard drive. What a need is a pseudo-folder there that looks like /home/tom/TomsPlexMovies but is really /dev/sdb2/TomsMedia/Movies (where /dev/sdb2 is my external drive). Then I'll have another one that looks like /home/tom/TomsPlexTV but in actuality is /dev/sdb2/TomsMedia/Television.

        Right now I can point my Plex Movies category to the pseudo-folder /home/tom/TomsPlexMedia, but not point it to the Movies sub folder under that. So I pointed the Television category to the same pseudo-folder. Basically, I just pointed both categories to the Seagate external hard drive and not a specific sub-folder. I thought it would work itself out because Plex would be able to easily tell which video files were movies and which ones were TV shows. No such luck. It dumped all movies, TV shows into the Movies category. It's made one big mess.

        How do I make the following pseudo folders in my /home/tom that are really folders on my /dev/sdb2/ external hard drive?:

        Code:
        pseudo-folder: 
        /home/tom/TomsPlexMovies
        which is really: 
        /dev/sdb2/TomsMedia/Movies
        
        pseudo-folder: 
        /home/tom/TomsPlexTV
        which is really: 
        /dev/sdb2/TomsMedia/Television
        
        pseudo-folder: 
        /home/tom/TomsPlexSports
        which is really: 
        /dev/sdb2/TomsMedia/Sports
        
        pseudo-folder: 
        /home/tom/TomsPlexOtherVids
        which is really: 
        /dev/sdb2/TomsMedia/OtherVids
        That way in Plex I can just point Plex's Movie category to my TomsPlexMovies pseudo-folder and so on.

        I've tried editing my fstab file to do that, but I keep muffing it up. Anyone know how it's done?

        Right now my fstab file looks like this:
        Code:
        # /etc/fstab: static file system information.
        #
        # Plex TomsPlexMedia USB External Mount
        UUID=BA96D5AD96D56A81	/home/tom/TomsPlexMedia	ntfs	0	0
        # 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/sda1 during installation
        UUID=21998dd3-9ed7-4f96-9fca-4a70680d16f4 /               ext4    errors=remount-ro 0       1
        /swapfile                                 none            swap    sw              0       0
        Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
        ================================

        Comment


          #5
          Originally posted by Tom_ZeCat View Post
          Okay, so the file permission problem I've overcome. I'm able to just grab permission with chmode before doing any deleting from or copying to that drive. No big deal.
          I don't understand the above, but I'd like to offer some observations.
          • /etc/fstab is not the normal place for a removable drive mount. It get's read at system startup, and an entry referring to a device that may not be plugged in can cause problems. It can work using the noauto option, but KDE has a better facility in system settings.
          • If you do have ntfs or vfat entries in /etc/fstab, it's simplest to use the umask option to avoid permissions problems.
          • If you are manually editing /etc/fstab I recommend putting sensible labels on all your partitions, and using those labels instead of UUIDs; the fstab becomes much more readable.

          For example, here is my entry for the ESP on my boot drive:
          Code:
          #file system   mount       type    options                      dump pass
          LABEL=EFI      /boot/efi   vfat    umask=000,noatime,noauto,user  0   1
          The "umask=000" option gives permission to everyone for everything, "noauto" tells the Kubuntu not to mount the partition at startup, and "user" means I can mount it just by clicking on it.

          How do I make the following pseudo folders in my /home/tom that are really folders on my /dev/sdb2/ external hard drive?:
          Normally this done with "symbolic links", also known as "symlinks" or just "links". Is this what to mean by "pseudo-folder"?

          Anyway, I suggest you open dolphin in split screen mode, or open two dolphin windows. Have one dolphin window open on where the real folders are, and one where you want the links to be. Drag the real folder and drop it where the links are to be. Dolphin will ask Move here, Copy here, or Link here; click Link. You can then rename the link to what you want. If the drive isn't plugged in the links just don't work, but don't cause problems.

          /etc/fstab can do this with what are called bind mounts, but if symlinks can do the job it's far simpler and less problematic.
          Regards, John Little

          Comment


            #6
            Originally posted by jlittle View Post
            I don't understand the above, but I'd like to offer some observations.
            • /etc/fstab is not the normal place for a removable drive mount. It get's read at system startup, and an entry referring to a device that may not be plugged in can cause problems. It can work using the noauto option, but KDE has a better facility in system settings.
            • If you do have ntfs or vfat entries in /etc/fstab, it's simplest to use the umask option to avoid permissions problems.
            • If you are manually editing /etc/fstab I recommend putting sensible labels on all your partitions, and using those labels instead of UUIDs; the fstab becomes much more readable.

            For example, here is my entry for the ESP on my boot drive:
            Code:
            #file system   mount       type    options                      dump pass
            LABEL=EFI      /boot/efi   vfat    umask=000,noatime,noauto,user  0   1
            The "umask=000" option gives permission to everyone for everything, "noauto" tells the Kubuntu not to mount the partition at startup, and "user" means I can mount it just by clicking on it.

            Normally this done with "symbolic links", also known as "symlinks" or just "links". Is this what to mean by "pseudo-folder"?

            Anyway, I suggest you open dolphin in split screen mode, or open two dolphin windows. Have one dolphin window open on where the real folders are, and one where you want the links to be. Drag the real folder and drop it where the links are to be. Dolphin will ask Move here, Copy here, or Link here; click Link. You can then rename the link to what you want. If the drive isn't plugged in the links just don't work, but don't cause problems.

            /etc/fstab can do this with what are called bind mounts, but if symlinks can do the job it's far simpler and less problematic.
            Yes, that's what I mean by a pseudo-folder. I wasn't sure that the right terminology was. My Seagate external hard drive is always plugged in. The idea is to use it for all my multimedia needs, movies, TV shows, music, etc., with no need for any of that to clutter up my internal hard drive. If Plex would have let me simply browse over to each folder I wanted to use on the external drive, I would have done that, but it would not let me. So I found info on how to make that entire external drive a "pseudo-folder", but was having trouble making a particular folder on it one.

            I'm going to read up on both symlinks and bind mounts. I've done much more tinkering in MS-DOS than in Linux, but if this were the former, I would be looking to run commands in the autoexec.bat file. I want these links/pseudo-folders to be established whenever the PC boots up. Then Plex will always have the same folders available to it for each category. Is fstab the closest equivalent to autoexec.bat or is there something else better suited to what I'm doing? If I understand you correctly, if I use fstab, I need to use bind mounts because symlinks won't work. Would there be some way to run a symlink each time the PC boots up? The Dolphin method you describe sounds useful for some situations, but not this one. I need to establish these linked folders each time the computer starts up. It would be cumbersome to have to open Dolphin and make them each time I restart the PC.

            Or once I create a symlink, does it hang around even after the computer reboots?
            Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
            ================================

            Comment


              #7
              An update:

              I tried your suggestion of creating symlinks via simply dragging and dropping in Dolphin. I had expected those links to disappear after reboot, but they don't! So far they're hanging around. I was then able to use those symlinks in Plex per category. It worked amazingly well. Looks like I don't even really need my edit to the fstab file anymore, though I'm glad I learned about that. I didn't realize the solution was going to be so simple. Now everything in Plex is nicely organized. Now I'm going to import all my music into Plex as well. With the Plex app on my android phone, I should be able to play any music I want on devices anywhere in my place without copying all those sound files to my phone.

              This works well. Thanks for your help.
              Kubuntu 22.04 (desktop & laptop), Windows 7 &2K (via VirtualBox on desktop PC)
              ================================

              Comment

              Working...
              X