Difference between revisions of "NFS"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
m (spelling/punctuation in Prepare the VE)
(Prepare the VE)
Line 14: Line 14:
 
To allow a VE use NFS filesystem, you will need to start it with "nfs" feature enabled.
 
To allow a VE use NFS filesystem, you will need to start it with "nfs" feature enabled.
 
<pre>
 
<pre>
# vzctl set 100 --features "nfs:on" --save
+
# vzctl set 101 --features "nfs:on" --save
 
# vzctl start 101
 
# vzctl start 101
 
</pre>
 
</pre>

Revision as of 05:16, 24 November 2006

This page describes how to mount NFS partition inside VE.

NFS server

Currently OpenVZ kernel doesn't include kernel NFS server support. Howether you are still able to use user space NFS server inside VE.

NFS client

Preparations

Software

You will need the following software:

  1. kernel version 028test006 or higher
  2. vzctl version 3.0.13 or higher

Prepare the VE

To allow a VE use NFS filesystem, you will need to start it with "nfs" feature enabled.

# vzctl set 101 --features "nfs:on" --save
# vzctl start 101

After this you may see nfs in /proc/filesystems

# vzctl exec 101 cat /proc/filesystems
        ext3
        ext2
nodev   rpc_pipefs
nodev   proc
nodev   nfs
nodev   sysfs
nodev   tmpfs
nodev   devpts

Mounting NFS

Assuming that you already have NFS server set up at 192.168.0.1:/nfs_pub mounting will be simple

# vzctl enter 100
# mkdir /nfs
# mount -t nfs 192.168.0.1:/nfs_pub /nfs
# cat /proc/mounts 
simfs / simfs rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
nfs /nfs nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.0.1 0 0

For more details on how to setup NFS mount see NFS-client HOWTO