主题 : 通过NFS启动QQ2440: mount_devfs_fs(): unable to mount devfs, err: -2 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 1169
精华: 0
发帖: 7
金钱: 70 两
威望: 7 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2008-07-29
最后登录: 2008-09-07
楼主  发表于: 2008-07-30 16:59

 通过NFS启动QQ2440: mount_devfs_fs(): unable to mount devfs, err: -2

管理提醒: 本帖被 kasim 执行加亮操作(2009-10-28)
首先我在linux terminal里面运行如下命令
首先在配置linux主机的NFS系统
[root@friendlyarm /]# gedit /etc/exports
(在出现的对话框中我输入如下共享目录)
/opt/FriendlyARM/QQ2440/root_nfs  *(rw,sync,no_foot_squasq)
(启动端口映射)
[root@friendlyarm /]#  /etc/rc.d/init.d/portmap start
starting portmapper:                  [ok]
[root@friendlyarm /]#  /etc/rc.d/init.d/nfs start
(启动NFS服务))
starting NFS services:                [ok]
starting NFS quotas:                  [ok]
starting NFS daemon:                  [ok]
starting NFS mounted:                 [ok]
再关闭linux的防火墙
[root@friendlyarm /]# /etc/rc.d/init.d/iptables stop
Flushing all chains                   [ok]
Removing user defined chains:         [ok]
Reseting built-in chains to the default ACCEPT policy:   [ok]
然后设定linuX的服务器的IP地址:
[root@friendlyarm /]# ifconfig th0 192.168.1.111
然后再进行回环测试:
[root@friendlyarm /]# mount -t nfs 192.168.1.111:/opt/FriendlyARM/QQ2440/root_nfs /mnt
再查看两个目录下面的内容是否相同
[root@friendlyarm /]# ls /mnt
111  nfs
[root@friendlyarm /]# ls /opt/FriendlyARM/QQ2440/root_nfs
111  nfs
可以看出在主机上配置NFS是对的,下面开始配置目标板上的NFS
(我现在不知道这样是否是在目标板进行配置,下面的配置我是从网上看到后,然后根据自己的目标板配置的,要是有错误,恳请大家改正)

目标板的配置:
首先扫描主机可以使用的目录
[root@friendlyarm /]#  showmount -e 192.168.1.111
Export list for 192.168.1.111:
/opt/FriendlyARM/QQ2440/root_nfs  (everyone)
You have a new mail in /var/spool/mail/nfs/root
然后建立挂载点
[root@friendlyarm /]#  mkdir /mnt/nfs
然后测试是否挂载成功
[root@friendlyarm /]#  mount -t nfs -o nolock 192.168.1.111:/opt/FriendlyARM/QQ2440/root_nfs /mnt/nfs
然后查看
[root@friendlyarm /]# cd /mnt/nfs
[root@friendlyarm /]# ls
111   nfs
到此目标板上NFS 也设置完毕了(我不知道这样以上这样做的命令是否对,希望大家帮忙看看)



然后我在windows下的超级终端下输入
FriendlyARM> param set linux_cmd_line "console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.111:/opt/FriendlyARM/QQ2440/root_nfs ip=192.168.1.70:192.168.1.111:192.168.1.111:255.255.255.0:"
Change linux command line to "console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.111:/opt/FriendlyARM/QQ2440/root_nfs ip=192.168.1.70:192.168.1.111:192.168.1.111:2
55.255.255.0:"
FriendlyARM>
FriendlyARM>boot
然后就出现如下显示:
NET: Registered protocol family 17
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond: at least one card is busy - trying again.
MMC: sd_app_op_cond locked busy. Probably have broken SD-Card.
IP-Config: Complete:
      device=eth0, addr=192.168.1.70, mask=255.255.255.0, gw=192.168.1.111,
     host=192.168.1.70, domain=, nis-domain=(none),
     bootserver=192.168.1.111, rootserver=192.168.1.111, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.111
Looking up port of RPC 100005/1 on 192.168.1.111
VFS: Mounted root (nfs filesystem).
mount_devfs_fs(): unable to mount devfs, err: -2
Freeing init memory: 148K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.


各位高手,希望给出指点啊,我现在不知道错在哪里了?快烦恼死了........
[ 此帖被kasim在2009-10-28 17:12重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2008-07-30 17:18
1. 首先可以肯定的是,NFS已经mount成功了,至少内核是这么认为的,否则你不会看到
VFS: Mounted root (nfs filesystem)

2. 至于为什么无法后续启动文件系统,出错的信息也已经给出了:
mount_devfs_fs(): unable to mount devfs, err: -2
没有devfs,文件系统就无法操作设备,后续的初始化当然就会无法进行

3. 不用我说你也知道下一步该查哪里了吧
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 1169
精华: 0
发帖: 7
金钱: 70 两
威望: 7 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2008-07-29
最后登录: 2008-09-07
2楼  发表于: 2008-07-30 18:07
要是按照你的说法
我还要应该从新配置内核,把新的内核下载下去后
再执行以上的命令么,是这样可以么??
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2008-07-30 18:51
你认为mount_devfs_fs(): unable to mount devfs, err: -2 是内核的问题?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2008-07-30 18:58
引用第3楼kasim于2008-07-30 18:51发表的  :
你认为mount_devfs_fs(): unable to mount devfs, err: -2 是内核的问题?

其实内核本身已经告诉了你出错的原因,你只要稍加分析就可以知道。
根据kernel-2.6.13/include/asm-generic/errno-base.h,

#define    ENOENT        2    /* No such file or directory */

在PC的/opt/FriendlyARM/QQ2440/root_nfs /mnt目录下建一个dev目录让devfs挂载到那里
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 1169
精华: 0
发帖: 7
金钱: 70 两
威望: 7 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2008-07-29
最后登录: 2008-09-07
5楼  发表于: 2008-08-02 20:17
NFS问题解决了啦
我原来原来一直没有办法把板子跑起来,在主机上的回环测试是成功的的但是就是启动不了板子
后来我在把root_nfs.tgz这个文家加压到子的共享目录下后
然后在、eyc/init.d/rcS里面用gedit查看rcS把目标机的设置就可以ok了
呵呵,现在终于能够在目标板上听到上海滩那首歌了啦!!!
上面是运行命令,再加上现在这个就可以了
希望对大家有帮助