Automount After Reboot; Proxmox /etc/fstab For Plex

Aup808

New Member
Feb 15, 2024
6
0
1
Hey everyone!

I currently have a setup with my Proxmox where I have set up a Plex LXC and it has been able to pull media files on my Synology (via NFS). Following a few guides online, I did this via mounting my Synology volume (named "Swan") within the shell of my Proxmox (i.e. going to "cd /etc/pve/lxc", typed in "ls" to see all the conf files across my nodes, and then "nano 102.conf" (into my Plex node), and went ahead and added: mp0: /mnt/pve/Swan, mp=/mnt/plex), and then within my Plex LXC, modifying the /etc/fstab as follows:

192.168.1.63:/volume1/Media /mnt/media nfs defaults 0 0

My Plex has been working great; however, every time my Plex restarts (or Chrome restarts), I need to manually go into my Plex LXC and type in "mount -a" to remount everything (and it works again). I looked online and tried adding "auto" (to make it auto-mount), "_netdev" (to make it wait for network connection), and "user" to the options, but still nothing works:

192.168.1.63:/volume1/Media /mnt/media nfs auto,_netdev,user 0 0

Am I doing something wrong within the <options> for my /etc/fstab, or is there perhaps something else I am missing? Any help would be greatly appreciated on this; thanks!
 
Hey,

so, you basically have two options


1. mount NFS on host, bind mount into LXC
Here the NFS share is mounted on the PVE host, so like you'd setup other storages through the UI. Then configure the bind mount[1] from wherever this NFS is mounted on the PVE host into the LXC container with
Code:
mp0: /mnt/pve/<MOUNT_POINT>,mp=/mnt/plex
This is it, for the container this is a normal directory, it doesn't know anything about NFS.


2. mount NFS directly in LXC
This doesn't really work for unprivileged containers, so make sure it is a privileged[2] one. Here you just add something like
Code:
192.168.1.63:/volume1/Media /mnt/media nfs defaults 0 0
to the /etc/fstab in your container.


[1] https://pve.proxmox.com/wiki/Linux_Container#_privileged_containers
[2] https://pve.proxmox.com/wiki/Linux_Container#_unprivileged_containers
 
Hey Hannes - thanks for the reply!

I do have a privileged container, but I guess my confusion is I have done both options; when I originally configured my LXC, I did only option #2 (with essentially the identical /etc/fstab code you mentioned) and it wasn't working, and I was told I had to mount the NFS on the host first (which was option #1), so I have done that as well. With both of them, it works, but just on reboot it doesn't automatically mount without me going to "mount -a" in my Plex node (and then it works perfectly). So I am trying to think if there is something in the fstab I need to add, either to add certain line items to help ensure it can mount when network is up and running and the node is up (cause I have read online that it may be trying to mount before everything boots up, which is why it doesn't do it automatically; but I thought the "auto" and "_netdev" might fix that, but it did not).

Any other help would be appreciated! :)
 
Do you still have both configured? You really don't want a bind mount and a NFS share mount pointing to the same directory.
_netdev[1] should be enough, it'll tell systemd you wait for network before mounting it. Could add _netdev, reboot and check the journal, does it mention anything about the NFS mount? Could you also post it here, you can use
Code:
journalctl -b | gzip > $(hostname)_syslog.txt.gz
for that.


[1] man mount
 
Here is the logs!

