安装nfs 实现磁盘挂载NFS共享服务

1. 安装 nfs-untils

yum -y install nfs-utils

2. 设置共享目录

mkdir -p /data/publicDisk001
# 授权
chmod 777 /data/publicDisk001/

# 修改文件,让10.0.0.0/24 这个网段的机器都能用
vim /etc/exports

/data/publicDisk001   10.0.0.0/24(rw,no_root_squash)

 3. 启动广播和nfs

systemctl start rpcbind

# 启动nfs
systemctl start nfs
# 若 centerOS8以上,则执行此命令启动 
sudo service nfs-server start

4.  在同一网段下,另一个主机也安装 nfs 作为客户端

yum -y install nfs-utils
# 启动nfs
systemctl start nfs
sudo service nfs-server start

 5. 挂载

# 新建目录
mkdir -p /data/disk01

# 挂载网盘到此路径
mount -t nfs 10.0.0.204:/data/publicDisk001 /data/disk01

 

6. 查看

df -h

 

posted @ 2022-09-22 00:33  得好好活  阅读(365)  评论(0编辑  收藏  举报