linux 挂载共享盘

1、安装nfs-utils

yum install nfs-utils

apt-get install nfs-common

配置文件/etc/exports内容如下:

$ vi /etc/exports
/home/share 10.10.10.101 (insecure,rw,sync,no_root_squash)

多个IP如下:
/home/share 10.10.10.101 (insecure,rw,sync,no_root_squash) 10.10.10.102 (insecure,rw,sync,no_root_squash)

 

关闭防火墙:
暂时关闭防火墙 systemctl stop firewalld
永久关闭防火墙 systemctl disable firewalld

启动 nfs 服务器
service nfs start

  

2、在被共享linux上创建需要共享的目录

mkdir -p /usr/local/share

3、在挂载linux服务器上执行以下命令

mount -t nfs 10.10.10.100:/usr/local/share /mnt -o nolock
说明:在 10.10.10.100上执行以上命令,将10.10.10.100的/usr/local/share 挂载到 /mnt 供 10.10.10.101 访问

  

posted @ 2021-08-31 23:51  CansonHai  阅读(1343)  评论(0编辑  收藏  举报