NFS server and client configuration

If you prefer to do minimal installs (me too) you may have noticed that nfs functions are no longer in the base. Here’s the quick steps to configure a server and clients.

1. On the “server” edit the file /etc/exports (alter to your needs)

/export/media 192.168.1.0/24(rw,async,no_root_squash)

2. Run /usr/sbin/exportfs -a
3. Run /usr/sbin/exportfs

/export/media 192.168.1.0/24

4. Run yum install nfs-utils
5. Run /etc/init.d/rpcbind start
6. Run /etc/init.d/nfs start

To set these to run at boot:
1. Navigate to /etc/init.d
2. Run /sbin/chkconfig rpcbind on
3. Run /sbin/chkconfig nfs on

Now that the server is up, let’s get the clients configured.
1. Run yum install nfs-utils
2. Modify /etc/fstab (alter to your needs)

192.168.1.254:/export/media /usr/local/media nfs defaults 0 0

3. Run /etc/init.d/rpcbind start
4. Run /etc/init.d/netfs start

To set these to run at boot:
1. Navigate to /etc/init.d
2. Run /sbin/chkconfig rpcbind on
3. Run /sbin/chkconfig netfs on

This should result in a mount on the client. Test this by creating files and making sure they appear in the mount point. Obviously this is just a quick and dirty guide and for further details, consult the appropriate documentation.

If you get the weird UID/GID issue (4294967294) then modify the /etc/nfsmount.conf on the client machines. This value is 4 by default and it’s commented, uncomment it, change it to 3 and save it.

Defaultvers=3

Restart the netfs on the client (which will remount as an NFSv3 client and the UID/GID should revert back to 0 (root).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s