Originally published June 13, 2016 @ 11:31 am
In this example we create the “test” NFS share on a QNAP NAS from CLI and export it to client_ip_01 and client_ip_02. Things to keep in mind: this only creates an NFS share – not a Samba share. To create a Samba share, look at the “/sbin/addshare” command.
Determine the mountpoint for your data volume:
[~] # df -h | grep share /dev/mapper/cachedev1 12.7T 11.2T 1.5T 88% /share/CACHEDEV1_DATA1
SSH to the QNAP as admin user (QNAP does not have a root account).
Add the new NFS share to nfssetting:
vi /etc/config/nfssetting # ADD: [Access] /share/CACHEDEV1_DATA/test = TRUE [AllowIP] /share/CACHEDEV1_DATA/test = <client_ip_01>,<client_ip_02> [Permission] /share/CACHEDEV1_DATA/test = rw,rw SquashOption] /share/CACHEDEV1_DATA/movies = no_root_squash,no_root_squash [AnonUID] /share/CACHEDEV1_DATA/movies = 65534,65534 [AnonGID] /share/CACHEDEV1_DATA/movies = 65534,65534
Update /etc/exports
/sbin/gen_exports > /etc/exports /usr/sbin/exportfs -r 1>/dev/null 2>/dev/null # OR /etc/init.d/nfs restart
Check that the new export has been configured:
grep test /etc/exports
Confirm that QNAP NFS server is accessible from client:
/usr/sbin/showmount -e <qnap_ip>
Optional steps for initial NFS configuration:
Enable NFS services at boot time:
setcfg NFS Enable True
Re-/start NFS server:
/etc/init.d/nfs restart
Experienced Unix/Linux System Administrator with 20-year background in Systems Analysis, Problem Resolution and Engineering Application Support in a large distributed Unix and Windows server environment. Strong problem determination skills. Good knowledge of networking, remote diagnostic techniques, firewalls and network security. Extensive experience with engineering application and database servers, high-availability systems, high-performance computing clusters, and process automation.