Mount NFS in LXC

RobertusIT

Member
Jul 13, 2021
44
0
6
36
HI

I have:

1 PLEX LXC
2 Ubuntu with NFS server that share a folder to PLEX LXC

Ubuntu with NFS:
Code:
root@rclone:~# cat /etc/exports
/mnt/ROB_MASTER *(ro,sync,no_root_squash,no_subtree_check,fsid=root)

PLEX LXC:
Code:
192.168.1.50:/mnt/ROB_MASTER /mnt/ROB_MASTER nfs auto,x-systemd.automount,_netdev,nofail,noatime,nolock,tcp,actimeo=1800,bg,retry=10 0 0

PLEX LXC CONF:
Code:
arch: amd64
cores: 4
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: PLEX
memory: 4096
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=F2:DE:D0:5C:A9:72,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-102-disk-0,size=70G
startup: order=2
swap: 1024
lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.cgroup.devices.allow: c 29:0 rwm
lxc.autodev: 1
lxc.hook.autodev: /var/lib/lxc/102/mount_hook.sh

Issue:
Plex doesn't mount the folder at reboot, but:
mount -a, mount the folder.

Why doesn't mount at reboot ?
 
Last edited:

oguz

Proxmox Staff Member
Retired Staff
Nov 19, 2018
5,207
679
118
hi,

Issue:
Plex doesn't mount the folder at reboot, but:
mount -a, mount the folder.

Why doesn't mount at reboot ?
is that entry in /etc/fstab inside the container?

it could be that systemd is trying to mount your share before the network is available.

as a workaround you could try adding a cron job to your container: @reboot mount -a

otherwise i would suggest you to create a systemd unit file for the mount, or check the logs as to figure out why it doesn't get mounted in the first place.
 

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 your own in 60 seconds.

Buy now!