Skip to content

Instantly share code, notes, and snippets.

@dbirks
Last active January 13, 2018 05:37
Show Gist options
  • Save dbirks/cc6926385cefd0a934e01b81067db5e1 to your computer and use it in GitHub Desktop.
Save dbirks/cc6926385cefd0a934e01b81067db5e1 to your computer and use it in GitHub Desktop.
NFS notes

NFS notes

Helpful articles:

https://wiki.archlinux.org/index.php/NFS

https://wiki.archlinux.org/index.php/ZFS#Bind_mount

Install NFS

example: yum install nfs-utils

Configuring the server

From a Arch box:

NFS root: /srv/nfs

Make mounts with mkdir /mnt/nfs/sharename.

Bind mount to the source, which in my case is on ZFS:

/etc/fstab

/tank/files /srv/nfs/sharename none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0

Mount everything in /etc/fstab with mount -a.

Export the share names:

/etc/exports

/srv/nfs                10.1.1.0/24(rw,fsid=root,crossmnt)
/srv/nfs/sharename      10.1.1.0/24(rw,fsid=root) 

Start or restart the service:

systemctl start nfs-server

Or export again without restarting:

exportfs -rav

Some things to watch for:

The 'other' group must have write permissions if a remote user is going to be able to write to the NFS-exported file. Example: drwxr-xrwx or chmod -R o+w files/.

Configuring the client

See what shares are available:

showmount -e servername

Make a mount point: mkdir /mnt/remote-files

Mount the share:

/etc/fstab

servername:/srv/nfs/sharename   /mnt/remote-files   nfs   defaults,soft,rsize=32768.wsize=32768,timeo=900,retrans=5,_netdev   0 0

Mount all: mount -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment