[SOLVED] Data > Container from ext HDD [PLEX] [Proxmox]

Obednal1

New Member
Feb 14, 2023
21
3
3
Hi all, very new to Proxmox, home servers etc, so please accept my apologies upfront for any frustration I may cause
I promise I've tried 'googling' everything first for a solid few hours.

In Short:
I've set up a home server on a thin client with external HDD, Set up Proxmox to run on the internal SSD. I've set up two vm's for HAOS and TrueNas, they're working fine.
Containers is where I'm struggling. I've managed to Install Plex for my home media server, however, I'm struggling to move my owned movies/shows/music onto my Plex server and I'm wondering If I've set things up wrong from the start.

Setup:
  • Dell Wyse 5060
  • 4 Core AMD CPU and iGPU
  • 12GB Memory
  • 120GB SSD
  • 4TB external USD HDD
  • Proxmox 7.3-3 installed on SSD Local
  • ISO's & CT Templates uploaded onto SSD Local
  • HDD Partitioned into:
    • 100GB Partition for Backups
    • 660GB Partition for VM's & CT's
    • 3.24TB Partition for TrueNas network storage and Plex media directories
1676383067204.png
1676383085928.png
1676383142454.png
1676383219442.png
1676383268091.png

I've managed to use WinSCP to move files from my desktop client to Proxmox host in /media/, but I believe this sits on the SSD. I can't find a way to move files onto the HDD under the 3.24TB partition, and then get those files to show up in Plex

What I have tried:
  • transferring files from client to /media/ then mounting to container /mnt/TBHDD/
    Code:
    # Plex container > Resources > Add
    # Storage: NetworkStorage
    # Size: 1000GB
    # Path: /mnt/TBHDD
    # Mount Point: 0
    
    # Plex console
    mkdir /mnt/TBHDD/MOVIES
    mkdir /mnt/TBHDD/SHOWS
    # Boots fine at this point
    
    # HOST Shell
    pct set 106 -mp1 mp=/media/movies,/mnt/TBHDD/MOVIES
    pct set 106 -mp2 mp=/media/shows,/mnt/TBHDD/SHOWS
    # Fails to boot after this
  • SSH via WinSCP to Plex root
    nano /etc/ssh/sshd_config then enabled SSH and restarted the service
    passwd root changed password to something I'm certain I know
    When I use WinSCP it just tells me the username/password is incorrect
I haven't tried any physical intervention yet, i.e. plugging in a USB stick, though would Ideally like to be able to transfer files over my local network to my Plex server
Thank you kindly for your time and support with this, greatly appreciated! Hopefully one day I will be smart enough to pass on the favor to someone else.
 
Last edited:
Enabled Root ssh but no luck
ahh it was privileged, I'm just reinstalling the container with unprivileged and will see if that works

Thanks Matthias!
 
Getting the same error
Code:
run_buffer: 321 Script exited with status 2
lxc_init: 847 Failed to run lxc.hook.pre-start for container "106"
__lxc_start: 2008 Failed to initialize container "106"
TASK ERROR: startup for container '106' failed
 
Update:
I've been able to SSH into Plex now, so can transfer files that way, although it's very slow
Still very much interested in learning how I can get files stored on the HDD to show on Plex
 
Getting the same error
Code:
run_buffer: 321 Script exited with status 2
lxc_init: 847 Failed to run lxc.hook.pre-start for container "106"
__lxc_start: 2008 Failed to initialize container "106"
TASK ERROR: startup for container '106' failed
You didn't mention this error before. If the pre-hook skript failed, maybe there's an issue with that?
Please share the output of qm config 106 (censor any information information you deem sensitive)


Enabled Root ssh but no luck
ahh it was privileged, I'm just reinstalling the container with unprivileged and will see if that works
Do you have network connection in the container? Can you ping the container from host?
 
  • Like
Reactions: Obednal1
Apologies I hadn't shared that previously, I didn't know it was there to share until I was playing around and stumbled upon it

Is pre-hook a proxmox or Plex related issue do you know?
Not sure where to download that, here's a screenshot from when I enter that into shell
1676482396110.png
 
The container is running Plex, I have Plex connected to the internet
I can also SSH and FTP into Plex now, thanks!
 
here's a screenshot from when I enter that into shell
1676482396110.png

Has to be: pct config 106 in that case (LXC).
 
Update for anyone who finds this thread in the future:

Setting up the Plex Server
I deleted and recreated my Plex container using bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/plex-v5.sh)"
I went through the advanced settings so that I could do the following
  1. Make the container Privileged
    (I've only done this on the basis my container will remain on the local network only. I've learned that a privileged container is an unsecured container and exposes lots of security risks.)
  2. Set a static IP
    (make sure to add your network mask at the end, e.g. "192.168.1.50/24")
  3. Enabled SSH with root user
    (Again, I've only done this as it's a local network and I am the only user. I understand that if there were to be multiple users or exposed to the web it would be safer to create a user and give them set permissions for SSH)
