Centos7 nfs 共享 mount远程目录
2016-04-22 16:58
573 查看
安装 NFS 服务器所需的软件包
服务器 10.44.154.200
安装nfs:yum -y install nfs-utils rpcbind
编辑exports文件
编辑/etc/exports,增加一行
/mnt/files/stone 10.170.184.39(rw,no_root_squash,no_all_squash,sync)
生效 exportfs -r
查看 exportfs
为rpcbind和nfs做开机启动
systemctl enable rpcbind.service
systemctl enable nfs-server.service
手动启动
命令:service rpcbind start
service nfs start
查看已共享的目录,命令:
本机:showmount -e
其他:showmount -e IP
安装NFS 客户端
客户端机器 10.170.184.39
systemctl enable rpcbind.service
systemctl start rpcbind.service
挂载远程目录
mount -t nfs -o nolock,nfsvers=3,vers=3 -o proto=tcp 10.44.154.200:/mnt/files/stone /home/mnt/files/stone
查看结果
设置开机挂载,编辑/etc/fstab
vi /etc/fstab
# 加上
10.44.154.200:/mnt/files/stone /home/mnt/files/stone:/ /data nfs4 ro,hard,intr,proto=tcp,port=2049,noauto 0 0
服务器 10.44.154.200
安装nfs:yum -y install nfs-utils rpcbind
编辑exports文件
编辑/etc/exports,增加一行
/mnt/files/stone 10.170.184.39(rw,no_root_squash,no_all_squash,sync)
生效 exportfs -r
查看 exportfs
为rpcbind和nfs做开机启动
systemctl enable rpcbind.service
systemctl enable nfs-server.service
手动启动
命令:service rpcbind start
service nfs start
查看已共享的目录,命令:
本机:showmount -e
其他:showmount -e IP
安装NFS 客户端
客户端机器 10.170.184.39
systemctl enable rpcbind.service
systemctl start rpcbind.service
挂载远程目录
mount -t nfs -o nolock,nfsvers=3,vers=3 -o proto=tcp 10.44.154.200:/mnt/files/stone /home/mnt/files/stone
查看结果
设置开机挂载,编辑/etc/fstab
vi /etc/fstab
# 加上
10.44.154.200:/mnt/files/stone /home/mnt/files/stone:/ /data nfs4 ro,hard,intr,proto=tcp,port=2049,noauto 0 0
相关文章推荐
- # sed 查找匹配行
- Linux(Ubuntu) 新手安装JDK,一步一步实现(详解)
- bitbake linux-name 执行各个task的过程
- Linux 技巧:让进程在后台可靠运行的几种方法
- Linux中的动态库和静态库(.a/.la/.so/.o)
- CentOS6网卡静态IP设置
- linux下自定义命令的man手册编写
- linux如何恢复rm命令
- linux常用命令(持续更新... ...)
- 定制centos
- Linux系统yum命令安装软件时保留(下载)rpm包 -- 转载
- 【转】 Linux makefile 教程 非常详细,且易懂
- Show running processes with file name
- NTP服务及时间同步(CentOS6.x)
- Linux基础之文件权限LLinux
- linux下文件删除
- centos配置yum源
- Linux的文件系统结构
- linux 地址空间
- learn linux connect