NFS shared directory don't mount at boot

stef1777

Active Member
Jan 31, 2010
178
8
38
Sorry if this question have already asked but I've not found the solution.

I've a LXC container with Debian Wheezy (converted from OpenVZ).

The NFS shared directory don't want to mount at container startup.

I've added to /etc/apparmor.d/lxc/lxc-default-cgns:

mount fstype=nfs,
mount fstype=rpc_pipefs,

I've added to /etc/apparmor.d/lxc/lxc-default-with-mounting:

mount fstype=nfs,

I can use mount -t nfs ... now in the container.

I added to /etc/fstab, the mount point.

xx.xx.xx.xx:/data /home/data nfs defaults 0 0

But when I restart the container, the NFS volume don't mount at boot automatically.

Do I have forgotten something?
 
Before trying to mount it at boot, check if you can see the mount and attempt to mount it manually using:

Code:
showmount -e 10.10.10.10
mount 10.10.10.10:/path/to/folder /mnt/nfs

Personally, I have not been able to get NFS working without adding "lxc.aa_profile: unconfined" to the container configuration at "/etc/pve/lxc/{VMID}.conf".
 
Hello!

showmount -e and manual "mount 10.10.10.10:/data /home/data" works fine in the container.

A mount using "mount /home/data" from fstab works fine too.

Only the mount at start using /etc/fstab do not work.
 
Seems to be a "bug" in Debian Wheezy.

I upgraded the CT to Jessie and now the mount at start works.

Looking to find where but may be in /etc/network/if-up.d/mountnfs
 
I replaced in the Wheezy CT /etc/network/if-up.d/mountnfs with the version used in Debian Jessie.

NO change.

If someone have an idea where to look as no message in log at all.
 
If someone have the problem, I solved this adding:

ASYNCMOUNTNFS=no in /etc/default/rcS

Now NFS shared mount at boot!
 

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!