Mount NFS volumes for Linux or Windows VMs
You can mount an NFS file for Windows or Linux virtual machines (VMs).
Requirements
- You must have at least one export policy to be able to access an NFS volume.
- To mount an NFS volume successfully, ensure that the following NFS ports are open between the client and the NFS volumes:
- 111 TCP/UDP =
RPCBIND/Portmapper
- 635 TCP/UDP =
mountd
- 2049 TCP/UDP =
nfs
- 4045 TCP/UDP =
nlockmgr
(NFSv3 only) - 4046 TCP/UDP =
status
(NFSv3 only)
- 111 TCP/UDP =
Mount NFS volumes on Linux clients
- Review the Linux NFS mount options best practices.
- Select the Volumes pane and then the NFS volume that you want to mount.
- To mount the NFS volume using a Linux client, select Mount instructions from the selected volume. Follow the displayed instructions to mount the volume.
- Ensure that you use the
vers
option in themount
command to specify the NFS protocol version that corresponds to the volume you want to mount. For example, if the NFS version is NFSv4.1:sudo mount -t nfs -o rw,hard,rsize=65536,wsize=65536,vers=4.1,tcp,sec=sys $MOUNTTARGETIPADDRESS:/$VOLUMENAME $MOUNTPOINT
- If you use NFSv4.1 and your configuration requires using VMs with the same host names (for example, in a DR test), refer to Configure two VMs with the same hostname to access NFSv4.1 volumes.
- Ensure that you use the
- If you want the volume mounted automatically when an Azure VM is started or rebooted, add an entry to the
/etc/fstab
file on the host. For example:$ANFIP:/$FILEPATH /$MOUNTPOINT nfs bg,rw,hard,noatime,nolock,rsize=65536,wsize=65536,vers=3,tcp,_netdev 0 0
$ANFIP
is the IP address of the Azure NetApp Files volume found in the volume properties menu$FILEPATH
is the export path of the Azure NetApp Files volume$MOUNTPOINT
is the directory created on the Linux host used to mount the NFS export
- If you want to mount an NFS Kerberos volume, refer to Configure NFSv4.1 Kerberos encryption for additional details.
- You can also access SMB volumes from Unix and Linux clients via NFS by setting the protocol access for the volume to “dual-protocol”. This allows for accessing the volume via NFS (NFSv3 or NFSv4.1) and SMB. See Create a dual-protocol volume for details. Take note of the security style mappings table. Mounting a dual-protocol volume from Unix and Linux clients relies on the same procedure as regular NFS volumes.
Mount NFS volumes on Windows clients
Mounting NFSv4.1 volumes on Windows clients is not supported. For more information, see Network File System overview.
If you want to mount NFSv3 volumes on a Windows client using NFS:
- Mount the volume onto a Unix or Linux VM first.
- Run a
chmod 777
orchmod 775
command against the volume. - Mount the volume via the NFS client on Windows using the mount option
mtype=hard
to reduce connection issues. See Windows command line utility for mounting NFS volumes for more detail. For example:Mount -o rsize=256 -o wsize=256 -o mtype=hard \\10.x.x.x\testvol X:*
- You can also access NFS volumes from Windows clients via SMB by setting the protocol access for the volume to “dual-protocol”. This setting allows access to the volume via SMB and NFS (NFSv3 or NFSv4.1) and will result in better performance than using the NFS client on Windows with an NFS volume. See Create a dual-protocol volume for details, and take note of the security style mappings table. Mounting a dual-protocol volume from Windows clients using the same procedure as regular SMB volumes.
Next steps
Feedback
Submit and view feedback for