Share OSX folder through NFS to CentOS

I want to share OSX folder /private/var/www/html/localhost to CentOS to mount at /var/www/html/localhost.

OSX ip:10.211.55.2, CentOS ip:10.211.55.7

OSX NFS server settings


$ ifconfig
$ sudo nfsd start
$ sudo $ sudo vim /etc/exports


limit ip range in 10.211.55.0 access as root to mount /private/var/www/html/localhost

/private/var/www/html/localhost -maproot=root -alldirs -network 10.211.55.0 -mask 255.255.255.0


$ sudo nfsd restart
$ showmount -e
Exports list on localhost:
/private/var/www/html/localhost     10.211.55.0


CentOS NFS client settings


$ cd /var/www/html
$ mkdir localhost
$ sudo vim /etc/fstab


10.211.55.2:/private/var/www/html/localhost /var/www/html/localhost nfs


$ sudo mount -a
$ ls -l -h /var/www/html/localhost

now, you will see the /private/var/www/html/localhost file list.

Reference:
http://www.williamrobertson.net/documents/nfs-mac-linux-setup.html

留言