免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 16046 | 回复: 13
打印 上一主题 下一主题

[开发环境] 请教一下,开发板挂载nfs时遇到不能挂载的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-17 18:56 |只看该作者 |正序浏览
本帖最后由 tamujin 于 2011-08-19 14:11 编辑

想在开发板启动的时候加载nfs。

在linux主机编辑的/etc/exports 文件,添加了如下内容:

/home/<useracct>/workdir/filesys *(rw,no_root_squash,no_all_squash,sync)



linux主机我开启了portmap和nfs服务,也关闭了防火墙。在主机挂载设置的nfs目录:mount –t nfs  211.71.69.97:/home/useracct/workdir/filesys /mnt,然后在/mnt下可以看到挂载目录的内容。



启动开发板后在u-boot设置自动加载nfs文件系统,

U-Boot>setenv bootargs bootargs=men=64M console=ttyS0,115200 root=/dev/nfs rw nfsroot=211.71.69.97:/home/useracct/workdir/filesys ip=211.71.69.184:211.71.69.2:255.255.255.0

重启板子,然后依次加载u-boot、内核成功,然后无法加载上nfs文件系统:

把启动的最后几行贴上来:

ALSA device list:
  #0: DaVinci DM6467 EVM (tlv320aic3x)
TCP cubic registered
NET: Registered protocol family 17
Clocks: disable unused uart1
Clocks: disable unused emac
Clocks: disable unused timer1
emac-mii: probed
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
..... timed out!
IP-Config: Retrying forever (NFS root)...
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
....

请教大侠怎么解决这个问题呢?

我在linux主机 #tail  -f  /var/log/messages

显示如下内容:
[root@localhost yx]# tail -f /var/log/messages
Aug 19 19:49:38 localhost kernel: e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
Aug 19 19:49:38 localhost kernel: e1000e 0000:00:19.0: eth0: 10/100 speed: disabling TSO
Aug 19 19:49:38 localhost NetworkManager[1247]: <info> (eth0): carrier now ON (device state 8 )
Aug 19 19:49:38 localhost lldpad[1198]: vdp_ifup:eth0 vdp data already exists !
Aug 19 21:55:56 localhost rpcbind: rpcbind terminating on signal. Restart with "rpcbind -w"
Aug 19 21:56:03 localhost rpc.mountd[3646]: Caught signal 15, un-registering and exiting.
Aug 19 21:56:03 localhost kernel: nfsd: last server has exited, flushing export cache
Aug 19 21:56:04 localhost kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Aug 19 21:56:04 localhost kernel: NFSD: starting 90-second grace period
Aug 19 21:56:04 localhost rpc.mountd[5211]: Version 1.2.3 starting

论坛徽章:
0
14 [报告]
发表于 2011-08-22 08:30 |只看该作者
回复 12# daniel_kohler


    问题解决了,redhat 6中portmap换成了rpcbind,这样装好它nfs服务器就没问题了。多谢了

论坛徽章:
0
13 [报告]
发表于 2011-08-22 08:28 |只看该作者
回复 11# yydsr0278


    谢谢啦,我发现问题是,我把开发板和linux主机用Hub连接的,出现内核启动后没法通过DHCP获得IP。
然后我又用网线把Hub和实验室墙上的网口连起来,这样板子上内核启动后就就可以通过DHCP获得IP启动nfs了

论坛徽章:
0
12 [报告]
发表于 2011-08-20 10:18 |只看该作者
回复 4# tamujin


    如果没有安装的话,当然需要安装了,然后配置nfs服务器的根目录,client连接的用户名和密码,你可以用命令service nfs start看一下你的上位机上有没有这个服务。一般redhat是带有nfs服务器的,只要运行我刚说的命令就好了。

论坛徽章:
0
11 [报告]
发表于 2011-08-20 10:02 |只看该作者
本帖最后由 yydsr0278 于 2011-08-20 10:04 编辑
回复  yydsr0278


    今天我看了一下linux主机系统版本,是redhat 6.1,之前我装了个portmap-4.0是用 ...
tamujin 发表于 2011-08-19 09:14


恭喜你,你的nfs的sever配置的是好的。
但是从你前面的kernel启动的信息看,

你还需要安装并配置一个DHCP的服务器为你的目标板得网卡分配IP地址。
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
..... timed out!
IP-Config: Retrying forever (NFS root)...
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full

配置的IP地址后,还要确认你的kernel是否支持NFS-client,(通过这一步,不过我觉得应该是支持的)

论坛徽章:
0
10 [报告]
发表于 2011-08-19 14:14 |只看该作者
回复 3# yydsr0278


    我把/var/log/messages 的内容贴一下,上次可能是目录写错了/usr,才提示找不到文件。但是我没看懂信息的内容啊

[root@localhost yx]# tail -f /var/log/messages
Aug 19 19:49:38 localhost kernel: e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
Aug 19 19:49:38 localhost kernel: e1000e 0000:00:19.0: eth0: 10/100 speed: disabling TSO
Aug 19 19:49:38 localhost NetworkManager[1247]: <info> (eth0): carrier now ON (device state 8 )
Aug 19 19:49:38 localhost lldpad[1198]: vdp_ifup:eth0 vdp data already exists !
Aug 19 21:55:56 localhost rpcbind: rpcbind terminating on signal. Restart with "rpcbind -w"
Aug 19 21:56:03 localhost rpc.mountd[3646]: Caught signal 15, un-registering and exiting.
Aug 19 21:56:03 localhost kernel: nfsd: last server has exited, flushing export cache
Aug 19 21:56:04 localhost kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Aug 19 21:56:04 localhost kernel: NFSD: starting 90-second grace period
Aug 19 21:56:04 localhost rpc.mountd[5211]: Version 1.2.3 starting

论坛徽章:
0
9 [报告]
发表于 2011-08-19 09:18 |只看该作者
回复 7# yydsr0278

我把ext2的文件系统烧写到flash,让文件系统从flash加载之后,然后再
mount -t nfs 211.71.69.97:/home/useracct/workdir/filesys /mnt
这样可以看到nfs中的内容,这是不是说,在nfs客户端可以加载nfs了呢?

用开发板启动的时候加载nfs还是有问题:

ALSA device list:
  #0: DaVinci DM6467 EVM (tlv320aic3x)
TCP cubic registered
NET: Registered protocol family 17
Clocks: disable unused uart1
Clocks: disable unused emac
Clocks: disable unused timer1
emac-mii: probed
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
..... timed out!
IP-Config: Retrying forever (NFS root)...
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
....


在U-boot中我设置:

setenv bootcmd nboot 0x80700000 0 0x160000\; bootm
setenv bootargs men=112M console=ttyS0,115200 root=/dev/nfs rw nfsroot=211.71.69.97:/home/useracct/workdir/filesys ip=211.71.69.55:211.71.69.2:255.255.255.0
上面设置从nfs启动正确吗?

论坛徽章:
0
8 [报告]
发表于 2011-08-19 09:14 |只看该作者
回复 6# yydsr0278


    今天我看了一下linux主机系统版本,是redhat 6.1,之前我装了个portmap-4.0是用在redhat 5的,然后我就把portmap-4.0卸载了,然后系统里装有nfs-utils和rpmband,好像redhat 6.1中rpmband就起到了portap的作用。
   不过现在的问题是,用开发板启动的时候加载nfs还是有问题:

ALSA device list:
  #0: DaVinci DM6467 EVM (tlv320aic3x)
TCP cubic registered
NET: Registered protocol family 17
Clocks: disable unused uart1
Clocks: disable unused emac
Clocks: disable unused timer1
emac-mii: probed
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
..... timed out!
IP-Config: Retrying forever (NFS root)...
eth0: attached PHY driver [ET1011C] (mii_bus:phy_addr=1:01, id=282f013)
Sending DHCP requests .
PHY: 1:01 - Link is Up - 100/Full
....

总是这样子。

但是我把ext2的文件系统烧写到flash,让文件系统从flash加载之后,然后再
mount -t nfs 211.71.69.97:/home/useracct/workdir/filesys /mnt
这样却可以看到nfs中的内容,请问这是怎么回事呢?

论坛徽章:
0
7 [报告]
发表于 2011-08-18 16:54 |只看该作者
回复 5# tamujin


    那你要看看是不是其他的文件了,现在新的redhat更新的很快,你去看看(/var/log下找找看,应该不会去到其他的目录)

论坛徽章:
0
6 [报告]
发表于 2011-08-18 16:52 |只看该作者
回复 4# tamujin


    详细的名称我记不起来了,你去redhat的安装盘上找找看,比如包括*nfs*的关键字等等
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP