[U-Boot] ubifsmount fails after booting linux

Karl Krach mailinglists at blueSpirit.la
Fri Jul 9 17:21:41 CEST 2010


Hello,

the idea is, to give the user a possibility to update its system without tftp
or a second partition. First, the user saves the update file (rootfs.ubifs) to
its rootfs, and on the next reboot the uboot loads the update file to the RAM
and flashes the update file.

Problem: After booting linux once, I cannot mount my ubifs from uboot any
more. (But: On linux it is still working fine...)

I receive once again:
   UBIFS error (pid 0): ubifs_read_node: bad node type
                        (255 but expected 6)
   UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
   Error reading superblock on volume 'ubi:rootfs'!

Best regards,

Charly







U-Boot 2010.03 (Jun 17 2010 - 14:18:23) MPC512X

CPU:   MPC5121e rev. 2.0, Core e300c4 at 400 MHz, CSB at 200 MHz (RSR=0x1003)
Board: ADS5121 rev. 0x0400 (CPLD rev. 0x06)
I2C:   ready
DRAM:  512 MB
FLASH: 64 MB
NAND:  1024 MiB
 [...]


=> mtdparts

device nor0 <fc000000.flash>, # parts = 5
 [...]
device nand0 <mpc5121.nand>, # parts = 1
 #: name		size		offset		mask_flags
 0: ubi-data            0x20000000	0x00000000	0
 [...]


=> ubi part ubi-data

Creating 1 MTD partitions on "nand0":
0x000000000000-0x000020000000 : "mtd=0"
Bad block table found at page 261952, version 0x01
Bad block table found at page 261888, version 0x01
nand_read_bbt: Bad block at 0x000000040000
 [...]
nand_read_bbt: Bad block at 0x00001ffe0000
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd3 to ubi0
UBI: MTD device name:            "mtd=0"
UBI: MTD device size:            512 MiB
UBI: number of good PEBs:        4064
UBI: number of bad PEBs:         32
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 4064
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 6/1


=> tftp rootfs.ubifs

Using FEC ETHERNET device
TFTP from server 10.1.1.83; our IP address is 10.1.1.84
Filename 'rootfs.ubifs'.
Load address: 0x400000
Loading: *
	 ##################################################
         [...]
	 ##################################################
done
Bytes transferred = 22966272 (15e7000 hex)


=> ubi write ${fileaddr} rootfs ${filesize}

Volume "rootfs" found at volume id 0


=> ubifsmount rootfs

UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size:   262821888 bytes (256662 KiB, 250 MiB, 2037 LEBs)
UBIFS: journal size:       9033728 bytes (8822 KiB, 8 MiB, 71 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  0 bytes (0 KiB)


=> ubifsls

<DIR>	     5232  Fri Jul 09 11:54:31 2010  bin
<DIR>	    11344  Fri Jun 25 11:51:19 2010  dev
<DIR>	     1840  Fri Jul 09 11:54:33 2010  etc
<DIR>	     1864  Fri Jul 09 11:54:33 2010  lib
<DIR>	      160  Fri Jun 25 09:42:48 2010  mnt
 [...]
<DIR>	      440  Fri Jun 25 09:42:48 2010  root
<LNK>	       11  Fri Jun 25 10:21:56 2010  linuxrc


=> run flash_ubi

## Booting kernel from Legacy Image at ff900000 ...
 [...]
brd: module loaded
fc000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
fc000000.flash: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
RedBoot partition parsing not available
Creating 5 MTD partitions on "fc000000.flash":
0x000000000000-0x000000040000 : "protected"
0x000000040000-0x000003c40000 : "filesystem"
0x000003c40000-0x000003ec0000 : "kernel"
0x000003ec0000-0x000003f00000 : "device-tree"
0x000003f00000-0x000004000000 : "u-boot"
mpc5121_nfc 40000000.nfc: Configured for 8-bit NAND, page size 2048 with 64
spare.
NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix NAND 512MiB 3,3V
8-bit)
2 NAND chips detected
Creating 1 MTD partitions on "MPC5121 NAND":
0x000000000000-0x000040000000 : "nand"
UBI: attaching mtd5 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd5 to ubi0
UBI: MTD device name:            "nand"
UBI: MTD device size:            1024 MiB
UBI: number of good PEBs:        8140
UBI: number of bad PEBs:         52
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             4035
UBI: total number of reserved PEBs: 4105
UBI: number of PEBs reserved for bad PEB handling: 81
UBI: max/mean erase counter: 7/1
UBI: image sequence number: 0
UBI: background thread "ubi_bgt0d" started, PID 811
Fixed MDIO Bus: probed
 [...]
Starting sshd: OK

Welcome to Buildroot
damian login: root


# ls /

bin      etc      lib      mnt      proc     sbin     tmp      var
dev      home     linuxrc  opt      root     sys      usr

# reboot

# The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to Restarting system.


U-Boot 2010.03 (Jun 17 2010 - 14:18:23) MPC512X

CPU:   MPC5121e rev. 2.0, Core e300c4 at 400 MHz, CSB at 200 MHz (RSR=0x1003)
Board: ADS5121 rev. 0x0400 (CPLD rev. 0x06)
I2C:   ready
DRAM:  512 MB
FLASH: 64 MB
NAND:  1024 MiB
 [...]


=> ubi part uib-data

incorrect device type in uib-data
Partition uib-data not found!
=> ubi part ubi-data
Creating 1 MTD partitions on "nand0":
0x000000000000-0x000020000000 : "mtd=0"
Bad block table found at page 261952, version 0x01
Bad block table found at page 261888, version 0x01
nand_read_bbt: Bad block at 0x000000040000
 [...]
nand_read_bbt: Bad block at 0x00001ffe0000
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd3 to ubi0
UBI: MTD device name:            "mtd=0"
UBI: MTD device size:            512 MiB
UBI: number of good PEBs:        4064
UBI: number of bad PEBs:         32
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 4064
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 7/1


=> ubifsmount rootfs


UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 6)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
Error reading superblock on volume 'ubi:rootfs'!





More information about the U-Boot mailing list