UBUNTU nfs 常用命令

来源:互联网 发布:java软件设计大赛 编辑:程序博客网 时间:2024/06/02 03:25

1. 安装NFS.

sudo apt-get install nfs-kernel-server

2.增加挂载目录。在 /etc/exports中加上需要挂载的目录  /home/neo/nfs

sudo vi /etc/exports

 add one line

 /home/neo/nfs *(rw,sync,no_root_squash,no_subtree_check)

3.重启rpcbind

sudo service rpcbind restart

4. 重启nfs

sudo /etc/init.d/nfs-kernel-server restart

5. 挂载

sudo mount -t nfs-o nolock 192.168.74.130:/home/neo/nfs /mnt/

如果将上面的命令写到  /etc/rc.local 文件, 系统开机将自动运行挂载命令

6.显示当前可用挂载目录

showmount -e