Complete NFS settings in Linux in three steps

Source: Internet
Author: User

Linux systems are used in many places, and some Linux NFS settings are also involved for a set-up. NFS is a frequently used service for sharing document directories between linux systems. In fact, the configuration of Linux nfs is very simple. I also use simple square characters to record the configuration points of NFS.

1) server configuration file:/etc/exports

File Format: Directory hostname (options)

Directory is the Directory to be shared;

The domain name/IP Address/IP address segment of the hostname client. It can also be empty. If it is null, it indicates any host;

Optional. If this parameter is not specified, the default option is used. Such as ro, rw, sync, async, etc;

For example:

The following is a code snippet:

/Home 192.168.1. * (rw, async, no_root_squash)

Rw; readable and writable

Async; synchronization, the server only accepts the response from the client to proceed to the next step, to ensure more reliable connection

No_root_squash; Do not compress the permissions of the root user. to be safer, use

On the server side, you can use the exportfs command to output the directories shared by exports;

2) ensure that portmap and Linux NFS are started.

The following is a code snippet:

#/Etc/rc. d/init. d/portmap start (or: #/service portmap start)

#/Etc/rc. d/init. d/nfs start (or: #/serverice nfs start)

Note: You can use netstat & ndash; untlp to check whether the portmap and nfs services are started. Port 2049 is the NFS server and port 111 corresponds to the portmap service, it can be found that both TCP and UDP have corresponding ports;

3) NFS client configuration (mount or fstab file)

The following is a code snippet:

# Mount & ndash; t nfs hostname (orIP):/directory/mountpoint

-T nfs can be omitted;

/Directory is the absolute path;

Or add the mounting records of the NFS file system to the/etc/fstab file.

The following is a code snippet:

NFS serverIP:/directory/mountpoint nfs ults 0 0

In Linux NFS, you can use mount to check the mount point.

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.