Corrupted UBIFS, bad CRC
Karsten Jeppesen
arm9263 at yahoo.com
Thu Jan 12 09:31:40 EST 2012
Hi again,
Maybe I should include all info you require, but sometimes the brain is slower than the right pinkie....
...
* run the MTD tests to validate your flash
Done - nothing to report
* enable the UBIFS extra self checks and try to reproduce the problem.
Not possible ???
# echo 3 > /sys/module/ubifs/
uevent version
... no parameters folder
* make sure you use up-to-date UBIFS
Sorry - best I can do right now is the 3.2.0 kernel. Is that ok?
* make sure you have compiled the kernel symbols in
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
* mark the Enable debugging support
CONFIG_UBIFS_FS=y
# CONFIG_UBIFS_FS_XATTR is not set
# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_DEBUG=y
* include all the messages UBIFS prints
# dmesg -n8
# ubiattach /dev/ubi_ctrl -m 4
UBI: attaching mtd4 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 130944 bytes
UBI: smallest flash I/O unit: 1
UBI: VID header offset: 64 (aligned 64)
UBI: data offset: 128
UBI: max. sequence number: 17653
UBI: attached mtd4 to ubi0
UBI: MTD device name: "User"
UBI: MTD device size: 28 MiB
UBI: number of good PEBs: 230
UBI: number of bad PEBs: 0
UBI: number of corrupted PEBs: 0
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: 230
UBI: number of PEBs reserved for bad PEB handling: 0
UBI: max/mean erase counter: 31/5
UBI: image sequence number: 1704669600
UBI: background thread "ubi_bgt0d" started, PID 6374
UBI device number 0, total 230 LEBs (30117120 bytes, 28.7 MiB), available 0 LEBs (0 bytes), LEB size 130944 bytes (127.9 KiB)
# mkdir -p /skov/mnt/rootfs
# mount -t ubifs ubi0:rootfs /skov/mnt/rootfs
UBIFS: recovery needed
UBIFS error (pid 6700): ubifs_recover_leb: corrupt empty space LEB 4:0, corruption starts at 144
UBIFS error (pid 6700): ubifs_scanned_corruption: corruption at LEB 4:144
UBIFS error (pid 6700): ubifs_scanned_corruption: first 8192 bytes from LEB 4:144
00000000: 00000000 00000000 00000000 00000000 ffffffff ffffffff ffffffff ffffffff ................................
00000020: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ................................
...many lines of ffffff
00001fc0: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ................................
00001fe0: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ................................
UBIFS error (pid 6700): ubifs_recover_leb: LEB 4 scanning failed
mount: mounting ubi0:rootfs on /skov/mnt/rootfs failed: Structure needs cleaning
#
* explicitly tell about whether you did any checking
The UBI config looks like this:
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_RESERVE=1
# CONFIG_MTD_UBI_GLUEBI is not set
# CONFIG_MTD_UBI_DEBUG is not set
* describe your flash device
# mtdinfo -a
Count of MTD devices: 5
Present MTD devices: mtd0, mtd1, mtd2, mtd3, mtd4
Sysfs interface supported: yes
mtd0
Name: u-boot
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 3 (393216 bytes, 384.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:0
Bad blocks are allowed: false
Device is writable: true
mtd1
Name: Env
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 1 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:2
Bad blocks are allowed: false
Device is writable: true
mtd2
Name: Linux
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 16 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:4
Bad blocks are allowed: false
Device is writable: true
mtd3
Name: Bmp_Image
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 6 (786432 bytes, 768.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:6
Bad blocks are allowed: false
Device is writable: true
mtd4
Name: User
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 230 (30146560 bytes, 28.8 MiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Character device major/minor: 90:8
Bad blocks are allowed: false
Device is writable: true
* describe how the problem can be reproduced
I have 16 machines running powercycle 20secs-on 3secs-off. In 24 hrs roughly 2 will fail this way.
Now I think I have added all I could think of.
Sincerely,
Dr. Karsten Jeppesen
More information about the linux-mtd
mailing list