1.nfs
net file system
nfs-utils
2.nfs的启用
yum install nfs-utils -y
systemctl start nfs-server
systemctl enable nfs-server
systemctl stop firewalld
测试
在客户端
showmount -e 172.25.254.123
Export list for 172.25.254.123
3.配置共享
vim /etc/exports
本机目录 共享客户端(共享方式)
/nfsdir *(sync) ##所用人(同步)
/nfsdir 172.25.254.0/24(sync) ##网段(同步)
/nfsdir 172.25.254.223(rw,anonuid=1001,anongid=1001,no_root_squash) ##网址(读写权限,uid=1001,gid=1001,随用户uid,gid(前两个失效))
(all_squash )
exportfs -rv ##重启服务
4.自动挂载
在客户端
yum install autofs -y
systemctl start autofs
systemctl enable autofs
systemctl stop firewalld
实现半自动挂载
cd /net
cd 172.25.254.123
cd nfsdir
df
实现自动挂载
vim /etc/auto.master
8 /mnt /etc/auto.nfs
vim /etc/auto.nfs
westos -ro,vers=3.0 172.25.254.123:/nfsdir
设置自动取消挂载时间
vim /etc/sysconfig/autofs
TIMEOUT=3
cd ##退出等待取消挂载
本文详细介绍NFS网络文件系统的安装、配置与使用方法。包括服务端与客户端的搭建过程,如安装nfs-utils包、启动及配置nfs-server服务、防火墙设置、配置共享目录等步骤,并介绍如何实现客户端自动挂载。
3807

被折叠的 条评论
为什么被折叠?



