Linux NFS mounts and local access

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/xiaofeivip_top/article/details/100569018

A, NFS profile:

NFS (Network File System) that is a network file system, FreeBSD is a supported file system, which allows sharing of resources between computers on the network. In the application of the NFS, the NFS client's local application can transparently read and write files located on a remote NFS server, just like access local files.

Two, NFS installation:

2.1 Create a shared folder and give permission

mkdir /home/share		// 创建文件夹
chmod 777 share  		// 赋予权限

2.2 modify the configuration file

vim /etc/exports 
  
/home/share 192.168.69.0/24(rw,sync,all_squash)

/home/share : 需要共享的文件夹路径
192.168.69.0/24 : 虚拟机或者服务器网段

The above explanation contents inside parentheses:

rw : represents the read / write
RO : for read-only
Sync : Synchronous mode, indicates real-time data in memory is written to disk
the async : asynchronous mode represents data in memory is written to disk periodically
no_root_squash : After adding this option, root user will have the highest authority of the shared directory, the directory as the operation of the machine as
root_squash : as above, and it shows the root user is not high on the authority of the shared directory, only normal user privileges
all_squash : no matter who represents the users are using NFS, its identity are defined as a normal user specified
the anonuid / anongid : root_squash and must be used in conjunction all_squash and options for the user to specify the use of NFS uid is defined and GID, provided that the machine / etc / passwd in there is a corresponding uid and gid

2.3 Start the NFS Services

systemctl start rpcbind 	 // 启动NFS服务之前,要先启动rpcbind服务
systemctl status rpcbind  // 查看是否启动成功

systemctl start nfs		// 启动NFS服务
systemctl status nfs   	// 查看是否启动成功

Here Insert Picture Description

2.4 View

See your shared services

showmount -e

Here Insert Picture Description
Directory information has been displayed on the connection with the client

showmount -a

Three, Windows mount NFS:

3.1 open NFS

Here Insert Picture Description

3.2 View the remote computer NFS shared directory

showmount -e 远程电脑的IP

Here Insert Picture Description
If you do not turn off the Linux firewall command: systemctl STOP firewalld

3.3 NFS mount

mount \\192.168.69.130\home\share x:

Here Insert Picture Description

Common NFS directory:

/ Etc / exports NFS service is the main configuration file

/ Usr / sbin / exportfs NFS service management command

/ Usr / sbin / showmount command to view the client

/ Var / lib / nfs / etab record full access NFS shared directory out of the set value

/ Var / lib / nfs / xtab have logged record of client information

Guess you like

Origin blog.csdn.net/xiaofeivip_top/article/details/100569018
Recommended