Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

NFS Rpi

Dylan Christopherson edited this page Jun 7, 2018 · 22 revisions

NFS Server and Client Installation on CentOS 7

On Server:

Complete commands using sudo. Otherwise just become root.

yum install nfs-utils
mkdir <directory of NFS>           Ex: mkdir /opt/nfsshare                 
chmod -R 777 nfsshare
systemctl enable rpcbind nfs-server nfs-lock nfs-idmap
systemctl start rpcbind nfs-server nfs-lock nfs-idmap

vim /etc/exports      //File might not exist previously. This will create a new file

To the exports file add:

<directory of NFS> <IP of client but use syntax below>(rw,sync,no_root_squash,no_all_squash)

Example:

/opt/nfsshare 10.0.34.*(rw,sync,no_root_squash,no_all_squash)

This may be optional (Might be good just to do):

firewall-cmd --permanent --add-port=111/tcp
firewall-cmd --permanent --add-port=54302/tcp
firewall-cmd --permanent --add-port=20048/tcp
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --permanent --add-port=46666/tcp
firewall-cmd --permanent --add-port=42955/tcp
firewall-cmd --permanent --add-port=875/tcp
firewall-cmd --reload

Continue with:

systemctl restart nfs-server
exportfs -a

On Client

yum install nfs-utils
systemctl enable rpcbind nfs-server nfs-lock nfs-idmap
systemctl start rpcbind nfs-server nfs-lock nfs-idmap

mkdir <directory of NFS>           Ex: mkdir /opt/nfsshare

mount -t nfs <serverName>:<directory of NFS server> <directory name of NFS client>

Example:

mount -t nfs frambuesa:/opt/nfsshare /opt/nfsshare
Clone this wiki locally