[DSS V7] How do I mount NFS shares under the Linux console?
Article ID: 95
Last updated: 03 Apr, 2020
Additional information:
product name: DSS V7
product version: all
build: all
Subject:
How do I mount NFS shares under the Linux console?
Contents:
Go to the GUI: CONFIGURATION -> NAS settings -> NFS settings and enable the "Use NFS" option, which allows access to shares and/or snapshots via NFS:
Network File System (NFS) is a protocol for a distributed file system which allows a computer to access files over a network as easily as if they were on its local disks.
Go to CONFIGURATION -> NAS resources -> Shares and select a share which will be available via NFS, and select an option in "NFS share access":
The following NFS options are available:
Allow access IP
Please enter an IP address or an address range which should be allowed to access NFS. You can enter a single IP, multiple IPs separated by a semicolon, or an IP address range. IP addresses not added to the 'Allow write IP' list will have read-only access. Allow write IP
Please enter an IP address or an address range which should be allowed to write to NFS. You can enter a single IP, multiple IPs separated by a semicolon, or an IP address range. Insecure
Allows incoming connections to originate from ports greater than 1024. Synchronous
When this option is enabled, the local file system will wait for the data to be written to the NAS server. NFS performance will be lowered. However, this will ensure that the data will be written directly to the NAS server and will not be stored in the system cache. Insecure locks
Disables authorization of locking requests. Some NFS clients do not send credentials with lock requests and therefore will work incorrectly with secure locks. In this case you can only lock world-readable files. If you have such clients, you can use the Insecure locks option. All squash
Maps all user IDs to the user nobody and all group IDs to the group nogroup. No root squash
Select this option to grant the client machine's root user the root access level to the files on the NAS server. Otherwise, the client root will be mapped to the user and group specified under the Show advanced tab.
Please also note that when you leave the Allow access IP and Allow write IP fields blank, all computers in the subnet will have write access to NFS. When you set the Allow access IP field and leave the Allow to write IP field blank, the specified computers will have read-only access and none will have write access. When you set the Allow to write IP field without setting the Allow access IP field, the specified IPs will have write access and all computers in the subnet will have read-only access.
Go to the Linux console and log in as root with the command:
sudo su
Create the local mounting directory - /local_mount_point. You can do it by using the command:
mkdir /local_mount_point
Go to your Linux console and type:
To check available shares on the NFS server:
showmount -e server_IP_addr
To mount shares from NFS server:
mount -t nfs server_IP_addr:/share_name /local_mount_point
This syntax tells the kernel to attach the file system found on the device (which is of NFS type) at the local mounting directory.
The name of the share is case sensitive in the mount syntax. It is important to exercise due caution in this respect, as otherwise, you might not be able to access the share.
mount -t nfs server_IP_addr:/share/share_name /local_mount_point
You can mount a share in a synchronous or asynchronous mode. When using the synchronous mode, data is not stored in a buffer but transferred at once. In asynchronous mode, the data is first stored in a buffer and then transferred.
In order to mount a share in synchronous mode please use the following command:
mount -t nfs server_IP_addr:/share_name /local_mount_point -o sync
In order to mount a share in asynchronous mode please use the following command:
mount -t nfs server_IP_addr:/share_name /local_mount_point -o async
You can also mount a share with the read or read/write access option:
-r Allows only to read access. It is used to protect the mounted filesystem from writes. Even if the filesystem is writeable by the user and is exported, the option still protects it. A synonym is -o ro. (used instead of -r)
-w Allows both read and write. Mounts the file system as reading/write. A synonym is -o rw. (used instead of -w)
Explanation regarding "-t" option for mount command:
Option "-t" means "file system type". This lets the system know which file system
you want to mount. If you don't type "-t", the system will attempt to mount EXT3 / EXT4, the default
file system in linux.
If the system does not support NFS, you need to install a package called "nfs-common". Here are root command examples from the various Linux flavors:
On Red Hat/Fedora/CentOS:
yum install nfs-common
or:
dnf install nfs-common
or:
zypper install nfs-common
On Debian/Ubuntu:
apt-get install nfs-common
On Gentoo:
emerge nfs-common
On Arch:
pacman -Syu nfs-common
The command syntax depends on system package installer present.