NFS mount on LXC container

SamTzu

Active Member
I have been testing NFS mounts on LXC containers and they work mostly ok after you have modified App-Armour settings on the host. Problems arise when the LXC containers are moved or host-node restarts.
LXC container does not always seem to honor the /etc/fstab settings which results in mounts not working which results in Apache and email braking down because they are stored on NFS share somewhere else.

I'm wondering what kind of solutions you are familiar with to combat this problem?

How can I automate a "test" that checks if NFS share is mounted and if it's not then tries "mount -a" again?
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
7,628
1,441
164
I have been testing NFS mounts on LXC containers and they work mostly ok after you have modified App-Armour settings on the host. Problems arise when the LXC containers are moved or host-node restarts.
LXC container does not always seem to honor the /etc/fstab settings which results in mounts not working which results in Apache and email braking down because they are stored on NFS share somewhere else.

I'm wondering what kind of solutions you are familiar with to combat this problem?

How can I automate a "test" that checks if NFS share is mounted and if it's not then tries "mount -a" again?

you should mount NFS on the host, and bind mount it into the container (if you mount the NFS share on all hosts on the same path, you can set the "shared" flag for the bind mount in the container and migration works)
 
Jun 10, 2017
107
3
38
72
Hi. Can you please expand on your answer? Are you saying that there's a way of mounting it in the lxc-container without fstab? How do you mount from the host to the lxc container if the container is configured with lvm (by default, of course)?
 

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!