Build an NFS server in linux

Source: Internet
Author: User
Set up an NFS server in linux-a Linux Enterprise Application-a Linux server application. For more information, see. I. NFS Overview:
NFS is a Network File System and a Network protocol for File sharing between hosts.

Ii. NFS Server installation:
In RHEL4, the NFS service installs "nfs-utils" and "portmap". Generally, this software package is installed by default.

Iii. NFS Server Configuration:

1. Check whether the software packages NFS-utils and portmap are installed before configuring nfs.
# Rpm-q nfs-utils portmap
Nfs-utils-1.0.6-46
Portmap-4.0-63

2. If not, you can go to the RedHat/PMS directory on the 2nd installation discs of rhel4.
# Cd/cdrom/RedHat/PMS/
# Ls nfs-utils * portmap *
Nfs-utils-1.0.6-46.i386.rpm portmap-4.0-63.rpm
Installation: rpm-ivh nfs-utils-1.0.6-46.i386.rpm portmap-4.0-63.rpm

3. Configuration:
The configuration file of the NFS server is in the "/etc/" directory and the file name is "exports ".
# Vi/etc/exports
In the "exports" folder, each row records the setting of an NFS file sharing directory. The format is as follows:
NFS shared directory name (PATH) Client IP address (setting options)

For example:
/Home/share * (sync. ro)

4. Host address format:
Host with the specified IP address 192.168.1.10
Host with the specified domain name www.linuxdiyf.com
All hosts in the specified CIDR block of 192.168.1.0/24
* .Zmc.com all hosts in the specified domain
* All Hosts

5. Restart the NFS service after saving the "exports" file. The command is as follows:
Service nfs restart
Service portmap restart

6. Run the following command to mount an NFS shared file to a customer:
Server IP Address: Shared Folder path client path-t nfs

7. showmount command
Display the NFS server output directory list:
Showmount-e
Display the shared directory mounted to the NFS server:
Showmount-d
Display the NFS server client and mounted directory:
Showmount-

8. exportfs command
To make the content of the new "exports" file take effect, the command is as follows:
Exportfs-rv
Stop outputting all directories. The command is as follows:
Exportfs-auv
To enable all directories, run the following command:
Exportfs-rv
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.