Q. How do I access NAS server using NFS? I am using Redhat Linux (RHEL).
NFS (Network File System) is a protocol originally developed by Sun Microsystems.
NFS used by UNIX and Linux oses as a distributed file system which allows a computer/server/workstation to access files over a network.
NFS is a popular file-sharing protocol for Linux and UNIX. NAS (Network attached storage) also supports NFS configuration.
Linux NFS service
In order to use NFS you need to run portmap service and rpc.statd and rpc.lockd daemons. Use following commands to start these services (RedHat/Fedora Linux):
# chkconfig portmap onAssuming that NAS is configured properly you need to type following command to access NAS (please refer our sample configuration diagram):
# chkconfig nfslock on
# /etc/init.d/portmap start
# /etc/init.d/nfslock start
# mkdir /backupLinux supports UDP by default and TCP as an option. TCP may improve performance in some cases (as a side effect it may increase the CPU load on the local server). If you want to use UDP just type following command:
# mount -o tcp 22.214.171.124:/mountpoint /backup
# mount 126.96.36.199:/mount/point /backupYou can also mount NFS share by editing /etc/fstab file:
# vi /etc/fstabAppend following line:
188.8.131.52:/mountpoint /backup nfs defaults 0 0Save the file and exit to shell prompt.Try to pass following values to mount command improve NFS performance:
# mount -t nfs -o nocto, rsize=32768,wsize=32768 184.108.40.206:/mountpoint /backupWhere,
- rsize=32768,wsize=32768:This will make your nfs connection faster than with the default buffer size of 4096. risze is read size and wsize is write size.
- nocto : Suppress the retrieval of new attributes when creating a file.
There are few more options supported to tweak NFS please consult man page of nfs.
A note for FreeBSD users
NFS configuration is a relatively straightforward, all you need to do is open /etc/rc.conf and put following line (FreeBSD client system):
# vi /etc/rc.confAppend following line:
nfs_client_enable="YES"Save the file and use mount command as follows:
# /etc/init.d/nfsclient startThere are few options supported to tweak NFS client under FreeBSD please consult man page of nfs/mount for more information.
# mkdir /backup
# mount 220.127.116.11:/mountpoint /backup
- Connecting Linux or UNIX system to Network attached storage device
- How do I access NAS server using automount?
- Access NAS server using Windows 2000 or 2003 server
- For more information consult man pages of mount and nfs
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop