Linux Mount (NFS) __linux

Source: Internet
Author: User
Tags root access
First, configure Server for NFS1. Download and install NFS if the system is CentOS 5:
Yum-y Install Nfs-utils Portmap
If the system is Cenos 6:
Yum-y Install Nfs-utils Rpcbind

192.168.0.103 NFS Server 192.168.0.107 Client
2. Configure NFS Configuration Files Etc/exports
/root/nfs 192.168.0.107 (Rw,sync,no_root_squash,no_subtree_check)

Mount address can be an IP, a network segment, a domain name, domain name wildcard, EP: *.youxia.com. There are no spaces between the mount address and the permissions.
After the main explanation of the parameter meaning:
Rw:read-write read-Write permission ro:read-only read-only permission sync: File write memory and hard disk async: Files are temporarily stored in memory but not written to memory. No_root_squash: If the client is logged in as root, the Shared Server directory page has root access (unsafe). Root_squash: If the client is logged in as root, the shared server directory is operated with the privileges of the anonymous user, typically nobody or nfsnobody.

3. Start NFS
If the system is CentOS 5:
Service Portmap Start Service NFS Start
If the system is CENTOS6
Service Rpcbind Start Service NFS Start
4. Client Mount NFS Server
Mount-t NFS 192.168.0.103:/root/nfs/root/test
/root/nfs the directory shared for Server for NFS,/root/test the client mount point (Mount point).
Pleae Teset below:
Under the client's root/test operation, observe the server for NFS specified directory situation:
192.168.0.103
[root@localhost nfs]# ls
[root@localhost nfs]# 

192.168.0.107
[Root@kevin test]# ls
[Root@kevin test]# 

Create a file on the client
[Root@kevin test]# echo "Hello World" >> test.log
[root@kevin test]# ls
test.log
[Root@kevin test]# 

Service side:
[root@localhost nfs]# ls
test.log
[root@localhost nfs]# cat Test.log 
Hello World
[root@localhost NFS] # 

On the client side, another method for querying the mount:
[Root@kevin test]# df-h
filesystem            Size  Used avail use% mounted on
/dev/sda2              18G  885M   16G   6%/
tmpfs                 491M     0  491M   0%/dev/shm
192.168.0.103:/root/nfs
                      7.7G  3.0G  4.4G  41%/root/test







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.