Editing NFS server inside container
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: | ||
There are two ways to setup NFS server on common [[HN]]: | There are two ways to setup NFS server on common [[HN]]: | ||
use a user-space NFS server daemon or use an in-kernel implementation | use a user-space NFS server daemon or use an in-kernel implementation | ||
− | of NFS server. | + | of NFS server. Some peculiarities appear if you intend to run NFS server |
− | + | in [[VE]]. | |
− | |||
== Kernel NFS server == | == Kernel NFS server == | ||
− | + | 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 == | == User-space NFS server == | ||
− | Advantage of user-space NFS server is that it | + | 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 | + | 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 productivity: no one can be faster | + | The disadvantage of user-space NFS server is its productivity: 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. | 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 10.0 (<code>nfs-server</code>). | Some Linux distributions contain this package: Debian Sarge (<code>nfs-user-server</code>), OpenSUSE 10.0 (<code>nfs-server</code>). | ||
For other distributions you can download sources (for example from Debian repository) and compile it. | 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 | + | 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> constitute a user-space server). You should run them with <code>-r</code> option: |
<pre> | <pre> | ||
# portmap | # portmap | ||
Line 90: | Line 27: | ||
# rpc.nfsd -r | # rpc.nfsd -r | ||
</pre> | </pre> | ||
− | The reason is that these daemons check | + | The reason is that these daemons check major number of device where the directory to export resides. |
− | If major equals 0 then daemons | + | 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 | + | that clients will always get a "permission denied" error. Simfs (the file system on what VE is located) |
− | is | + | is assosiated with so called unnamed device, which major equals 0. So, to prevent daemons from checking for |
re-exporting — just use this <code>-r</code> option. | re-exporting — just use this <code>-r</code> option. | ||
Line 99: | Line 36: | ||
than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server | than 2GB are processed. If you intend to use such big files then you should use another user-space NFS server | ||
implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard. | implementation: [http://unfs3.sourceforge.net/ unfs3]. It implements v3 of NFS protocol standard. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== External links == | == External links == | ||
Line 146: | Line 42: | ||
* [http://unfs3.sourceforge.net/ unfs3 homepage] | * [http://unfs3.sourceforge.net/ unfs3 homepage] | ||
* [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server source package] | * [http://packages.qa.debian.org/n/nfs-user-server.html Overview of nfs-user-server source package] | ||
+ | |||
+ | [[Category: Technology]] | ||
+ | [[Category: Concepts]] | ||
+ | |||
+ | |||
+ | |||
[[Category: HOWTO]] | [[Category: HOWTO]] | ||
[[Category: Networking]] | [[Category: Networking]] |