Network File System NFS

Source: Internet
Author: User
Article Title: Network File System NFS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Concept of Network File System (NFS)

Network File System (NFS) is a way to share files between machines on the network, just as files are located on the customer's local hard drive. Red Hat Linux can be either an NFS server or an NFS client, which means that it can export the file system to another system or mount the file system imported from another machine.

NFS Installation

NFS is installed in RedHad by default. If NFS is not installed, manually install the following five rpm packages:

Setup-*: the shared NFS directory is defined in/etc/exports.

Initscripts-*: includes the BASIC script for loading the network directory during the boot process.

Nfs-utils-*: includes basic NFS commands and monitoring programs.

Portmap-*: supports secure connections to the nfs rpc service.

Quota-*: The Directory quota shared on the network, including rpc. rquotad (this package is not required)

NFS configuration (server configuration, operations performed on the host that needs to share the file system)

Edit the/etc/exports file to add a shared directory:

/Home/stb 192.168.1.235 (rw, sync, no_root_squash)

/Home/stb 192.168.1.170 (rw, sync, no_root_squash)

/Home/stb 192.168.1.31 (rw, sync, no_root_squash)

/Home/stb Is the shared directory;

192.168.1.235 is the IP address of the host (client) that needs to be mounted to the shared directory;

() Is opitons;

Rw: read/write permission;

Ro: Read-Only permission;

No_root_squash: if the user logging on to the NFS host is a ROOT user, the user has the ROOT permission. root_squash: if the user logging on to the NFS host is a root user, the user has the permission.

Sync: data is synchronized to the storage.

Async: The data is temporarily stored in the memory and not directly written to the hard disk.

Start NFS service

Service nfs start

Service nfs restart

Service nfs stop

Service nfs reload when the/etc/exports file is modified, you do not need to restart the service to execute this command.

Client mounting

Mount by using the mount command

Mount 192.168.1.162:/home/stb/mnt/stb

Mount-t nfs 192.168.1.162:/home/stb/mnt/stb-o nolock

// The client must have the/mnt/stb directory.

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.