Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

NFS server inside container

140 bytes added, 10:52, 24 August 2006
grammar, formatting fixes and improvements, added link to Kernel build
Binary RPMs that are provided by OpenVZ community contain kernels compiled
without NFS server support. Thus you have to
[[Kernel build|recompile the kernel ]] with <code>CONFIG_NFSD=m</code>. After booting in this kernel you'll be able
to use NFS server on [[HN]].
In-kernel NFS server runs kernel threads to service requests of clients.
But for security reasons kernel threads are prohibited in [[VE]]s! So you won't
be able to run NFS server inside [[VE]] without patching the kernel.
== User-space NFS server ==
Advantage of user-space NFS server is that it can be ran without any support in the kernel.
Also if it crashes - there is no crash of a system: just one process crashes, not kernel!The disadvantage of user-space NFS server is its poductivityproductivity: no one can be faster then in-kernel implementation.
One well-known implementation of NFS server is "The LINUX User-Space NFS Server" by Olaf Kirch.
Some Linux distributions contain this package: Debian Sarge (<code>nfs-user-server</code>), OpenSuse OpenSUSE 10.0 (<code>nfs-server</code>).
For other distributions you can download sources (for example from Debian repository) and compile it.
There is a small trick you have to know about runing <code>mountd </code> and <code>nfsd </code> (these two daemons and <code>portmap </code> constitutea user-space server). You should run them with <code>-r </code> option:
<pre>
# portmap
If major equals 0 then daemons suppose that it is NFS and don't want to re-export it. Symptoms are
that clients will always get a "permission denied" error. Simfs (the file system on what VE is located)
is assosiated with so called unnamed device, which major equals 0. To So, to prevent daemons from checking forre-exporting - just use this <code>-r </code> option.
"The “The LINUX User-Space NFS Server" Server” by Olaf Kirch implements NFSv2. It means that only files with sizes lessthan 2GB are proceededprocessed. If you intend to use such big files then you should use other another user-space NFS serverimplementation: unfs3 ([http://unfs3.sourceforge.net/)unfs3]. It implemets implements v3 of NFS protocol standartstandard.
[[Category: HOWTO]]
[[Category: Networking]]