ubuntu12.04下nfs安装、配置、测试

ubuntu12.04下nfs安装、配置、测试

zhuanzi :   http://blog.csdn.net/zy799894671/article/details/7832973

  1167人阅读  评论(0)  收藏  举报
ubuntu 测试

先说明一下ubuntu默认root是禁用的,所以先要创建root用户,这样以后不用再sudo了:

1.sudo passwd

输入当前用户密码

输入root用户密码

再次确定root用户密码

成功!

su

输入root密码

ok,进入root用户,不用再sudo了!

 

2.nfs 安装
apt-get install nfs-kernel-server

3.编辑/etc/exports

vi  /etc/exports

加上下面这句
/home/zyp/rootfs(这个路径自己定,我是这个)  *(rw,sync,no_root_squash)

4.修改挂载点的访问权限
chmod 777 /home/zyp/rootfs

5.重启nfs(每一次修改exports都要重启nfs)
/etc/init.d/nfs-kernel-server restart
/etc/init.d/portmap restart

6.测试

在/home/zyp/rootfs下创建一个文件(空的就是看不见)

cd /home/zyp/rootfs

touch test
mount 127.0.0.1(这是你要挂的东西的主机的IP):/home/zyp/nfsroot     /mnt(要挂的地方)
ls -l /mnt

cd /mnt

ls

如果有test的话就说明ok了

离开挂在的目录(/home/zyp/rootfs)

umount  /mnt (卸载刚刚挂在的东西)

你可能感兴趣的:(ubuntu12.04下nfs安装、配置、测试)