This article provides step-by-step instructions on how to create, expose and mount a VPSA NFS share with Linux servers.
OS distros that were tested with this article: RHEL8.1, RHEL 8.2 and Ubuntu 20.04.
The default NFS client version on these distros is v4.2, and Zadara recommend you to use that version where your environment supports this version.
Notes:
- The parallel I/O feature in NFS v4.1 onwards does require a reverse route back from the client to the NFS server.
- You can use the nfsvers mount option to set a lower version of NFS on the client.
1. Create a NAS Volume and allow servers access
On the VPSA GUI, highlight Volumes, then select Create \ Create NAS Share
The Create Volume dialog will appear.
Fill in the NAS Volume properties: Name, Capacity, NAS Export Name.
Press Submit and then Yes on the confirmation popup window.
For more info regarding volume properties please refer the Zadara VPSA Guide in the following link
2. Attach the NAS Volume as an NFS Share to a Server
On the VPSA GUI, highlight Servers, then select Add \ Manual
The Create server dialog will appear.
Fill in the server/s Name, check in the Linux button and fill in IP address (for a single server) or CIDR Block (for multiple servers)
Press Create and then Yes on the confirmation popup window.
On the VPSA GUI, highlight Servers and the server’s Name.
then select Volumes and Attach
The Attach volumes dialog will appear.
Select the volume you wish to attach and select NFS for Attach type
Press Attach and OK on the confirmation popup window
Your new NFS volume is ready to be mounted from Linux Servers
To check or edit the export name, highlight Volumes and the volume name.
Check the volume’s details pane.
3. Connect the NFS share to a Linux Client:
3.1 Add NFS support to your Linux Server:
- In Ubuntu:
Run apt list --installed | grep nfs-common to check if nfs-common is installed.
To install nfs-common run sudo apt-get install nfs-common
- In Redhat/CenOS:
Run rpm -qa | grep nfs-utils to check if nfs-utils is installed.
To install nfs-utils run sudo yum install nfs-utils
3.2 Create a mount point in the Linux Server
sudo mkdir /Zadara
3.3 For one time mount run to following :
sudo mount –t nfs -o options <VPSA IP>:/<Export Name> /<mount point>
For example:
sudo mount -t nfs -o nfsvers=4.1 172.31.10.2:/export/Zadara_NFS_VOL1 /Zadara
(In this example, the mount will use NFS version 4.1)
3.4 To automatically mount the volume on system startup add the following
line to /etc/fstab
<VPSA IP>:/<Export Name> /<mount point> nfs options 0 0
For example:
172.31.10.2:/export/Zadara_NFS_VOL1 /Zadara nfs defaults,nfsvers=4.1,_netdev 0 0
We recommend to add the following to the defaults options
- nfsvers - determine NFS protocol version
- _netdev - prevent the system from attempting to mount a NAS filesystem before network services has been enabled on the server.
3.5 For systemd based distros like RHEL \ Ubuntu, you can use systemd to mount your NFS share. If you use systemd for mounting, there is no need to make entries in /etc/fstab.
Please see following example on how to use systemd to mount your NAS filesystem
- On the server create mount point for your NAS filesystem:
sudo mkdir /Zadara
- For mount point /Zadara , save the following syntax as mount in /etc/systemd/system.
Please note, when using mount point path containing slashes, you will need to replace the slashes with minuses, meaning, for mount point /mnt/Zadara save the file as mnt-Zadara.mount
[Unit]
Description=Zadara VPSA NFS mount
After=nfs-client.target
Requires=nfs-client.target
[Mount]
What=172.31.10.2:/export/Zadara_NFS_VOL1
Where=/Zadara
Type=nfs
Options=defaults,nfsvers=4.1
[Install]
WantedBy=multi-user.target
- After saving the file as /etc/systemd/system/Zadara.mount do the follow:
- sudo chown root:root /etc/systemd/system/Zadara.mount
- sudo chmod +x /etc/systemd/system/Zadara.mount
- sudo systemctl daemon-reload
- sudo systemctl enable Zadara.mount
- sudo systemctl start Zadara.mount
4. Basic Authentication Settings
By default "root" user and group at NFS client are mapped to "root" user and group in the VPSA NFS server. All other users are mapped to user "nobody" and group "nogroup".
In order to set a basic NFS authentication so that users and groups at the client will be mapped to the corresponding users and groups at the VPSA NFS server please refer to “creating NAS Users” section on the Zadara VPSA user guide:
http://guides.zadarastorage.com/vpsa-guide/2001/managing-access-control.html?highlight=domain#id2