本文记录CentOS7做为客户端挂载NFS文件共享(含开机自动挂载)vim
NFS 服务端: nfs.server.exp(192.168.1.10/24)
NFS 客户端: nfs.client.exp(192.168.1.100/24)ssh
# yum install nfs-utils
# vim /etc/idmap.conf ... # 填写域名,此处是server.exp Domain = server.exp ...
nfs服务依赖rpc远程过程调用服务ide
# systemctl start rpcbind # systemctl enable rpcbind
自定义目的路径,此处为"/vol/data"code
# mkdir -p /vol/data
服务端共享目录名为/nfsshareserver
# mount -t nfs nfs.server.exp:/nfsshare /vol/data
或者使用IPrpc
# mount -t nfs 192.168.1.10:/nfsshare /vol/data
若是要指出挂载的NFS版本,添加相应的参数,以下:域名
# mount -t nfs -o vers=3 nfs.server.exp:/nfsshare /vol/data
# vim /etc/fstab ... nfs.server.exp:/nfsshare /vol/data nfs default 0 0 ...