Detailed introduction of NFS system server-side file system installation

Source: Internet
Author: User

Before giving you a detailed introduction to the NFS system service, let's first take a look at the Linux system and then give a full introduction to the NFS System Service, hoping to be useful to you. Configuration of NFS system services in Fedora8. Linux has all the features of a modern, fully functional UNIX system, including real multitasking, virtual memory, shared libraries, excellent memory management, and TCP/IP network support.

The NFS System Service was first developed by Sun in 1984 to allow different computer operating systems to share files with each other. Thanks to the ease of use of NFS system services, it was quickly widely supported by most UNIX/Linux systems and developed by IETE international Internet Engineering Group as RFC1904, RFC1813, and RFC3010 standards.

To use NFS system services, you must start at least three system daemon processes.
1. rpc. nfsd
2. rpc. mountd
3. portmap

There are three methods to set file system sharing on NFS servers.
1. directly modify the/etc/exports file
2. Use the exports command to add and delete directories
3. Use graphical configuration methods
NFS system service client configuration method
1. mount through the mount command
2. Add entries in/etc/fstab.

Each row in the exprots file provides a shared directory setting. The command format is:
<Output directory> [client 1 option 1, option 2,…)] [Client 2 Option 1, option 2,…)] Except that the output directory is a required parameter, other parameters are optional.
Note: The output directory and client in the format are separated by spaces between the client and the client, but there cannot be spaces between the client and the options.

A client is a computer on the network that can access the output directory of the NFS System Service. The client is very flexible and can be the IP address or domain name of a single host, it can also be a common way for clients in a subnet or a domain to specify a Host:
Client
Host with the specified IP address 192.168.16.20
192.168.16.0/24 or 192.168.16. *) all hosts in the specified subnet
Host with the specified domain name pc1.gdvcp.net
.Gdvcp.net all hosts in the specified domain
Or by default) All host options are used to set the access permission and user ing of the output directory. In the/etc/exports file, the options are generally divided into three categories.

(1) The access permission option is used to control the access permission of the output directory.
Ro sets the output directory to read-only
Rw sets the output directory to read/write

(2) User ing options
All_squash maps all common users and user groups remotely accessed to anonymous users or user groups, which are generally nfsnobody)
No_all_squash does not map all common users and user groups remotely accessed to anonymous users or user groups by default)
Root_squash maps root users and user groups to anonymous users or user groups by default)
No_root_squash does not map root users and user groups to anonymous users or user groups.
Anonuid = xxx maps all remotely accessed users to anonymous users, and specifies the anonymous user account as the Local User Account UID = xxx)
Anongid = xxx maps all remotely accessed user groups to anonymous user group accounts, and specifies the anonymous user group account as the local user group account GID = xxx)

(3) Other common options
There are many other options for more comprehensive control over the output directory.
Secure limits the client to be able to connect to the NFS system server from TCP/IP ports smaller than 1024 by default)
Insecure allows the client to connect to the NFS system server from a TCP/IP Port greater than 1024
Sync writes data to the memory buffer and disk synchronously. Although this method is inefficient, it ensures data consistency.
Async stores data in the memory buffer before writing data to the disk if necessary
Wdelay checks whether there are related write operations. If yes, these write operations are executed together. This improves the efficiency by default)
No_wdelay is executed immediately if there is a write operation, and should be used with sync
Subtree_check if the output directory is a sub-directory, the NFS system server checks the permission settings of its parent directory by default)
No_subtree_check even if the output directory is a sub-directory, the NFS system server does not check the permissions of its parent directory. This improves efficiency.

Install

[Root @ localhost init. d] # cd/media/Fedora \ 8 \ i386 \ DVD/Packages/
[Root @ localhost Packages] # find.-name "* nfs *"
/Nfs-utils-1.1.0-6.fc8.i386.rpm
/Nfs-utils-lib-1.1.0-3.fc8.i386.rpm
/System-config-nfs-1.3.32-1.fc8.noarch.rpm
[Root @ localhost Packages] # find.-name "* portmap *"

Installed by default

[Root @ localhost Packages] # rpm-q nfs-utils-lib-1.1.0-3.fc8.i386
Nfs-utils-lib-1.1.0-3.fc8
[Root @ localhost Packages] # rpm-q nfs-utils-1.1.0-6.fc8.i386
Nfs-utils-1.1.0-6.fc8
[Root @ localhost etc] #/etc/rc. d/init. d/nfs start
Start the NFS System Service: [OK]
Disable the NFS system service quota: [OK]
Start the NFS system service daemon: [OK]
Start NFS mountd: [OK]
[Root @ localhost etc] #/etc/rc. d/init. d/nfs stop
Disable NFS mountd: [OK]
Disable the NFS system service daemon: [OK]
Disable NFS quotas: [OK]
Disable NFS System Service: [failed]

Configuration file/etc/exports

The file is empty by default and no shared directory is output. This is based on security considerations, so that no shared resources will be output even if the system starts the NFS system service.
[Root @ localhost opt] # cd/
[Root @ localhost/] # mkdir nfs
[Root @ localhost/] # cd nfs/
[Root @ localhost nfs] # mkdir public root users ji
[Root @ localhost nfs] # ls
Ji public root users
[Root @ localhost nfs] # pwd
/Nfs
[Root @ localhost etc] # vi exports
[Root @ localhost etc] # more exports
/Nfs/public 192.168.1. * (rw, async) * (ro)
/Nfs/ji 192.168.1.6 (rw, sync)
/Nfs/root * .j1_com (ro, no_root_squash)
/Nfs/users * .jw.com (rw, insecure, all_squash, sync, no_wdelay)

Start/stop

[Root @ localhost etc] #/etc/rc. d/init. d/nfs start
Start the NFS System Service: [OK]
Disable the NFS system service quota: [OK]
Start the NFS system service daemon: [OK]
Start NFS mountd: [OK]
[Root @ localhost etc] #/etc/rc. d/init. d/nfs stop
Disable NFS mountd: [OK]
Disable the NFS system service daemon: [OK]
Disable NFS quotas: [OK]
Disable NFS System Service: [OK]
Fc10 in progress
NFS System Service graphical interface: yum install nfswatch. i386 system-config-nfs.noarch

  1. In-depth introduction to compiling the Fedora Kernel
  2. Brief Introduction to the official use of Fedora core
  3. Brief Introduction to the red hat company Fedora Foundation
  4. Fedora Core 4 operating technology
  5. How to install the Fedora Core 6 System

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.