Linux build NFS Support windws2008 access

Source: Internet
Author: User

Most of the tutorials on the Web are NFS access to Linux, but Windows access is slightly different, primarily with different permissions.

The folder permissions on the NFS share on Linux are preferably 757.

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/83/06/wKioL1do7puybPKtAAATUIjuHMg928.jpg "style=" float: none; "title=" 14.jpg "alt=" Wkiol1do7puybpktaaatuijuhmg928.jpg "/>

The NFS properties displayed on the window are read-only and can not be written otherwise.

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/83/07/wKiom1do7pzj8vx8AACFx1ZToi0888.jpg "style=" float: none; "title=" 13.jpg "alt=" Wkiom1do7pzj8vx8aacfx1ztoi0888.jpg "/>


Installation:

# yum-y Install nfs-utils Portmap

Configuration:

# Vi/etc/exports

Add in the exports file

/data 192.168.1.0/24 (Rw,sync,no_root_squash)


1. configuration file definition

The NFS configuration file is/etc/exports and the content format is as follows:
< shared directory > Client 1 (Options) [Client 2 (options) ...]

Shared directory: The directory that NFS shares to the client.

Client: A host in the network that can access this directory. Multiple clients are separated by a space.
Options: Set access permissions for the directory, user mappings, and more, with multiple options separated by commas.

For example:

/opt/public 192.168.1.0/24 (rw,insecure,sync,all_squash,anonuid= 65534,anongid=65534)


2, the client's designated way
Specify the IP address of the host: 192.168.0.100
Specify all hosts in the subnet: 192.168.0.0/24 or 192.168.0.0/255.255.255.0
Host of the specified domain name: nfs.test.com
Specify all hosts in the domain: *.test.com

All hosts: *

3. Option description
RO: Shared directory read only;

RW: The shared directory can be read and writable;
All_squash: All access users are mapped to anonymous users or user groups;
No_all_squash (default): The Access user first matches the native user, the match fails and then maps to the anonymous user or user group;

Root_squash (default): Maps the visiting root user to an anonymous user or user group;

No_root_squash: The root user has the root account privileges;

ANONUID=<UID>: Specifies the local user UID of the anonymous access user, which defaults to Nfsnobody (65534);
Anongid=<gid>: Specifies the local user group of the anonymous Access user GID, default is Nfsnobody (65534);

Secure (default): Restricts the client from connecting to the server only from TCP/IP ports less than 1024;

Insecure: Allow clients to connect to the server from TCP/IP ports greater than 1024;
Sync: It is inefficient to write data synchronously to memory buffer and disk, but it can guarantee the consistency of data;
Async: Save the data in the memory buffer first, and write to disk if necessary;
Wdelay (default): Check if there is a related write operation, if any, then perform these writes together, which can improve the efficiency;

No_wdelay: If a write operation is performed immediately, it should be used in conjunction with sync;
Subtree_check (default): If the output directory is a subdirectory, the NFS server will check the permissions of its parent directory;

No_subtree_check: Even if the output directory is a subdirectory, the NFS server does not check the permissions of its parent directory, which can improve efficiency;


NFS-related commands

1, exportfs

-A all mount or unload content in/etc/exports
-R re-reads the information in/etc/exports and synchronizes updates/etc/exports,/var/lib/nfs/xtab
-U Uninstalls a single directory (used together with-A to unload directories in all/etc/exports files)
-V Exports detailed information to the screen at the time of export.

2, Nfsstat
View the running Status of NFS.


3, Rpcinfo

View the RPC service registration situation.

Related options:

-P Displays all port and program information.

Example:

Rpcinfo-p localhost #列出本机的RPC注册状况.


Restart NFS or use the EXPORTFS command to make the settings effective
Restart NFS:
Service NFS Restart

Entry into force Exportfs file:
Exportfs-rv

#exportfs用法
-A: All content in Mount or unmount/etc/exports
-R: Re-mount/etc/exports in the shared directory
-u:umount Directory
-V: Output Detailed information to the screen
This way, the server Side of NFS is set up.

Boot Portmap and NFS:

Note that it is important to start portmap before you start NFS, otherwise you will get an error.

#service Portmap start#service NFS Start#chkconfig--level NFS On#chkconfig--level Protmap


Reference article:

Http://www.j3j5.com/post-28.html

Http://www.cnblogs.com/lykyl/archive/2013/06/14/3136921.html



This article is from the "Enlightened Grocery store" blog, please be sure to keep this source http://wutou.blog.51cto.com/615096/1791408

Linux build NFS Support windws2008 access

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.