ubuntu nfs 掛載總結

來源:互聯網
上載者:User

   

 

 1. 安裝ntf服務

$ sudo apt-get install portmap

$ sudo apt-get install nfs-kernel-server

2.配置允許訪問主機的ip

1)配置/etc/hosts.deny
禁止任何host(主機)能和你的NFS伺服器進行NFS串連。在該檔案中加入:

### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

2)配置/etc/hosts.allow
允許那些你想要的主機和你的NFS伺服器建立串連。

下列步驟將允許任何IP地址以192.168.1開頭的主機串連到NFS伺服器上,具體要看你目標板的連接埠地址,也可以指定特定的IP地址。在該檔案中加入:

### NFS DAEMONS
portmap: 192.168.1.
lockd: 192.168.1.
rquotad: 192.168.1.
mountd: 192.168.1.
statd: 192.168.1.

 

然後重啟portmap daemon:
$ sudo /etc/init.d/portmap restart

 

3、配置/etc/exports

例如我要將/opt/FriendlyARM/mini2440/root_nfs目錄讓使用者的IP共用,則在該檔案末尾添加下列語句:
/opt/FriendlyARM/mini2440/root_nfs *(rw,sync,no_root_squash)

 

4. 重啟NFS服務

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

5.開發板上掛載

# mount -t nfs -o nolock 192.168.1.101:/opt/FriendlyARM/mini2440/root_nfs /mnt/root_nfs

 

5.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.