server:OS ubuntu10.04 192.168.1.11
client:redhat ip:192.168.1.12
Ubuntu:配置NFS
root@ubuntu:~#apt-get install nfs-kernel-server
root@ubuntu:~#vi /etc/exports
添加:
/root/nfshome *(rw,sync,no_root_squash)
root@ubuntu:~# exportfs -a
在root/目下建立:nfshome 和testnfs 目录 权限改为777
测试:
没有问题:
root@ubuntu:~# mount localhost:/root/nfshome /root/testnfs/ -o nolock
下面出现错误
root@ubuntu:~# mount 192.168.1.11:/root/nfshome /root/testnfs/ -o nolock
mount.nfs: mount system call failed
为啥:192.168.1.11也是Ubuntu的地址啊!
编辑:
root@ubuntu:~#vi /etc/default/portmap
#OPTIONS = "-i 127.0.0.1"
重启:portmap和nfs
测试:
没有问题:
root@ubuntu:~# mount 192.168.1.11:/root/nfshome /root/testnfs/ -o nolock
下面出现错误
root@ubuntu:~# mount localhost:/root/nfshome /root/testnfs/ -o nolock
mount.nfs: mount system call failed
在redhat上有问题:
...mount failed, reason given by server: Permission denied
vi /etc/hosts
#127.0.1.1 ubuntu
OK!!