TANKENQI.cn

May 27, 2024

Linux配置NFS共享存储服务器

Linux0.6 min to read

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# 启动nfssystemctl start nfs# 若 centerOS8以上,则执行此命令启动 sudo service nfs-server start

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

yum -y install nfs-utils# 启动nfssystemctl start nfssudo service nfs-server start

5. 挂载

# 新建目录mkdir -p /data/disk01# 挂载网盘到此路径mount -t nfs 10.0.0.204:/data/publicDisk001 /data/disk01

6. 查看挂载情况

df -h