Skip to content

Create a NFS File Share on Redhat/CentOS Server Mount on Mac OSX

by Jon on April 11th, 2011

To create an NFS share on a Redhat/CentOS server there are a number of changes that need to be made to the system. Below I have a quick demonstration on how to add 2 nfs shares to a server. The first share “nfs-share1” is a read/write share for client computers at ip address 192.168.1.100 and 101. Then the second share “nfs-share2” is a read only share for client computers at ip address 192.168.1.100 and 101. This is just a quick example of how to setup a nfs server, there is more work to do from the client side to connect to them but if you have a mac you can test using the command example below the nfs server setup.

yum install nfs-utils.x86_64
/etc/init.d/nfs start
/sbin/chkconfig nfs on
cd /
mkdir nfs-share1
chmod -R 766 nfs-share1
mkdir nfs-share2
chmod -R 766 nfs-share2
echo "/nfs-share1 192.168.1.100(rw,sync) 192.168.1.101(rw,sync)" >> /etc/exports
echo "/nfs-share2 192.168.1.100(ro,sync,no_root_squash,no_subtree_check) 192.168.1.101(ro,sync,no_root_squash,no_subtree_check)" >> /etc/exports
exportfs -a
/etc/init.d/nfs restart

Mount a nfs share on your Mac OSX computer. For this to work your Mac ip address has to match what is in the /etc/exports file. You will need to do this from your command line terminal on your Mac.

cd /Volumes
mkdir netshare1
mkdir netshare2
mount -o resvport 192.168.1.1:/nfs-share1 netshare1/
mount -o resvport 192.168.1.1:/nfs-share2 netshare2/

From → Linux

2 Comments
  1. jay permalink

    So, what’s the command to access the nfs files on os x?

    • Jay,

      If you are on your Mac just use the terminal and cd into /Volumes/”nfs mount name” or use the Finder program and the nfs share directory will be listed in Volumes.

      Jon

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

%d bloggers like this: