ubuntu11+ 配置NFS(服務器 + 客戶端)
NFS服務器 10.13.120.232NFS客戶端 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
#添加如下內容:
$sudo vim /etc/hosts.deny
#添加如下內容
$sudo vim /etc/hosts.allow
#添加如下內容
$sudo dpkg-reconfigure portmap選擇 :NO
-----------------------步驟二:NFS客戶端配置--------------------------------
$ df /mnt
$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
$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
$ 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
posted on 2012-01-09 13:02 himalayas 閱讀(366) 評論(0) 編輯 收藏 所屬分類: linux