Linux NFS檔案伺服器安裝配置

來源:互聯網
上載者:User

標籤:

[相關資訊]
OS: Linux version 3.14-kali1-686-pae

為什麼要用NFS
在做sama5d3 xplained開發時,每次偵錯工具都要做兩件事,第一步:將編譯好的程式放到TFTP目錄下,第二步:在開發板
一側通過 tftp -g -l 程式名 192.168.1.25 來下載
而在使用了NFS後,開發板一側只要將主機的NFS目錄掛載的本地的/mnt下後,每次編譯好程式直接丟在主機的NFS目錄下,而相應的開發板一側就可以在/mnt下得到最新的程式,效率果然有所提升。

[NFS服務端的安裝配置]
安裝

$ sudo apt-get install rpcbind$ sudo apt-get install nfs-kernel-server nfs-common


配置

$ sudo nano /etc/exports

在exports中添加

/var/nfs        192.168.1.*(rw,sync,no_subtree_check)

192.168.1.× 表示192.168.1.2 至192.168.1.254所有IP都可以訪問
rw 表示讀寫權限
sync 表示寫時保證記憶體中的內容與硬碟中的內容同步
no_subtree_check 不檢測子目錄提高效率

相關服務重啟

$ sudo /etc/init.d/rpcbind restart$ sudo /etc/init.d/nfs-kernel-server restart


[測試NFS配置]

$sudo mount -t nfs 192.168.1.25:/var/nfs /mnt/$ touch  /var/nfs/tt.c$ ls /mnt/


tt.c
經以上驗證說明 NFS伺服器的搭建已經完成。

Linux NFS檔案伺服器安裝配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.