File Sharing Service---NFS

Source: Internet
Author: User

I. Introduction to NFS

NFS is the abbreviation for the network file system, which is the web filesystem.

NFS relies on the RPC protocol during file transfer or information transfer. RPC, remote procedure invocation (Procedure call) is a mechanism that enables clients to perform programs in other systems. NFS itself does not provide the protocol and functionality for transmitting information, but NFS allows us to share information over the network, because NFS uses some other transport protocols. And these transport protocols are used for this RPC function. It can be said that NFS itself is a program that uses RPC. Or, NFS is also an RPC SERVER. So whenever you use NFS, you start the RPC service, whether it's NFS server or NFS CLIENT. This allows the server and client to implement the program port correspondence via RPC. You can understand the relationship between RPC and NFS: NFS is a file system, and RPC is responsible for the transfer of information.

Second, the implementation of cross-system file sharing [Linux--->win]

1. Install NFS Service

# yum Install nfs-utils*# yum install protmap*# chkconfig NFS on# chkconfig rpcbind on

2. Configuring NFS

mkdir/app# Vim/etc/exports/app * (rw,no_root_squash) #/etc/init.d/rpcbind restart#/etc/init.d/nfs restart# exportfs- Av

Exprots file format

< output directory > [Client options (access rights, user mappings, others)]

Description of attribute-related parameters

Output directory: The directory client to be shared with the client in the &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;NFS system:       Computers   clients in the network that can access this NFS output directory are commonly specified in the following ways:      1, specify IP, specify a host access  192.168.0.231      2, specify all hosts in Subnet:192.168.0.0/24 192.168.0.0/255.255.255.0      3, host of the specified domain name: www.zzcm.com     4, all hosts: * option:     Set the output directory access rights, user mappings, etc.   Access:      ro: Read-only &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;RW: reads and writes    user mapping permissions:      all_squash: Maps all normal users and groups that are accessed remotely to anonymous users or user groups (nfsnobody);      no_ All_squash: Reverse with All_squash (default);      root_squash: Maps root and owning groups to anonymous users or groups of users (default setting);      no_root_squash: Reverse with Rootsquash;      anonuid= XXX: Maps All remote access users to anonymous users and specifies that the user is a local user (uid=xxx);       anongid= XXX: Maps All remote Access user groups to anonymous user group accounts and specifies that the anonymous user group account is a local user group account (gid=xxx); other options: &NBSP;&NBSP;&NBSP;&NBSp; secure: Restrict clients from connecting to Server for NFS (default setting) only from TCP/IP ports less than 1024      insecure: Allow clients to tcp/from more than 1024 IP port connection server;      sync: It is inefficient to write data synchronously to the memory buffer and disk, but it can guarantee the consistency of the data;      Async: Save the data in the memory buffer first, write to disk if necessary,      wdelay: check if there is a related write operation, if there is the write operation together, this can improve efficiency (default setting);      no_wdelay: If a write operation is performed immediately, it should be used in conjunction with Sync;      Subtree: If the output directory is a subdirectory, the NFS server checks the permissions of its parent directory (the default);      no_subtree: Even if the output directory is a subdirectory, The NFS server also does not check the permissions of its parent directory, which can improve efficiency;

3, Win7 under the corresponding configuration

Win7 under the default many services are not turned on, open Win7 NFS function

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/64/wKioL1SZMduhNQ3eAATMm3XYpHY192.jpg "title=" Nfs.jpg "alt=" Wkiol1szmduhnq3eaatmm3xyphy192.jpg "/>

4. Then mount NFS under Linux

Start-Up Run-->cmd

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/64/wKioL1SZMn-RqlRVAAAzuoSHhi4180.jpg "title=" Mount.jpg "alt=" Wkiol1szmn-rqlrvaaazuoshhi4180.jpg "/>

And then I open my computer and I have the following letter.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/64/wKioL1SZMsPRYUuyAAFi59weTzQ926.jpg "title=" X.jpg " alt= "Wkiol1szmspryuuyaafi59wetzq926.jpg"/>

5. Modify Win7 to NFS partition read-only properties

Because. After mounting, with mount you can see the user's UID is-2, and the Linux shared directory owner is the root, so win uid=-2 users must not write in.

The solution is for Win7 to change the UID and GID to 0 when mounting NFS: Open the registry:

Start-and-run typing regedit

Hkey_local_machine\software\microsoft\clientfornfs\currentversion\default, added two items: Anonymousuid,anonymousgid,

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/64/wKioL1SZNfXSSQFcAANDogfmacI914.jpg "title=" Zhu.jpg "alt=" Wkiol1sznfxssqfcaandogfmaci914.jpg "/>

Then restart the computer and mount it again











This article is from the "lost identification Frank Beautiful ~" blog, please be sure to keep this source http://limian.blog.51cto.com/7542175/1593969

File Sharing Service---NFS

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.