Mounting NFS Shares from within OpenVZ Containers
Some of Debian’s kernels with OpenVZ patches do not support NFS mounts within containers. Thankfully, some do. Its supposed to work with 2.6.26-1, but it doesn’t. It does, however, work with a newer kernel, as well with the older Etch kernel!
When I try to mount the NFS file systems:
pro-101-gl:/var/www/virtual# mount -a mount.nfs: No such device
My VZ (previous) setup:
- Linux pro-100-gl.savonix.com 2.6.26-1-openvz-686 #1 SMP Mon Dec 15 20:27:00 UTC 2008 i686 GNU/Linux
- kernel.ve_allow_kthreads = 1
- modprobe nfs
- vzctl version 3.0.22
The newer kernel which supports NFS:
Linux pro-101-gl.savonix.com 2.6.26-2-openvz-amd64 #1 SMP Sun Jun 21 06:01:29 UTC 2009 i686 GNU/Linux
With the only slightly newer kernel, all I had to do was modprobe nfs in the OpenVZ host.
# vzctl exec 101 cat /proc/filesystems ext3 ext2 nodev sysfs nodev proc nodev tmpfs nodev devpts
On a machine with the original etch kernel (2.6.18), NFS client in a container works:
$ cat /proc/filesystems ext3 ext2 nodev rpc_pipefs nodev proc nodev sysfs nodev tmpfs nodev devpts nodev nfs