Linux NFS Network File system

Source: Internet
Author: User
Tags nfsd

XFS File System # ls/lib/modules/2.6.32-431.el6.x86_64/kernel/fs/

Netork File System

# Cat/etc/centos-release

CentOS Release 6.5 (Final)

# Uname-r

2.6.32-431.el6.x86_64

# uname-m

x86_64

nfs-utils : RC.NFSD rpc.mountd

Rpcbind

# Rpm-qa Rpcbind nfs-utils

# yum Groupinstall "NFS file Server"-y

# yum-y Install Rpcbind nfs-utils


/etc/init.d/rpcbind start

# Ps-ef | grep RPC

RPC 1092 1 0 19:37? 00:00:00 Rpcbind

Rpcuser 1110 1 0 19:37? 00:00:00 RPC.STATD

# rpcinfo-p localhost

Program vers Proto Port service

100000 4 TCP 111 Portmapper

#/etc/init.d/nfs Start

Chkconfig NFS On

Chkconfig Rpcbind on

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

# Vi/etc/exports

#nfs shared date for by Hequan at 20160403

/data 192.168.10.0/24 (Rw,sync)

#/etc/init.d/nfs Reload Smooth restart/usr/sbin/exportfs-r

# showmount-e localhost

Export list for localhost:

/data 192.168.10.0/24

# mount-t NFS 192.168.10.10:/data/mnt Mount

#chmod O+w/data permissions for a shared directory

-rw-r--r--1 nfsnobody nfsnobody 0 Mar 22:31 xx

# Cat/var/lib/nfs/etab

/data 192.168.10.0/24 (rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,no_subtree_check,secure_ locks,acl,anonuid=65534, Anongid=65534,sec=sys,rw,root_squash,no_all_squash)

[[email protected] data]# grep 65534/etc/passwd

nfsnobody: x:65534:65534:anonymous NFS User:/var/lib/nfs:/sbin/nologin

# LL/DATA-LD

DRWXR-XRWX 2 nfsnobody nfsnobody 4096 Mar 22:33/data

#/etc/init.d/rpcbind Status

Rpcbind (PID 40379) is running ...

#/ETC/INIT.D/NFS Status

RPC.SVCGSSD has stopped

rpc.mountd (PID 40423) is running ...

NFSD (PID 40438 40437 40436 40435 40434 40433 40432 40431) is running ...

Rpc.rquotad (PID 40419) is running ...

# Ps-ef | Grep-e "Rpc|nfs"

#/etc/init.d/nfs Restart

Shutting down NFS daemon: [OK]

Shutting down NFS mountd: [OK]

Shutting down NFS quotas: [OK]

Shutting down NFS services: [OK]

Shutting down RPC IDMAPD: [OK]

Starting NFS services: [OK]

Starting NFS quotas: [OK]

Starting NFS mountd: [OK]

Starting NFS daemon: [OK]

Starting RPC IDMAPD: [OK]

Man process Name

/etc/exports configuration file

/USR/SBIN/EXPORTFS Management Command-RV load configuration rest, equivalent graceful restart, direct sharing directory

/usr/sbin/showmount viewing NFS Configuration Mount results

# cat/var/lib/nfs/etab Default Parameters

/data 192.168.10.0/24 (rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,no_subtree_check,secure_ Locks,acl,anonuid=65534,anongid=65534,sec=sys,rw,root_squash,no_all_squash)

#mount

192.168.10.10:/data On/mnt type NFS (rw,vers=4,addr=192.168.10.10,clientaddr=192.168.10.11)

EXAMPLE

# sample/etc/exports File

/Master (rw) trusty (Rw,no_root_squash)

/projects proj*.local.domain (rw)

/usr *.local.domain (RO) @trusted (rw)

/home/joe pc001 (rw,all_squash,anonuid=150,anongid=100)

/pub * (Ro,insecure,all_squash)

/SRV/WWW-SYNC,RW Server @trusted @external (RO)

/foo 2001:db8:9:e54::/64 (rw) 192.0.2.0/24 (rw)

/build buildhost[0-9].local.domain (rw)

Local permissions for absolute path shared directories (Nfsnobody) 192.168.10.0/24

RW Async Asynchronous Sync synchronous Asynchronous fast, write to memory, unreliable

Performance and Reliability

RO read-only All_squash turn users into anonymous users 65534

Ensure that all servers have the same permissions on the NFS shared directory

All_squash to compress all clients into anonymous users

Anonuid Anngid

All clients and service sides need to have an identical UID and gid,nfsnobody (UID)

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

Root_squash root maps to anonymous users

# useradd Hequan-u 555 Create the same UID for the user

Vim/etc/exports

/data 192.168.10.0/24 (Rw,sync,all_squash,anonuid=555,anongid=555)

# Mount 192.168.10.10:/data/mnt

To write mount information to the Fstab file

Vi/etc/fstab

192.168.10.10:/data/mnt/nfs defaults 0 0

Save exit

Mount-a


Vi/etc/rc.local

/etc/init.d/rpcbind start

/bin/mount-t NFS 192.168.10.10:/data/mnt

Post, load BIOS read MBR boot loder load kernel kernel init process init process execute rc.sysinit boot kernel module execute different runlevel script

It is not recommended to load network NFS files inside Fstab

Auto Mount

Maintenance Mode or Rescue mode:

File system Read-only

Mount-o Rw,remount/re-mount as writable


This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1759919

Linux NFS Network File system

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.