Editing NFS
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This page describes how to | + | This page describes how to mount NFS partition inside a container. |
− | + | == NFS server == | |
+ | Currently OpenVZ kernel doesn't include kernel NFS server support. However you are still able to use user space [[NFS server inside container]]. | ||
− | + | == NFS client == | |
− | + | === Preparations === | |
− | == Preparations == | + | ==== Prerequisites ==== |
− | === Prerequisites === | ||
You will need the following software: | You will need the following software: | ||
Line 20: | Line 20: | ||
This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running <code>sysctl -p</code>. | This can be done by adding the above lines into /etc/sysctl.conf on the hardware node, and then running <code>sysctl -p</code>. | ||
− | === | + | ===== Debian Notes ===== |
− | + | Debian Etch still uses vzctl version 3.0.11 and so NFS client support is not yet available. Lenny presently has version 3.0.18. | |
− | + | ==== Prepare the HN ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 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 | # modprobe nfs | ||
Line 40: | Line 34: | ||
modprobe nfs | modprobe nfs | ||
− | + | ==== Prepare the container ==== | |
− | |||
− | === Prepare the container === | ||
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. | 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. | ||
Line 61: | Line 53: | ||
</pre> | </pre> | ||
− | == Mounting NFS == | + | === Mounting NFS === |
− | Make sure that packages <code>nfs-utils</code> and <code>nfs-utils-lib</code> or similar are installed in a container | + | Make sure that packages <code>nfs-utils</code> and <code>nfs-utils-lib</code> or similar are installed in a container. |
Assuming that you already have NFS server set up at <code>192.168.0.1:/nfs_pub</code>, mounting will be simple | Assuming that you already have NFS server set up at <code>192.168.0.1:/nfs_pub</code>, mounting will be simple | ||
Line 79: | Line 71: | ||
For more details on how to setup NFS mount, see [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO] | For more details on how to setup NFS mount, see [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO] | ||
− | == Known issues == | + | === Known issues === |
− | + | 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]]. | |
− | * | + | |
+ | |||
+ | == ISSUE: can't install 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)'' | ||
+ | |||
+ | <pre> | ||
+ | root@clinton:/# apt-get install nfs-common | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | nfs-common is already the newest version. | ||
+ | 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. | ||
+ | 1 not fully 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 "start" failed. | ||
+ | dpkg: error processing nfs-common (--configure): | ||
+ | subprocess post-installation script returned error exit status 1 | ||
+ | Errors were encountered while processing: | ||
+ | nfs-common | ||
+ | E: Sub-process /usr/bin/dpkg returned an error code (1) | ||
+ | </pre> | ||
+ | |||
+ | This is as yet unresolved. | ||
== See also == | == See also == | ||
* [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO] | * [http://nfs.sourceforge.net/nfs-howto/ar01s04.html NFS-client HOWTO] | ||
− | |||
[[Category: HOWTO]] | [[Category: HOWTO]] |