May 28 02:30:44 plex systemd-journald[48]: Journal started
May 28 02:30:44 plex systemd-journald[48]: Runtime Journal (/run/log/journal/cf89b66b9d1a43d091142cf08acfa54c) is 8.0M, max 315.2M, 307.2M free.
May 28 02:30:44 plex keyboard-setup.sh[53]: Couldn't get a file descriptor referring to the console.
May 28 02:30:44 plex keyboard-setup.sh[55]: Couldn't get a file descriptor referring to the console.
May 28 02:30:44 plex keyboard-setup.sh[57]: Couldn't get a file descriptor referring to the console
May 28 02:30:44 plex systemd[1]: Finished Remount Root and Kernel File Systems.
May 28 02:30:44 plex systemd[1]: Starting Flush Journal to Persistent Storage...
May 28 02:30:44 plex systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Load/Save Random Seed being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in First Boot Complete being skipped.
May 28 02:30:44 plex systemd[1]: Starting Create System Users...
May 28 02:30:44 plex systemd[1]: Finished Generate network units from Kernel command line.
May 28 02:30:44 plex systemd-journald[48]: Time spent on flushing to /var/log/journal/cf89b66b9d1a43d091142cf08acfa54c is 29.237ms for 12 entries.
May 28 02:30:44 plex systemd-journald[48]: System Journal (/var/log/journal/cf89b66b9d1a43d091142cf08acfa54c) is 136.0M, max 1.5G, 1.4G free.
May 28 02:30:44 plex keyboard-setup.sh[60]: setupcon: We are not on the console, the console is left unconfigured.
May 28 02:30:44 plex systemd[1]: Finished Apply Kernel Variables.
May 28 02:30:44 plex systemd[1]: Finished Create System Users.
May 28 02:30:44 plex systemd[1]: Starting Create Static Device Nodes in /dev...
May 28 02:30:44 plex apparmor.systemd[81]: Restarting AppArmor
May 28 02:30:44 plex apparmor.systemd[81]: Reloading AppArmor profiles
May 28 02:30:44 plex systemd[1]: Finished Set the console keyboard layout.
May 28 02:30:44 plex apparmor.systemd[98]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
May 28 02:30:44 plex systemd[1]: Finished nftables.
May 28 02:30:44 plex systemd[1]: Finished Create Static Device Nodes in /dev.
May 28 02:30:44 plex systemd[1]: Reached target Preparation for Local File Systems.
May 28 02:30:44 plex systemd[1]: Reached target Local File Systems.
May 28 02:30:44 plex systemd[1]: Starting Load AppArmor profiles...
May 28 02:30:44 plex systemd[1]: Starting Set console font and keymap...
May 28 02:30:44 plex systemd[1]: Condition check resulted in RPC security service for NFS server being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Store a System Token in an EFI Variable being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Commit a transient machine-id on disk being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Merge System Extension Images into /usr/ and /opt/ being skipped.
May 28 02:30:44 plex systemd[1]: Condition check resulted in Rule-based Manager for Device Events and Files being skipped.
May 28 02:30:44 plex systemd[1]: Starting Uncomplicated firewall...
May 28 02:30:44 plex systemd[1]: Finished Set console font and keymap.
May 28 02:30:44 plex systemd[1]: Finished Uncomplicated firewall.
May 28 02:30:44 plex systemd[1]: Reached target Preparation for Network.
May 28 02:30:44 plex systemd[1]: Starting Network Configuration...
May 28 02:30:44 plex systemd[1]: Finished Flush Journal to Persistent Storage.
May 28 02:30:44 plex systemd[1]: Starting Create Volatile Files and Directories...
May 28 02:30:44 plex systemd[1]: Finished Load AppArmor profiles.
May 28 02:30:44 plex systemd[1]: Finished Create Volatile Files and Directories.
May 28 02:30:44 plex systemd[1]: Mounting RPC Pipe File System...
May 28 02:30:44 plex systemd[1]: Starting RPC bind portmap service...
May 28 02:30:44 plex systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
May 28 02:30:44 plex systemd[1]: Reached target System Time Set.
May 28 02:30:44 plex systemd-networkd[88]: lo: Link UP
May 28 02:30:44 plex systemd-networkd[88]: lo: Gained carrier
May 28 02:30:44 plex systemd-networkd[88]: Enumeration completed
May 28 02:30:44 plex systemd[1]: Starting Record System Boot/Shutdown in UTMP...
May 28 02:30:44 plex systemd-networkd[88]: eth0: Link UP
May 28 02:30:44 plex systemd[1]: Started Network Configuration.
May 28 02:30:44 plex systemd[1]: Mounted RPC Pipe File System.
May 28 02:30:44 plex systemd[1]: Reached target rpc_pipefs.target.
May 28 02:30:44 plex systemd[1]: Condition check resulted in RPC security service for NFS client and server being skipped.
May 28 02:30:44 plex systemd[1]: Reached target NFS client services.

Looking at this, I guess the item on "Condition check results in RPC security service for NFS client and server being skipped" - is that saying that there was an initial issue with mounting on startup, so rather than trying again, it skips, and that's why I am doing the manual "mount -a"? I am not sure why it would, cause if it works with "mount -a" just fine, I am confused on what security item it's running into when my Synology and Proxmox have access to one another (and Proxmox/Plex LXC is open to read/write the shared Synology folder). Do you have any ideas?
 

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!