Use NFS sharing in Ubuntu

Source: Internet
Author: User

System introduction:

[Email protected]: ~ # Cat/etc/issue
Ubuntu 12.04.1 lts \ n \ L

[Email protected]: ~ # Uname-
Linux master 3.2.0-29-generic # 46-ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[Email protected]: ~ #
Installation steps:

PS: The following operation is only valid for the above operating system and is true for testing.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/46/12/wKioL1PtwB7An64oAADEGyPML6c269.jpg "Title =" s.jpg "alt =" wkiol1ptwb7an64oaadegypml6c269.jpg "/>

Step 1:

Install NFS server

Apt-Get install nfs-kernel-Server

Configure the shared directory (about parameters)

Vim/etc/exports

/Opt/html * (RW, sync, no_root_squash)

Start NFS server

/Etc/init. d/Portmap restart

/Etc/init. d/nfs-kernel-server restart

Step 2,

NFS mounting on the client

Mount-t nfs 192.168.1.185:/opt/html/var/www/html

Check whether the mounting is successful

[Email protected]: ~ # DF-H
File System capacity used available % mount point
/Dev/mapper/Ubuntu-root 464g 8.2g 432g 2%/
Udev 869 M 4.0 K 869 M 1%/dev
Tmpfs 351 M 320 k 351 M 1%/run
None 5.0 m 0 5.0 m 0%/run/lock
None 878 M 0 878 M 0%/run/SHM
/Dev/sda1 228 m 25 m 192 m 12%/boot
192.168.1.185:/opt/html 48g 3.2g 43g 7%/var/www/html

Common Parameters of ubuntu NFS include:
RO read-only access
RW read/write access

Sync all data written for sharing upon request
Async NFS can respond to requests before writing data
Secure NFS is sent through the secure TCP/IP ports below 1024
Insecure NFS is sent over port 1024
Wdelay if multiple users want to write data to the NFS Directory, group write (default)
No_wdelay if multiple users want to write data to the NFS Directory, write the data immediately. When async is used,
This setting is not required.
Hide does not share its subdirectories in the NFS shared directory.
No_hide shares the subdirectory of the NFS Directory
Subtree_check if sub-directories such as/usr/bin are shared, force NFS to check the parent directory
(Default)
No_subtree_check is opposite to the above. The parent directory permission is not checked.
All_squash: The UID and gid of the shared file are mapped to anonymous, an anonymous user.
.
No_all_squash retains the UID and gid of the shared file (default)
All requests of the root user are mapped to the same permissions as those of the anonymous user (
Recognize)
The no_root_squas root user has full management access permissions to the root directory.
Anonuid = xxx specifies the UID of an anonymous user in the NFS server/etc/passwd file
Anongid = xxx specifies the GID of anonymous users in the NFS server/etc/passwd file

This article from the "loyal to the country" blog, please be sure to keep this source http://xinsir.blog.51cto.com/5038915/1540692

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.