Mount NFS in LXC

RobertusIT

Member
Jul 13, 2021
68
0
11
39
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:
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.