Once the container was created, the first thing I did on the container was run apt upgrade and then apt-get update to ensure all packages and software is up to date

I then created two directories, one for my using a partition on my NAS (connected to the host) media mkdir /mnt/media/ and one for mounting a device to (such as anything connected to the host e.g. USB) mkdir /mnt/USB1/

Following this, I needed to mount my NAS storage to the plex directory I just made for media. There are multiple ways to do it, but for me, I did this on the Proxmox GUI. Go to Plex (container) > Resources > Add > Mount Point, and input your storage location (for me this was the NAS I have mounted to the Proxmox host), input the amount of storage you want to allocate to the container in GB, and enter the path we just created on the guest /mnt/media/.

Just to keep my media organized I created two sub-directories for Movies mkdir /mnt/media/Movies/ and TV Shows mkdir /mnt/media/'TV Shows'/

Now any media I want on Plex I just need to add to those directories.

Transferring Media to my Plex Server
I tried a few methods of transferring Media and I'll list them all below with my findings, you may experience it differently to me though as I'm sure your hardware and configuration will be different from mine

  1. Transfering data via SSH/FTP
    I used WinSCP on my windows pc to connect to my plex server and tried dragging and dropping files that way. This was successful however there was some bottleneck somewhere that I struggled to identify limiting me to around 6MB/s which when trying to transfer over 200GB of media was taking several days to complete. Therefore, I'd consider this method a success, however, wasn't the final option I went for.
  2. Transfering data via CIFS/SMB
    This was a method using my existing NAS storage with TrueNAS, trying to connect the Plex Server to network storage via the host because plex can't (to my knowledge) connect to a Network Storage Share on its own. I thought this could be a great alternative to SSH/FTP as I was experiencing much faster speeds when transferring data between my different computers and laptops. I did this using following this guide. Unfortunately, I was still experiencing speed limitations.
  3. Transfering via USB HDD
    I decided, in the end, a direct connection once in a while will be the fastest option for getting data from my pc to my Plex Server. With an unprivileged container, you will need to endure the UID's match-up to be able to allow the USB drive to be connected to the server to then move your files over (this seemed quite complex and overwhelming for me). Instead, as mentioned, I made a privileged container for my plex server, meaning this security requirement isn't a requirement any longer. After connecting the USB to the host, check it shows up in 'disks' on the GUI or check fstab from the CLI, and make a note of the partition mount point, for me it was /dev/sdc1.

    On the host console, I used the PCT tool to mount the USB device to the container folder "USB1" I made earlier using this command pct set 107 -mp1 /dev/sdc1,mp=/mnt/USB1, I quite like the PCT tool, check out the documentation here for all that you can do with it.
    On the Plex console, to move my files over from the USB drive to the media folder, I used to CP (copy) command. I opted for this instead of the MV (move) command in case something went wrong, I would at least still have all my files on the USB still. The command I used was CP /mnt/USB1/Movies/* /mnt/media/Movies/ and CP /mnt/USB1/'TV Shows'/* /mnt/media/'TV Shows'/. This comparatively only took a couple of hours to transfer all the media instead of a few days!
One thing to note, before scanning your library's on the Plex app to find all the files you just transferred, Make sure permissions are set correctly to ensure Plex can read and access the files and folders. I did this on the Plex console using chmod -R 777 /mnt/media/, giving root access to all files in the media directory and sub-directories. Then rescan and look at all the lovely things you've just added to your server!

From someone who's never used a Linux console terminal prior to 3 days ago, it seemed overwhelming and daunting at first, but really quickly got the hang of it and it's much more logical than I first thought, things do make sense. I'm very grateful for the resources online, and to all the users above who helped me out and get started!
 
What about hard drives that already have media on them? I have 3 8TB hard-drives connected to my PC (used to be a win10 now proxmox). How do I add these drives to my Plex container without losing my content?
 
Mount them on the PVE host using the CLI (editing fstab, autofs, systemd or whatever you like to automount them).
Then bind-mount them into the LXC.

In case you formated them with NTFS you would need to install packages (ntfs-3g) for NTFS support first.
 
Last edited:
Mount them on the PVE host using the CLI (editing fstab, autofs, systemd or whatever you like to automount them).
Then bind-mount them into the LXC.

In case you formated them with NTFS you would need to install packages (ntfs-3g) for NTFS support first.
OK all this is giberish to me lol, will need to look into this CLI thing and yes they are all NTFS formated.
 

Attachments

  • 1692715882046.png
    1692715882046.png
    20.4 KB · Views: 8
  • Like
Reactions: ThaNerd

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!