ok6410掛載fedora nfs 解決mount: RPC: Unable to receive; errno = No route to host

來源:互聯網
上載者:User
一  平台

  1.ok6410 a開發板    主機fedora 18

二  基本步驟  1.

    mkdir   nfs    chmod  777 nfs    cd  nfs    mkdir work
    chmod  777  work
    cd work

     touch nihao

  2.配置nfs服務

     fedora 把portmap服務包含在了rpcbind裡面了,沒有了portmap。所以安裝的是rpcbind。

     yum -y install rpcbind nfs-kernel-server

  3.編輯/etc/exports

     vi /etc/exports

     第一次進去應該是新檔案,沒有任何內容

     添加下面一行

     /nfs/work  *(rw,sync,no_root_squash)

     /nfs/work就是我們要共用的目錄,*表示所有ip均可掛載。

  4.啟動nfs服務

     service nfs start  開啟服務  service nfs status  查看狀態  

     service nfs stop  停止服務  service nfs restart  重啟服務

     也可設定成開機啟動nfs服務   systemctl enable nfs-server.service

     同理:啟動rpcbind服務

     service rpcbind start

  5.關閉防火牆(一定要關閉)

     1.如果不關閉的話,要出現mount: RPC: Unable to receive; errno = No route to host

       關於防火牆,要多說一點有時候使用service iptables stop還是不會掛載成功的。

      
要徹底關閉防火牆:參見(http://www.boh.so/html/2013/doc_0202/1800.html

         systemctl stop firewalld.service          systemctl disable firewalld.service
    
2.還有很重要的一點那就是關閉SELINUX
           暫時關閉用   setenforce 0
           永久關閉  vi /etc/sysconfig/selinux     
            修改SELINUX= disabled

  6.ping開發板和主機

    

     1.在虛擬機器linux上執行        ifconfig        知道虛擬機器主機IP為192.168.1.101        啟動開發板進入到linux系統(我們可以使用minicom或者超級終端與開發板串口通訊)      2.在終端上輸入         ifconfig

           其實飛淩最新的linux核心裡面在主介面的Forlinx Test下已經有了setIP互動介面了,我們在那裡既可以 

           查看,也可以更改ip。

        得到開發板linux的IP為。。。。。      3. 如果IP跟虛擬機器主機的IP不在同一網段,就修改下        ifconfig  eth0  192.168.1.110   (可以使用setIp更改)      4.ping一下      5. 終端上輸入ping  192.168.1.101         得到PING 125.217.32.237 (125.217.32.237): 56 data bytes
         64 bytes from 125.217.32.237: seq=0 ttl=64 time=24.942 ms
         64 bytes from 125.217.32.237: seq=1 ttl=64 time=1.518 ms
         64 bytes from 125.217.32.237: seq=2 ttl=64 time=1.025 ms
         64 bytes from 125.217.32.237: seq=3 ttl=64 time=0.906 ms
         64 bytes from 125.217.32.237: seq=4 ttl=64 time=0.743 ms         ctrl+c退出         packets transmitted, 5 packets received, 0% packet loss        這時候PING通了

       6.先掛在在自己主機上,看能否掛上

           主機上輸入mount   -t   nfs  192.168.1.101:/nfs/root    /mnt 

           ls /mnt

           如果可以看到nihao的話,那就可以成功了。

           卸載:umount /mnt

       7.掛載到開發板上

           開發板上輸入

            mount   -t   nfs  192.168.1.101:/nfs/root    /mnt  -o nolock

           含義是: 宿主機IP:宿主機的nfs目錄    開發板掛載目錄

           這樣就可以成功了

三   解決mount: RPC: Unable to receive; errno = No route to host

            1.多半是防火牆的問題,一定要按上面說的禁止防火牆       
            systemctl stop firewalld.servic

              systemctl disable firewalld.service
            2.關閉selinx
            3.開發板一定要ping通主機
            4.重啟nfs,rpcbind服務


                    

聯繫我們

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