主题 : mount_devfs_fs(): unable to mount devfs, err: -2问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
楼主  发表于: 2009-03-17 21:05

 mount_devfs_fs(): unable to mount devfs, err: -2问题

自己移植了一个linux2.6的内核,用的是yaffs的跟文件系统,启动过程中出现了下列现象:
0x00000000-0x00020000 : "vivi"

0x00020000-0x00040000 : "eboot"

0x00010000-0x00050000 : "param"

0x00200000-0x00250000 : "kernel"

0x03dac000-0x03dd1000 : "root"

mice: PS/2 mouse device common for all mice

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 4096 (order: 2, 16384 bytes)

TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

TCP bic registered

NET: Registered protocol family 1

yaffs: dev is 32505860 name is "mtdblock4"

yaffs: passed flags ""

yaffs: Attempting MTD mount on 31.4, "mtdblock4"

yaffs_read_super: isCheckpointed 0

VFS: Mounted root (yaffs filesystem) readonly.

mount_devfs_fs(): unable to mount devfs, err: -2

Freeing init memory: 92K

Warning: unable to open an initial console.

Failed to execute /linuxrc.  Attempting defaults...

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
由于我用的2.6.14版本已经不再支持devfs文件系统,所以我编译内核之前做了相应的改动。从打印的信息可以看出,mtdblock4已经作为rootfs挂载到了系统中,但是挂载devfs的时候却出现了错误,网上搜索了很多资料,大部分都说NAND_ECC_SOFT改成NAND_ECC_NONE后就可以了,但是我这么做的,还是没有解决问题,哪位高手能帮我分析一下,谢谢!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-03-18 00:18
mount_devfs_fs(): unable to mount devfs, err: -2
说明devfs的挂载点(/dev)目录不存在, 检查一下你用的文件系统镜像里是否有/dev目录
"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: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
2楼  发表于: 2009-03-18 08:28
有这个目录,而且需要在此目录下建立两个设备节点,consol、null,我怀疑是不是yaffs2的问题,虽然挂上了,是不是里面的数据系统不能正确识别。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-03-19 08:03
这是很有可能的.事实上,除了友善之臂提供的Supervivi和2.6.13的内核,我还没找到一套可以用的支持Yaffs的系统
"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: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
4楼  发表于: 2009-03-19 11:38
问题解决了,是没有正确读写跟文件系统,原因是内核分区表的offset 和 size的写反了,造成了从错误的地址去取根文件系统的数据。
级别: 新手上路
UID: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
5楼  发表于: 2009-03-19 11:41
上述问题解决以后,可以进入系统了。还是还有一个问题,VFS: Mounted root (yaffs filesystem) readonly. 这样根文件系统是只读的,我怎么样改变它的只读属性,让它可写,谢谢!
下面是启动的时候超级终端打印的信息。
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":

0x00000000-0x00020000 : "vivi"

0x00020000-0x00040000 : "eboot"

0x00040000-0x00050000 : "param"

0x00050000-0x00250000 : "kernel"

0x00025000-0x03dd1000 : "root"

mice: PS/2 mouse device common for all mice

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 4096 (order: 2, 16384 bytes)

TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

TCP bic registered

NET: Registered protocol family 1

yaffs: dev is 32505860 name is "mtdblock4"

yaffs: Attempting MTD mount on 31.4, "mtdblock4"

block 3309 is bad

Reading data from NAND FLASH without ECC is not recommended

VFS: Mounted root (yaffs filesystem) readonly.

Mounted devfs on /dev

Freeing init memory: 92K

Reading data from NAND FLASH without ECC is not recommended


init started:  BusyBox v1.2.1 (2009.03.18-00:53+0000) multi-call binary

Starting pid 16, console /dev/console: '/etc/init.d/rcS'

Bummer, could not run '/etc/init.d/rcS': Permission denied

Bummer, could not run '/etc/init.d/rcS': Permission denied

Please press Enter to activate this console.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
6楼  发表于: 2009-03-20 00:22
1) 你可以在内核命令行上指定rootfs挂载权限为rw, 比如root=/dev/mtdblock4 rw
2) 在初始化的脚本里把rootfs重新mount为rw, 比如用mount -n -o remount,rw /
"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: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
7楼  发表于: 2009-03-20 21:58
谢谢,问题解决了,是内核分区表中的flag标记设置成了只读属性,把这个属性去掉就可以,一般默认的是可读写的。