55. Exportfs Command, NFS client problem
First, Exportfs command
This command was installed with Nfs-utils. The NFS service cannot be restarted in any way, and if you want to reboot, uninstall the mounted directory on the other shared machine or use the EXPORTFS command.
Common options
-A all mount or uninstall all
-R Re-mount
-U Uninstalls a directory
-V Show shared directory
The following operations are on the service side
# Vim/etc/exports//Add
/TMP/192.168.93.2/24 (Rw,sync,no_root_squash)
# Exportfs-arv//Do not restart the NFS service, the configuration file will take effect
And look at the client.
# SHOWMOUNT-E 192.168.93.130
Export list for 192.168.93.130:
/tmp 192.168.93.129/24
/home/nfstestdir 192.168.93.2/24
The/tmp directory appears on the shared directory
# mount-t NFS 192.168.93.130:/tmp//newdir//This IP is service-side IP
# df-h
Now the client's Newdir directory is the server's TMP directory.
The file that is created now belongs to and belongs to the group root, because No_root_squash, does not limit root.
II. Client Issues with NFS
This issue occurs with NFS version 4
When a client mounts a shared directory, whether it is a root user or a normal user, a new file is created with the owner and group nobody
(i) Add-o nfsvers=3//Specify NFS version 3 for client mount
[Email protected] ~]# umount/newdir/
[Email protected] ~]# mount-t nfs-o nfsvers=3 192.168.93.130:/tmp//newdir
[Email protected] ~]# mount-t nfs-oremount,nfsvers=3 192.168.93.130:/tmp//newdir
(ii) Both the client and the server need
# vim/etc/idmapd.conf//
Change "#Domain = local.domain.edu" to "Domain = xxx.com" (here xxx.com, Custom), and then restart the RPCIDMAPD service, CENTOS7 without this service, restart Rpcbind.
55. Exportfs Command, NFS client problem