I. Execution of orders
sudo apt-get install Nfs-kernel-server
Second, to create the NFS folder
sudo mkdir/usr/nfs
Change directory permissions:sudo chmod 777/usr/nfs
Third, configure NFS
Execute command:sudo vim/etc/exports
Add the following statement in the configuration file:
/usr/nfs * (Rw,sync,no_root_squash,no_subtree_check)
/USR/NFS: Directory shared with the NFS service client, this path must match the path of the file you set up earlier!
*: Allow all network segments to be accessed or use specific IP
RW: Clients hooking up this directory have read and write access to the shared directory
Sync: Data is written to memory and hard disk synchronously
No_root_squash:root users have full administrative access to the root directory.
No_subtree_check: The permissions of the parent directory are not checked.
Save exit after the modification is complete.
Iv. execution command:sudo/etc/init.d/portmap Restart Restart the Portmap service. NFS is an RPC program that needs to map a good port before using it and set it through Portmap.
V. Execute command:sudo/etc/init.d/nfs-kernel-server Restart Restart the NFS service.
At this point, the NFS server installation configuration is complete.
The next test is:
WINDWOS Mount Linux Host NFS
Open or close Windows features->nfs client by opening Control Panel, programs, and so on
Tick the NFS client, which opens the Windows NFS Client service.
Second, Win+r->cmd
Mount 192.168.2.101:/usr/nfs Z:
Successfully mounted, open my brain, you can see the Mount Z: Disk.
Note: If not mounted successfully, remember to release the firewall!
Parameter meaning:
Mount: Mount command
192.168.2.101:linux Host IP
NFS Service share directory in/usr/nfs:linux host
Z: You mount the network file disk (may conflict with other disks, can be arbitrarily changed)
Un-mount:
Directly inside my Computer mouse click Unmap network drive Z:
Or: Win+r->cmd
Input: Umount z:
(umount-a cancel all network drives)
NFS Server installation and configuration in Ubuntu