6,534
edits
Changes
NFS
,simplification
This page describes how to mount use '''NFS partition client''' inside a container.
You will need the following software:
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running <code>sysctl -p</code>.
For NFS mounts to work in the containers with the RHEL5-based kernels you must enable kernel threads in the container by setting <code>kernel.ve_allow_kthreads=1</code> in <code>/etc/sysctl.conf</code>.
modprobe nfs
To allow a container to use NFS filesystem, you will need to start it with "nfs" feature enabled. If the container is running while you set the <code>--features nfs:on</code>, you will need to reboot it.
</pre>
Make sure that packages <code>nfs-utils</code> and <code>nfs-utils-lib</code> or similar are installed in a container.
For more details on how to setup NFS mount, see [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO]
* There are quite a few parameters in NFS, so sometimes it doesn't work due to misconfiguration. We've created a separate
page describing such situations: [[NFS doesn't work]].
* Suspend and migrate operations fail if the VE has NFS partitions mounted [http://bugzilla.openvz.org/show_bug.cgi?id=616]. (In the bug report they say: "Fixed in 028stab072". So maybe this isn't an issue anymore?) == ISSUE: can't install Package nfs-common on ubuntu VE == Host machine is ubuntu server 8.0.4 , VE container is ubuntu from openvz template repo. Despite following all of the above directives, I am unable to get nfs-common to install on the VE (installs fine on the host machine). Here is output ''(from inside VE)'' when I try to install nfs-common <pre>root@clinton:/# apt-get install nfs-commonReading package lists... DoneBuilding dependency tree Reading state information... Donenfs-common is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 4 can not upgraded.1 not fully be installed or removed.After this operation, 0B of additional disk space will be used.Setting up nfs-common (1:1.1.2-2ubuntu2.2) ... * Starting NFS common utilities [fail] invoke-rc.d: initscript nfs-common, action "Make sure you start" failed.dpkg: error processing nfs-common (--configure): subprocess post-installation script returned error exit status 1Errors were encountered while processing: nfs-commonE: Sub-process /usr/bin</dpkg returned an error code (1)>portmap</precode> The cause of this problem is that portmap is not running. Portmap must be running before installing nfs-common. On CentOS 5 (and possible other versions) both the netfs and portmap startup scripts need trying to be running. Just run portmap: # /etc/init.d/portmap start Then, install nfs-common: # apt-get install nfs-common.
== See also ==
* [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO]
[[Category: HOWTO]]