NFS服務器 10.13.120.232
NFS客戶端 10.13.120.233 10.13.120.236 ......
------------------步驟一:NFS服務器配置------------------
$sudo apt-get install nfs-kernel-server
$sudo mkdir /home/a/nfsroot
$sudo chmod 777 /home/a/nfsroot
$sudo vim /etc/exports
#添加如下內容:
/home/a/nfsroot *(rw,sync,no_root_squash)
$sudo vim /etc/hosts.deny
#添加如下內容
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
$sudo vim /etc/hosts.allow
#添加如下內容
portmap: 10.13.120.
lockd: 10.13.120.
rquotad: 10.13.120.
mountd: 10.13.120.
statd: 10.13.120.
$sudo dpkg-reconfigure portmap
選擇 :NO
$sudo /etc/init.d/nfs-kernel-server restart
$sudo /etc/init.d/portmap restart
#在服務器上本地掛載測試
$sudo mount localhost:/home/a/nfsroot /mnt
$ df /mnt
文件系統 1K-塊 已用 可用 已用% 掛載點
localhost:/home/a/nfsroot
147794432 47781888 92505088 35% /mnt
-----------------------步驟二:NFS客戶端配置--------------------------------
$ sudo apt-get install nfs-common
$ sudo mount -t nfs 10.13.120.232:/home/a/nfsroot /mnt
$ df /mnt
文件系統 1K-塊 已用 可用 已用% 掛載點
10.13.120.232:/home/a/nfsroot
147794432 47781888 92504576 35% /mnt