系统环境
系统平台:CentOS release 6.8 (Final)
NFS Server IP:172.16.55.6
防火墙关闭
SELinux=disabled
安装NFS程序包
1.查看系统是否已经安装
[[email protected] vsftpd]$ yum list nfs-utils 已加载插件:fastestmirror, security Loading mirror speeds from cached hostfile 已安装的软件包 nfs-utils.x86_64 1:1.2.3-70.el6 @net
2.如果没有安装nfs,则安装nfs程序包
[[email protected] vsftpd]$ yum install -y nfs-utils
配置共享目录
[[email protected] vsftpd]$ mkdir -pv /shared/pub mkdir: 已创建目录 "/shared" mkdir: 已创建目录 "/shared/pub" [[email protected] vsftpd]$ vim /etc/exports # 配置 /shared/pub 172.16.55.7(rw) 172.16.0.0/16(ro) [[email protected] vsftpd]$ exportfs -rav
[[email protected] pub]$ showmount -e localhost # 查看 Export list for localhost: /shared/pub 172.16.0.0/16
在其他主机挂载该文件目录
[[email protected] vsftpd]#mkdir /shared [[email protected] vsftpd]#mount -t nfs -w 172.16.55.6:/shared/ /shared/ #以读写方式挂载 [[email protected] vsftpd]#df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 148787220 4877916 143909304 4% / devtmpfs 1001368 0 1001368 0% /dev ... tmpfs 203216 0 203216 0% /run/user/0 172.16.55.6:/shared 4908544 1396992 3255552 31% /shared # 挂载成功
时间: 2024-10-13 15:22:21