打印
[嵌入式Linux]

ubifs根文件系统起不来

[复制链接]
8533|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zifenglin|  楼主 | 2013-9-15 16:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
nandflash是k9F1208U0c  mkfs.ubifs -r rootfs -m 512 -e 15872 -c 4096 -o ubifs.img
ubinize -o ubi.img -m 512 -p 16KiB -s 256 ubinize.cfg


[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=62MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize






setenv bootargs console=ttyS0,115200n8 ubi.mtd=5 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc rw  


device nand0 <nandflash0>, # parts = 6
#: name                size            offset          mask_flags
0: At91strap           0x00020000      0x00000000      0
1: uboot               0x00060000      0x00020000      0
2: env1                0x00010000      0x00080000      0
3: env2                0x00010000      0x00090000      0
4: kernel              0x00200000      0x000a0000      0
5: root                0x03d60000      0x002a0000      0   




求大家能指点一下?


  
AT91 NAND: 8-bit, Software ECC
Scanning device for bad blocks
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap"
0x000000020000-0x000000080000 : " uboot "
0x000000080000-0x000000090000 : "uboot env1"
0x000000090000-0x0000000a0000 : "uboot env2"
0x0000000a0000-0x0000002a0000 : "linux"
0x0000002a0000-0x000004000000 : "rootfs"
UBI: attaching mtd5 to ubi0
UBI: physical eraseblock size:   16384 bytes (16 KiB)
UBI: logical eraseblock size:    15872 bytes
UBI: smallest flash I/O unit:    512
UBI: sub-page size:              256
UBI: VID header offset:          256 (aligned 256)
UBI: data offset:                512
UBI: max. sequence number:       0
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd5
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (20:00:00:00:00:00)
eth0: attached PHY driver [LXT971] (mii_bus:phy_addr=ffffffff:01, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
rtc-pcf8563 0-0051: chip found, driver version 0.4.3
rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
i2c /dev entries driver
Max706 Watchdog Timer (timeout = 1sec,, nowayout)
TCP cubic registered
NET: Registered protocol family 17
rtc-pcf8563 0-0051: pcf8563_get_datetime: read error
rtc-pcf8563 0-0051: hctosys: unable to read the harsware cloc
VFS: Cannot open root device "ubi0_0" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             128 mtdblock0  (driver?)
1f01             384 mtdblock1  (driver?)
1f02              64 mtdblock2  (driver?)
1f03              64 mtdblock3  (driver?)
1f04            2048 mtdblock4  (driver?)
1f05           62848 mtdblock5  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c002f0dc>] (unwind_backtrace+0x0/0xe0) from [<c0214d8c>] (panic+0x50/0x174)
[<c0214d8c>] (panic+0x50/0x174) from [<c0008ec0>] (mount_block_root+0x234/0x284)


[<c0008ec0>] (mount_block_root+0x234/0x284) from [<c0008ff8>] (prepare_namespace
+0x88/0x180)
[<c0008ff8>] (prepare_namespace+0x88/0x180) from [<c0008b48>] (kernel_init+0x108
/0x148)
[<c0008b48>] (kernel_init+0x108/0x148) from [<c002accc>] (kernel_thread_exit+0x0
/0x8)

相关帖子

沙发
jlass| | 2013-9-16 08:38 | 只看该作者
从你的打印来看,文件系统根本没有mount成功
不过这种原因实在是太多了,根本给不了答案

使用特权

评论回复
板凳
zifenglin|  楼主 | 2013-9-16 09:10 | 只看该作者
jlass 发表于 2013-9-16 08:38
从你的打印来看,文件系统根本没有mount成功
不过这种原因实在是太多了,根本给不了答案 ...

网上好像有说 制作镜像的时候 最大擦除快 可以设置的小点,请问 -c 后的参数是可以随意设置的吗, 还是nandflash 所以快的数目。

使用特权

评论回复
地板
//YZC| | 2013-9-16 11:43 | 只看该作者
内核使用了Software ECC?烧写UBIFS时是否通过Uboot?Uboot是否用的Software ECC?Uboot的Software ECC算法是否与内核Software ECC一致?。。。建议楼主直接内核不使用ECC

使用特权

评论回复
5
ymind| | 2013-9-16 14:08 | 只看该作者
使用了UBI的subpage in 256字节,Software ECC看上去也是256字节的粒度。确认一下。

< UBI error: vtbl_check: volume table check failed: record 0, error 9
good PEBs 太少?在bootargs里多加一个debug,再看看内核输出信息。mkfs.ubifs -v; ubinize -v,也看看输出。
当然,先用同一个内核烧写你的ubi.img (flash_eraseall /dev/mtd5; nandwrite -p /dev/mtd5 ubi.img)

使用特权

评论回复
6
zifenglin|  楼主 | 2013-9-17 17:02 | 只看该作者
//YZC 发表于 2013-9-16 11:43
内核使用了Software ECC?烧写UBIFS时是否通过Uboot?Uboot是否用的Software ECC?Uboot的Software ECC算法 ...

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38 (root@ubuntu) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03
-41) ) #2 Tue Sep 17 00:20:50 PDT 2013
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 200 MHz, master 100 MHz, main 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 root=ubi0:rootfs mtdparts=atmel_nand:1
28k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(rootfs) rw
rootfstype=ubifs
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61896k/61896k available, 3640k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc4800000 - 0xfee00000   ( 934 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0024000   ( 112 kB)
      .text : 0xc0024000 - 0xc02c685c   (2699 kB)
      .data : 0xc02c8000 - 0xc02e6000   ( 120 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 99.73 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
max706: Work on CS_PIN:105  DI_PIN:100 -1070798512
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
atmel_usart.4: ttyS4 at MMIO 0xfffd0000 (irq = 23) is a ATMEL_SERIAL
GPIO: PB17 PB18 PB19
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
AT91 NAND: 8-bit, No ECC
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
6 cmdlinepart partitions found on MTD device atmel_nand
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap"
0x000000020000-0x000000060000 : "uboot"
0x000000060000-0x000000080000 : "env1"
0x000000080000-0x0000000a0000 : "env2"
0x0000000a0000-0x0000002a0000 : "linux"
0x0000002a0000-0x000004000000 : "rootfs"
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (20:00:00:00:00:00)
eth0: attached PHY driver [LXT971] (mii_bus:phy_addr=ffffffff:01, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
rtc-pcf8563 0-0051: chip found, driver version 0.4.3
rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
i2c /dev entries driver
Max706 Watchdog Timer (timeout = 1sec,, nowayout)
TCP cubic registered
NET: Registered protocol family 17
rtc-pcf8563 0-0051: pcf8563_get_datetime: read error
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             128 mtdblock0  (driver?)
1f01             256 mtdblock1  (driver?)
1f02             128 mtdblock2  (driver?)
1f03             128 mtdblock3  (driver?)
1f04            2048 mtdblock4  (driver?)
1f05           62848 mtdblock5  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c002f0dc>] (unwind_backtrace+0x0/0xe0) from [<c0214d8c>] (panic+0x50/0x174)
[<c0214d8c>] (panic+0x50/0x174) from [<c0008ec0>] (mount_block_root+0x234/0x284)

[<c0008ec0>] (mount_block_root+0x234/0x284) from [<c0008ff8>] (prepare_namespace
+0x88/0x180)
[<c0008ff8>] (prepare_namespace+0x88/0x180) from [<c0008b48>] (kernel_init+0x108
/0x148)
[<c0008b48>] (kernel_init+0x108/0x148) from [<c002accc>] (kernel_thread_exit+0x0
/0x8)


去掉ECC后

使用特权

评论回复
7
//YZC| | 2013-9-17 17:30 | 只看该作者
zifenglin 发表于 2013-9-17 17:02
Starting kernel ...

Uncompressing Linux... done, booting the kernel.

这次的打印信息跟上次不一致,是否重新配置过内核?打印完MTD分区信息后应该会出现UBI的信息,而新的这次没有出现,是否配置内核时没有加入UBIFS的支持?

使用特权

评论回复
8
zifenglin|  楼主 | 2013-9-17 20:13 | 只看该作者
//YZC 发表于 2013-9-17 17:30
这次的打印信息跟上次不一致,是否重新配置过内核?打印完MTD分区信息后应该会出现UBI的信息,而新的这次 ...

内核没有变化 只是在bootargs 中多加了 init=/linuxrc rw

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38 (root@ubuntu) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03
-41) ) #3 Tue Sep 17 04:53:54 PDT 2013
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 200 MHz, master 100 MHz, main 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 root=ubi0.rootfs ubi.mtd=5 rootfstype=
ubifs init=/linuxrc rw
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61896k/61896k available, 3640k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc4800000 - 0xfee00000   ( 934 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0024000   ( 112 kB)
      .text : 0xc0024000 - 0xc02c685c   (2699 kB)
      .data : 0xc02c8000 - 0xc02e6000   ( 120 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 99.73 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
max706: Work on CS_PIN:105  DI_PIN:100 -1070798512
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
atmel_usart.4: ttyS4 at MMIO 0xfffd0000 (irq = 23) is a ATMEL_SERIAL
GPIO: PB17 PB18 PB19
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
AT91 NAND: 8-bit, No ECC
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap"
0x000000020000-0x000000080000 : " uboot "
0x000000080000-0x000000090000 : "uboot env1"
0x000000090000-0x0000000a0000 : "uboot env2"
0x0000000a0000-0x0000002a0000 : "linux"
0x0000002a0000-0x000004000000 : "rootfs"
UBI: attaching mtd5 to ubi0
UBI: physical eraseblock size:   16384 bytes (16 KiB)
UBI: logical eraseblock size:    15360 bytes
UBI: smallest flash I/O unit:    512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                1024
UBI error: validate_ec_hdr: bad VID header offset 256, expected 512
UBI error: validate_ec_hdr: bad EC header
UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0
UBI error: ubi_init: cannot attach mtd5
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (20:00:00:00:00:00)
eth0: attached PHY driver [LXT971] (mii_bus:phy_addr=ffffffff:01, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
rtc-pcf8563 0-0051: chip found, driver version 0.4.3
rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
i2c /dev entries driver
Max706 Watchdog Timer (timeout = 1sec,, nowayout)
TCP cubic registered
NET: Registered protocol family 17
rtc-pcf8563 0-0051: pcf8563_get_datetime: read error
rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
List of all partitions:
1f00             128 mtdblock0  (driver?)
1f01             384 mtdblock1  (driver?)
1f02              64 mtdblock2  (driver?)
1f03              64 mtdblock3  (driver?)
1f04            2048 mtdblock4  (driver?)
1f05           62848 mtdblock5  (driver?)
No filesystem could mount root, tried:  ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c002f0dc>] (unwind_backtrace+0x0/0xe0) from [<c0214d8c>] (panic+0x50/0x174)
[<c0214d8c>] (panic+0x50/0x174) from [<c0008ec0>] (mount_block_root+0x234/0x284)

[<c0008ec0>] (mount_block_root+0x234/0x284) from [<c0008ff8>] (prepare_namespace
+0x88/0x180)
[<c0008ff8>] (prepare_namespace+0x88/0x180) from [<c0008b48>] (kernel_init+0x108
/0x148)
[<c0008b48>] (kernel_init+0x108/0x148) from [<c002accc>] (kernel_thread_exit+0x0
/0x8)

使用特权

评论回复
9
zifenglin|  楼主 | 2013-9-17 21:20 | 只看该作者
ymind 发表于 2013-9-16 14:08
使用了UBI的subpage in 256字节,Software ECC看上去也是256字节的粒度。确认一下。

< UBI error: vtbl_ch ...

谢谢 的确是参数的问题

使用特权

评论回复
10
ymind| | 2013-9-17 21:27 | 只看该作者
//YZC 发表于 2013-9-17 17:30
这次的打印信息跟上次不一致,是否重新配置过内核?打印完MTD分区信息后应该会出现UBI的信息,而新的这次 ...

其实是没传ubi.mtd=5

使用特权

评论回复
11
ymind| | 2013-9-17 21:32 | 只看该作者
zifenglin 发表于 2013-9-17 20:13
内核没有变化 只是在bootargs 中多加了 init=/linuxrc rw

Uncompressing Linux... done, booting the ke ...

看来256 subpage不支持。试试512的。
mkfs.ubifs -r rootfs -m 512 -e 15360 -c 4096 -o ubifs.img
ubinize -o ubi.img -m 512 -p 16KiB -s 512 ubinize.cfg

使用特权

评论回复
12
//YZC| | 2013-9-18 14:32 | 只看该作者
ymind 发表于 2013-9-17 21:32
看来256 subpage不支持。试试512的。
mkfs.ubifs -r rootfs -m 512 -e 15360 -c 4096 -o ubifs.img
ubini ...

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

34

帖子

1

粉丝