关于gt2440开发板nfs挂载根文件系统挂不上的问题!!

当尝试挂载gt2440开发板的根文件系统到nfs服务器时,遇到'服务器192.168.1.10无响应,仍在尝试'的错误。为解决此问题,需在虚拟机中修改/etc/init.d/ifconfig-eth0文件。注释掉原有检查,并使用'grep root=/dev/nfs /proc/cmdline'进行判断,确保正确设置eth0接口的IP、MAC、子网掩码和默认网关,从而成功挂载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

假如在挂载根文件系统出现如下问题:

Try to bring eth0 interface up......nfs: server 192.168.1.10 not responding, still trying

在虚拟机下更改要移植系统的eth0配置文件具体如下

修改NFS网络文件系统(根文件系统)里面的 /etc/init.d/ifconfig-eth0文件,修改如下:
if [ -f /etc/eth0-setting ] ; then
        source /etc/eth0-setting

             #if grep -q "^/dev/root / nfs " /etc/mtab ; then
              if grep -q "root=/dev/nfs" /proc/cmdline;then              
                  echo -n NFS root ... > /dev/ttySAC0
        else
                ifconfig eth0 down
                ifconfig eth0 hw ether $MAC
                ifconfig eth0 $IP netmask $Mask up
                route add default gw $Gateway
        fi

        echo nameserver $DNS > /etc/resolv.conf

就是把 if grep -q "^/dev/root / nfs " /etc/mtab ; then 注释掉,然后使用 
if grep -q "root=/dev/nfs" /proc/cmdline;then  判断,即可


good 成功!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值