NFS Share Options
You can include NFS share options with the share add
, share change
, and share create
commands. StorNext NAS supports all NFS share options.
For a full list of options, along with how best to use them for your environment, see the exports man page for your specific operating system.
Note: For a list of all the Appliance Controller commands, see the Command Index.
Note: Enable SNFS file locking for NFS shares on NAS clusters.
When entering options, use the following conventions:
- Separate multiple options by a comma.
- For options that can have multiple values, separate the values by a space.
Example (Change an NFS share to read only, and restrict root privileges to remote root users). Enter:
> share change nfs mynfsshare ro,root_squash
Example (Define multiple NFS hosts for the share). Enter:
> share change nfs mynfsshare nfshosts = host1.example.com host2.example.com
NFS shares on managed filesystems require dmnfsthreads
to be set for shares that are StorNext Storage Manager relation points. If you see an error message similar to like "hostname:filesystem server not responding" on your NFS clients, "dmnfsthreads=" should be added to the StorNext filesystem mount option in the /etc/fstab
file on all NAS servers. If you have further questions about cvfs mount options, see man mount_cvfs
from the command line of the system.
If you do not provide ro/rw
or async/sync
options for NFS shares, default values are set to the following:
- read write (
rw
) sync
Use the nfshosts
share option to list clients or networks that are authorized to mount the NFS filesystem. Keep the following in mind when using this option:
- StorNext NAS does not support the use of commas (,) to separate the
nfshosts
share option. If you are defining multiple NFS hosts for a share, separate each host with a space. - If you do not define clients or networks for the
nfshosts
option, then all hosts will be able to mount the NFS share.
Example:
nfshosts = host1.example.com host2.example.com
See Limit NFS Share Access for examples.
Caution
-
The Appliance Controller manages the smb.conf and /etc/exports files for StorNext NAS. Any edits you make directly to either of these files are lost when you restart the Appliance Controller, or when you make a change using any of the
share
commands. -
When you make a change to an SMB share, its existing connection might be impacted and depending on the SMB client, it is possible to disconnect from that share.
You can use NFS share options to limit share access by hostname, IP Network, or netgroup. The following scenarios present options to limit NFS share access.
Note: For the following examples, the same options are specified for each host.
Example (Scenario 1) Export myshare with the default options of rw and sync without restricting access to any hosts:
> share add nfs myshare /stornext/snfs/myshare
Output (Line written to the /etc/exports
file):
/stornext/snfs/myshare *(rw,sync)
Example (Scenario 2) Add an NFS share as read only (ro) and secure for NFS host:
> share add nfs myshare /stornext/snfs/myshare ro,secure,nfshosts = eng.example.com
Output (Line written to the /etc/exports
file):
/stornext/snfs/myshare eng.example.com(ro,secure)
Example (Scenario 3) Limit access to the myhost.example.com, myhost2.example.com, and 10.20.30.123 hosts:
> share add nfs myshare /stornext/snfs/myshare nfshosts = myhost.example.com myhost2.example.com 10.20.30.123
Output (Line written to the /etc/exports
file):
/stornext/snfs/myshare myhost.example.com(rw,sync) myhost2.example.com(rw,sync) 10.20.30.123(rw,sync)
You can apply different export options to different hosts on the same directory. The following example shows how to configure read-only access to everyone in the domain example.com, but limits read-write access to just two IP addresses:
- Create a share:
- Configure read-write access to the two IP addresses:
- Verify the settings set on the share using the
share show
command: - The command in this example adds an entry to the
/etc/exports
file. For this example, the following is the information added to the file:
> share add nfs nfs-ro /stornext/snfs1/nfs2 ro,nfshosts=*.example.com
Output:
Adding share to existing directory
Share nfs-ro successfully added
> share add nfs nfs-rw /stornext/snfs1/nfs2 rw,nfshosts=192.168.1.2 192.168.1.3
Output:
Adding share to existing directory
Share nfs-rw successfully added
> share show
Output:
2 shares:
1: nfs-ro | nfs | /stornext/snfs1/nfs2 | ro,sync,fsid=8000,nfshosts=*.example.com
2: nfs-rw | nfs | /stornext/snfs1/nfs2 | rw,sync,fsid=8000,nfshosts=192.168.1.2 192.168.1.3
/stornext/snfs1/nfs2 *.example.com(ro,sync,fsid=8000)
/stornext/snfs1/nfs2 192.168.1.2(rw,sync,fsid=8000) 192.168.1.3(rw,sync,fsid=8000)