Home Server NFS Shares


17-Jun-2011: initial release.
23-Nov-2012: adjusted for Slackware.
31-Oct-2013: fixed configuration example.



File sharing for Linux or *BSD clients is best done with NFS. Currently NFS version 4 is wide supported so that is what we will setup. On our Linux client, the mgmtws system, disks from the homsrv machine will be mounted. Everything is configured for IPv4 only, it seems that there are some missing pieces to use NFS via IPv6. Right now this isn’t a big problem for our network.


Configure the server.

First,make sure the packages portmap and nfs-utils are installed. Then edit /etc/exports to add two filesystems we want to make available for client machines:

# /etc/exports
# List of directories exported to NFS clients.  See exports(5).
# Use exportfs -arv to reread.
# Example for NFSv2 and NFSv3:
#  /srv/home       hostname1(rw,sync) hostname2(ro,sync)
# Example for NFSv4:
#  /srv/nfs4       hostname1(rw,sync,fsid=0)
#  /srv/nfs4/home   hostname1(rw,sync,nohide)
# Using Kerberos and integrity checking:
#  /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
#  /srv/nfs4/home   gss/krb5i(rw,sync,nohide)


Now enable and start the NFS services:

root@homsrv:~# chmod 755 /etc/rc.d/rc.rpc
root@homsrv:~# /etc/rc.d/rc.rpc start
Starting RPC portmapper:  /sbin/rpc.portmap
Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd
root@homsrv:~# chmod 755 /etc/rc.d/rc.nfsd
root@homsrv:~# /etc/rc.d/rc.nfsd start
Starting NFS server daemons:
  /usr/sbin/exportfs -r
  /usr/sbin/rpc.nfsd 8



Configure the client.

To configure the client, just install nfs-utils and portmap packages like above. Then add the following lines to /etc/fstab:

# nfs
homsrv.wpl.ym:/mnt/users  /mnt/users  nfs    defaults            0      0
homsrv.wpl.ym:/home       /mnt/home   nfs    defaults            0      0


Make sure you have the mountpoints /mnt/users and /mnt/home, execute “mount -a” and then you should have these two new filesystems mounted from the Home Server:

root@slack14:~# mkdir -p /mnt/{users,home}
root@slack14:~# chmod 755 /etc/rc.d/rc.rpc
root@slack14:~# /etc/rc.d/rc.rpc start
Starting RPC portmapper:  /sbin/rpc.portmap
Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd
root@slack14:~# mount -a -t nfs




See the download page for the script and configuration files.