<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Strimo</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Strimo"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Strimo"/>
	<updated>2026-04-11T01:59:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Strimo&amp;diff=7079</id>
		<title>User:Strimo</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Strimo&amp;diff=7079"/>
		<updated>2009-02-16T17:48:34Z</updated>

		<summary type="html">&lt;p&gt;Strimo: New page: Updated Articles:  * NFS server inside container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Updated Articles:&lt;br /&gt;
&lt;br /&gt;
* [[NFS server inside container]]&lt;/div&gt;</summary>
		<author><name>Strimo</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=7078</id>
		<title>NFS server inside container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=NFS_server_inside_container&amp;diff=7078"/>
		<updated>2009-02-16T17:47:42Z</updated>

		<summary type="html">&lt;p&gt;Strimo: /* User-space NFS server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are two ways to setup NFS server on common [[HN]]:&lt;br /&gt;
use a user-space NFS server daemon or use an in-kernel implementation&lt;br /&gt;
of NFS server. Some peculiarities appear if you intend to run NFS server&lt;br /&gt;
in [[container]].&lt;br /&gt;
&lt;br /&gt;
{{Note|for information about NFS client inside container, see [[NFS]].}}&lt;br /&gt;
&lt;br /&gt;
== Kernel NFS server ==&lt;br /&gt;
Binary RPMs that are provided by OpenVZ community contain kernels compiled&lt;br /&gt;
without NFS server support. Thus you have to&lt;br /&gt;
[[Kernel build|recompile the kernel]] with &amp;lt;code&amp;gt;CONFIG_NFSD=m&amp;lt;/code&amp;gt;. After booting in this kernel you'll be able&lt;br /&gt;
to use NFS server on [[HN]].&lt;br /&gt;
In-kernel NFS server runs kernel threads to service requests of clients.&lt;br /&gt;
But for security reasons kernel threads are prohibited in [[container]]s! So you won't&lt;br /&gt;
be able to run NFS server inside [[container]] without patching the kernel.&lt;br /&gt;
&lt;br /&gt;
== User-space NFS server ==&lt;br /&gt;
Advantage of user-space NFS server is that it does not require kernel support.&lt;br /&gt;
Also if it crashes — there is no crash of the system: just one process dies, not the kernel!&lt;br /&gt;
The disadvantage of user-space NFS server is its productivity: no one can be faster than in-kernel implementation.&lt;br /&gt;
&lt;br /&gt;
One well-known implementation of NFS server is &amp;quot;The LINUX User-Space NFS Server&amp;quot; by Olaf Kirch.&lt;br /&gt;
Some Linux distributions contain this package: Debian Sarge (&amp;lt;code&amp;gt;nfs-user-server&amp;lt;/code&amp;gt;), OpenSUSE 10.0 (&amp;lt;code&amp;gt;nfs-server&amp;lt;/code&amp;gt;).&lt;br /&gt;
For other distributions you can download sources (for example from Debian repository) and compile it.&lt;br /&gt;
There is a small trick you have to know about running &amp;lt;code&amp;gt;mountd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nfsd&amp;lt;/code&amp;gt; (these two daemons and &amp;lt;code&amp;gt;portmap&amp;lt;/code&amp;gt; constitute a user-space server).  You should run them with the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# portmap&lt;br /&gt;
# rpc.mountd -r&lt;br /&gt;
# rpc.nfsd -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The reason is that these daemons check the major number of the device where the directory to export resides.&lt;br /&gt;
If major equals 0 then daemons assume that it is NFS and don't want to re-export it. Symptoms are&lt;br /&gt;
that clients will always get a &amp;quot;permission denied&amp;quot; error. Simfs (the file system on which container is located)&lt;br /&gt;
is associated with so called unnamed device, in which major equals 0. So, to prevent daemons from checking for&lt;br /&gt;
re-exporting — just use this &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
“The LINUX User-Space NFS Server” by Olaf Kirch implements NFSv2. It means that only files with sizes less&lt;br /&gt;
than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server&lt;br /&gt;
implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard.&lt;br /&gt;
&lt;br /&gt;
Please note that the user-space NFS server does not provide locking, or at least I couldn't get locking to work - [[User:Elronxenu|Elronxenu]] 19:49, 15 November 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
=== On Debian Lenny ===&lt;br /&gt;
&lt;br /&gt;
The current stable debian version 5.0 (lenny) provides two packages for user space nfs support: &amp;lt;code&amp;gt;nfs-user-server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;unfs3&amp;lt;/code&amp;gt;. Here i describe my experiences with them --[[User:Strimo|Strimo]] 17:47, 16 February 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
==== nfs-user-server ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aptitude install nfs-user-server&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First i used nfs-user-server package since i didn't know unfs3. After installing i always got the '''permission denied''' error when i tried to mount any exported path until i found this article. So i patched the /etc/init.d/nfs-user-server file to include the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; parameter by adding &amp;lt;code&amp;gt;-- -r&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;start-stop-daemon&amp;lt;/code&amp;gt; line responsible for starting &amp;lt;code&amp;gt;rpc.mountd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rpc.nfsd&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/rpc.nfsd -- -r&lt;br /&gt;
        start-stop-daemon --start --oknodo --quiet --exec /usr/sbin/rpc.mountd -- -r&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the modification and a nfs server restart (&amp;lt;code&amp;gt;/etc/init.d/nfs-user-server restart&amp;lt;/code&amp;gt;) i was able to mount a nfs share. At first the nfs server seems to work fine but anytime i want to edit any text file (using nano or mcedit) i got strange errors on writing to the file and i never solved the problem nor detected why this happens. So i switched to unfs3 ...&lt;br /&gt;
&lt;br /&gt;
==== unfs3 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aptitude install unfs3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works fine until now. Note that both unfs3 and nfs-user-server do not support file locking!&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://nfs.sourceforge.net/ Linux NFS Overview, FAQ and HOWTO Documents]&lt;br /&gt;
* [http://www.tldp.org/LDP/nag/nag.html The Network Administrators' Guide by Olaf Kirch]&lt;br /&gt;
* [http://unfs3.sourceforge.net/ unfs3 homepage]&lt;br /&gt;
* [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server  source package]&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Networking]]&lt;/div&gt;</summary>
		<author><name>Strimo</name></author>
		
	</entry>
</feed>