1:安装nfs: sudo apt-get install nfs-kernel-server
2:设置允许共享的文件,打开/etc/exports文件,在末尾加入:
/data/app/share *(rw,sync,no_root_squash)
注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下:
/data/app/share:要共享的目录
* :允许所有的网段访问
rw :读写权限
sync:资料同步写入内在和硬盘
no_root_squash:nfs客户端共享目录使用者权限
3: 重启nfs服务器: sudo /etc/init.d/nfs-kernel-server restart
4: 显示共享出的目录: showmount -e
本机测试:
挂载: sudo mount -t nfs localhost:/data/app/share /data/app/share1
取消挂载: sudo umount /data/app/share1
设置开机启动自动挂载文件夹
nfs挂载
猜你喜欢
转载自zhangcaiyanbeyond.iteye.com/blog/2208039
今日推荐
周排行