Linux configuration NFS Steps and insights

Source: Internet
Author: User

First, the concept

NFS is the short name of the network file system. is a part of a distributed computer system that can now share and assemble remote file systems on heterogeneous networks.

NFS was developed by Sun Corporation. It is now a standard for file services (rfc1904,rfc1813). Its biggest function is to be able to pass the network. Allows computers of different operating systems to share data, so it can also be seen as a file server. NFS is a way to communicate between Windows and Linux and Unix and Linux, in addition to samba.

An NFS network topology under ideal conditions

1. Set up file sharing between Linux systems (Linux and Windows intermediate file sharing using Samba services);

2, NFS is only a file system, itself has no transmission function. is based on the implementation of RPC protocol, the ability to achieve the two Linux systems between the file folder sharing;

3, NFS for C/s architecture;

Second, server configuration

1. Configuration files

The main configuration file is:/etc/exports

The format is: Shared folder can mount host IP (1, Parameter 2, ...)

such as:/var/nfs 172.20.*.* (Rw,sync,no_rootl_squash)

Note: Must pay attention to the Nfs/folder access permission, must be set to 777 permissions, the parent folder/var permission is not required, normal 755 can be.

2. Start related services

Then start the related services in turn: Portmap,nfslock,nfs

Service Portmap Start

Service Nfslock Start

Service NFS Start

Turn off in reverse order.

3. Check Shared Folders

You can then take a look at the showmount–e to see the shared folders:

[Email protected] var]# SHOWMOUNT-E

Export list for Ns.osserver:

/var/nfs 172.20.*.*

OK, that's it. NFSServer Construction completed;

Third, client configuration

1. Ensure Portmap execution

The client must ensure that the RPC protocol corresponds to the Portmap normal execution, otherwise the mount will fail;

2. Mount the/var/nfs folder (local mount point is/mnt/nfs)

Mount-t NFS 172.20.65.16:/var/nfs/mnt/nfs

After successful mount, you can do the same as the local folder.

Iv. Other relevant orders

1, when the/etc/exports file is changed, can not start the NFS service again, directly using EXPORTS–RV can export the shared folder again;

The command format is as follows:

Exportfs [-aruv]

-A: All content in Mount or unmount/etc/exports

-r: Another shared folder in Mount/etc/exports

-u:umount folder

-V: At the time of export. Output specific information to the screen.

Detailed Examples:

[Email protected] var]# SHOWMOUNT-E

Export list for Ns.osserver:

/var/nfs 172.20.*.*

[Email protected] var]# Exportfs–au #所有卸载

[Email protected] var]# SHOWMOUNT-E

Export list for Ns.osserver:

[[email protected] var]# EXPORTFS–RV #所有又一次 Export Once

Exporting 172.20.*.*:/var/nfs

[Email protected] var]#

2. Showmout command is very helpful for NFS operation and error checking , so let's take a look at how to use Showmount.

Showmout

-A: This is typically used on NFS server and is used to display Cline machines that have already been mount on a native NFS folder.

-E: Displays the export folder on the specified NFS server.

Like what:

[Email protected] ~]# showmount-e 172.20.16.139

Export list for 172.20.16.139:
/root/share 172.20.16.137

[Email protected] var]# showmount-a

all mount points on LOCALHOST.LOCALDOMAIN:
*:/root/share
,172.20.*.*:/root/share
,172.20.16.*:/root/share
,172.20.16.139 :/nfsshare
,172.20.16.139:/root/share
172.20.16.137:*
172.20.16.137:,172.20.*.*
172.20.16.137:,172.20.16.*
172.20.16.137:/ROOT/SHARE
172.20.16.139:*
172.20.16.139:,172.20.*.*
172.20.16.139 :, 172.20.16.*
172.20.16.139:,172.20.16.139
172.20.16.139:default

Five, frequently asked questions

1. Hint:mount to NFS server ' 172.20.67.203 ' failed:server are down.

WORKAROUND: There may be a problem with the NFSServer firewall.

2, Hint:mount:RPC:Timed out

Workaround: Because the RPC protocol is not executed; start the Portmap service;

There may also be a firewall problem; server/client is possible.


Linux configuration NFS Steps and insights

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.