NFS服務器安裝配置實現Ubuntu12.04與arm文件共享,親測成功

 這是NFS基礎,大神飄過~~~

具體介紹和解釋請參考《鳥哥的Linux私房菜_服務器架設篇 第三版》的NFS相關介紹

實現步驟:

1.服務器端:sudo apt-get install portmap
2.服務器端:sudo apt-get install nfs-kernel-server
3.客戶端:sudo apt-get install nfs-common
4.服務器端配置:sudo gedit /etc/exports
                             添加:/home/share 192.168.1.*(rw,sync,no_root_squash)
                             (共享目錄)         (允許IP)   
(rw權限是可擦寫,還有ro只讀,
sync代表數據會同步寫入到內存與硬盤中,async則代表數據會先暫存於內存當中,而非直接寫入硬盤,
開放客戶端使用root身份來操作服務器的文件系統,那麼開no_root_squash才行,root_squash不允許)
5.服務器端啓動:sudo /etc/init.d/portmap restart
6.服務器端啓動:sudo /etc/init.d/nfs-kernel-server restart
7.arm板連接時:主機:sudo ifconfig eth0 192.168.1.101 netmask 255.255.255.0
                     arm板:ifconfig eth0 192.168.1.102 netmask 255.255.255.0
8.arm板上mount:mount -t nfs 192.168.1.101:/home/share /mnt/hosts
                            (主機IP和共享目錄)         (arm板目錄)
mount上之後arm板上文件自動同步
(
1.出現問題:
reason given by server: Permission denied
解決:
服務器端啓動一定要sudo啓動,不然啓動失敗,服務拒絕
2.出現問題:
svc: failed to register lockdv1 RPC service (errno 111). 
lockd_up: makesock failed, error=-111 
mount: mounting 192.168.1.101:/home/share on /mnt/hosts failed: Connection refused
則改成:
mount -t nfs -o nolock 192.168.1.101:/home/share /mnt/hosts
3.出現問題:
mount: mounting 192.168.1.101:/home/share on /mnt/hosts failed: Device or resource busy
解決:
mount上之後在進行mount命令會出現此提示,設備正在運行,不用再次mount
如果想再次mount可以先umount /mnt/hosts
)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章