Linux NFS Export / share directory to other UNIX / Linux computer
Q. I’m using CentOS 5 Linux 64 bit version. How do I share directory called /data2 to all other UNIX / Linux computers?
A. NFS (Network file system) is both a protocol and file system for accessing and sharing file systems across a computer network using UNIX and Linux. NFS v4 is used in modern Linux distributions. It offers performance improvements, mandates strong security, and introduces a stateful protocol etc.
How do I export a directory with NFS?
In order to export or share directory called /data2, you need to edit a file called /etc/exports. The file /etc/exports serves as the access control list for file systems which may be exported to NFS clients.:
# vi /etc/exports
Add config directive as follows:
/data2 *(rw,sync)
Each line contains an export point and a whitespace-separated list of clients allowed to mount the file system at that point. Each listed client may be immediately followed by a parenthesized, comma-separated list of export options for that client.
Where,
- rw - Allow both read and write requests on /data2 NFS volume
- sync - Reply to requests only after the changes have been committed to stable storage
Save and close the file. Restart the nfs service:
# /etc/init.d/nfs restart
NFS client configuration
Client computer need to mount file system using mount command or /etc/fstab file, enter:
# mkdir /mnt/nfs
# mount -t nfs4 nfsserver-name-or-ip:/data2 /mnt/nfs
Read the man page for more configuration options:
$ man exports
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Ubuntu Linux NFS Server installation and Configuration
- Change default Linux / UNIX text editor from VI to Pico
- BASH Shell change the color of my shell prompt under Linux or UNIX
- Qmail delivering mail ~/Mailbox home directories
- How to Set JAVA_HOME / PATH variables Under Linux Bash Profile
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: access_control_list, computer_network, linux_64_bit, linux_computers, linux_distributions, linux_nfs, nfs_clients, nfs_network, nfs_v4, performance_improvements, share_directory, sharing_file, stateful_protocol, strong_security, using_unix




Recent Comments
Today ~ 12 Comments
Yesterday ~ 3 Comments
09/06/2008 11:03 pm (2 days ago) ~ 12 Comments
09/06/2008 02:10 pm (2 days ago) ~ 7 Comments
09/06/2008 06:51 am (2 days ago) ~ 2 Comments