ubuntu16.04 NFS系统挂载

一:服务器端

step1:关闭防火墙

sudo ufw disable 

step2:安装nfs

sudo apt-get install nfs-kernel-server

step3:

打开/etc/exports文件,在末尾加入:/home/daysmark/nfsdir*(rw,sync,no_root_squash)

注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下:

/home/daysmark/nfsdir:要共享的目录

*:允许所有的网段访问

rw:读写权限

sync:资料同步写入内在和硬盘

no_root_squash:nfs客户端共享目录使用者权限

重启服务:

#sudo /etc/init.d/nfs-kernel-server restart      //重启nfs服务
#showmount -e                                            //显示共享出的目录

 

二:客户端

nfsclient端安装和配置

(1)安装nfsclient

sudo apt-get install nfs-common

 

(2)查看nfsserver上共享的目录

 

#sudo mount -t nfs 192.168.0.149: /home/daysmark/nfsdir /mnt

 

192.168.0.149为服务器端IP地址这样就把共享目录挂到了/mnt目录

取消挂载用这个指令:
#sudo umount /mnt

posted @ 2019-03-13 11:40  姚红  阅读(8336)  评论(0编辑  收藏  举报