[SOLVED] User-space NFS server


The Issue: Cannot create NFS server on a CentOS 6 VM running under OpenVZ – I do not have access to enable it on the VZ host, neither the supplier will change the config at their end. Instead they recommended going to a XEN based host.

Error Message:

[root@backup ~]# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).
Please try, as root, ‘mount -t nfsd nfsd /proc/fs/nfsd’ and then restart rpc.nfsd to correct the problem
[FAILED]

The solution: Set up a user-space nfs server

UNFS3 is a user-space implementation of the NFSv3 server specification. It provides a unified mountd and nfsd program and so far runs under Linux, NetBSD, and Solaris. Before we begin, ensure nfs is stopped.

wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unfs3-0.9.22-2.el6.rf.x86_64.rpm

yum install unfs3-0.9.22-2.el6.rf.x86_64.rpm

chkconfig unfsd on
service unfsd start
Starting unfs3 NFS server

modify /etc/exports

/home/myfolder ip_address_of_dest_server(rw,sync,root_no_squash,no_subtree_check)

Then service unfsd restart

On the client server,

mount -t nfs -o rw server_ip:/home/myfolder /mnt

Et Voila! 🙂

Read about UNFS3

 

 

Gulshan Yashveer Beejan

Gulshan holds a BSc(Hons) Computer Science with Distributed systems from the City University of London. He is currently working at DSOGroup(Mauritius) as a Linux Administrator on SaaS Solutions. More about Gulshan

Leave a Reply

Your email address will not be published. Required fields are marked *