- 27 Feb 2023
- 1 Minute to read
- Print
- DarkLight
Connecting to NFS shares on Linux
- Updated on 27 Feb 2023
- 1 Minute to read
- Print
- DarkLight
Installing the NFS packages
On Debian or Ubuntu distributions
apt update && apt install -y nfs-common
On RHEL, CentOS, and AlmaLinux
yum install -y nfs-utils
Authenticating IPs for the NFS share
Authenticating your server for the NFS share will require setting which IP addresses are allowed to access the share. These IPs can be set in your mySAU portal on the Manage NFS page associated with your NFS share.
Manually mounting the NFS shares
First, well create a mount point for the NFS. In this example the mount point will be /mnt/nfs. The mount point you use can be any directory on the servers file system.
mkdir -p /mnt/nfs
In order to temporarily mount your NFS share on your Linux server, run the following command. Replace <ip-to-nfs-share> with the IP for your NFS share, which will be located in your mySAU portal in the Manage NFS section. In this example, we are using cid-XXX-SAU-YYYYY-NS as the remote NFS mount. You will find the name for your NFS mount in the same section of the mySAU portal used to manage authenticated IPs.
mount -t nfs4 <ip-to-nfs-share>:/cid-XXX-SAU-YYYYY-NS /mnt/nfs
Automatically mounting the NFS share
In order to mount the NFS share so that it will remain persistent after a reboot you will need to add the following line to your /etc/fstab file. Similar to the manual mounting example above, the <ip-to-nfs-share> and the remote NFS mount name will be found in the Manage NFS section of your mySAU portal.
<ip-to-nfs-share>:/cid-XXX-SAU-YYYYY-NS /mnt/nfs nfs4 intr,timeo=100,_netdev,rw 0 0