ubuntu 12.04 NFS 配置

来源:互联网 发布:中国观鸟网络 编辑:程序博客网 时间:2024/06/10 08:04

一、安装

sudo apt-get install nfs-kernel-server 

二、配置

 1、修改exports文件

 sudo vi /etc/exports

 /nfsroot *(rw,sync,no_root_squash,no_subtree_check)

         2、新建并更改/nfsroot根限

sudo mkdir /nfsroot

sudo chmod 777 /nfsroot/ -R

3、重启NFS服务

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

三 、测试

1、查看本机IP

  ifconfig 

eth0      Link encap:以太网  硬件地址 08:00:27:46:5e:83  
       inet 地址:
10.0.2.15  广播:10.0.2.255  掩码:255.255.255.0

  2、查看可看挂载的目录

showmount -e

/nfsroot *

3、挂载

sudo mount 10.0.2.15:/nfsroot /mnt

4、cp一个文件到nfsroot,在查看/mnt是否也能看到,能看到就成功了!


0 0