Skip to contentSkip to conversation

mount ubi volume fails: No such device

DISCUSSION Lars Michael 2 participants 5 messages Feb 9, 2011 – Feb 14, 2011 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Lars Michael
Quoted 1 line

UBI: scrubbed PEB 863, data moved to PEB 1097 UBI warning:

ubi_eba_copy_leb: read data back from PEB 1092 and it is different UBI
error: wear_leveling_worker: error -22 while moving PEB 868 to PEB 1092 UBI warning: ubi_ro_mode: switch to read-only mode UBI error: do_work:
work failed with error code -22 UBI error: ubi_thread: ubi_bgt0d: work failed with error code -22

Quoted 6 lines

It says you that it wrote some date, then read it back, compared, and the data did not match. You need to start with validating your falash drivers - use mtd tests:

http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests

The speedtest, stresstest, readtest, pagetest ran ok, but showing 1 bad eraseblock. I guess that is acceptable?

The oobtest and subpagetest found 3 errors, see below. Does it explain my initial problem?

=================================================
mtd_oobtest: MTD device: 0
mtd_oobtest: MTD device size 1048576, eraseblock size 131072, page size 2048, count of eraseblocks 8, pages per eraseblock 64, OOB size 64
mtd_oobtest: scanning for bad eraseblocks
mtd_oobtest: block 0 is bad
mtd_oobtest: scanned 8 eraseblocks, 1 are bad
mtd_oobtest: test 1 of 5
mtd_oobtest: erasing whole device
mtd_oobtest: erased 8 eraseblocks
mtd_oobtest: writing OOBs of whole device
mtd_oobtest: written 8 eraseblocks
mtd_oobtest: verifying all eraseblocks
mtd_oobtest: error: verify failed at 0xa0000
mtd_oobtest: verified 8 eraseblocks
mtd_oobtest: test 2 of 5
mtd_oobtest: erasing whole device
mtd_oobtest: erased 8 eraseblocks
mtd_oobtest: writing OOBs of whole device
mtd_oobtest: written 8 eraseblocks
mtd_oobtest: verifying all eraseblocks
mtd_oobtest: verified 8 eraseblocks
mtd_oobtest: test 3 of 5
mtd_oobtest: erasing whole device
mtd_oobtest: erased 8 eraseblocks
mtd_oobtest: writing OOBs of whole device
mtd_oobtest: written 8 eraseblocks
mtd_oobtest: verifying all eraseblocks
mtd_oobtest: verified 8 eraseblocks
mtd_oobtest: test 4 of 5
mtd_oobtest: erasing whole device
mtd_oobtest: erased 8 eraseblocks
mtd_oobtest: attempting to start write past end of OOB
mtd_oobtest: an error is expected...
mtd_oobtest: error occurred as expected
mtd_oobtest: attempting to start read past end of OOB
mtd_oobtest: an error is expected...
mtd_oobtest: error occurred as expected
mtd_oobtest: attempting to write past end of device
mtd_oobtest: an error is expected...
mtd_oobtest: error occurred as expected
mtd_oobtest: attempting to read past end of device
mtd_oobtest: an error is expected...
mtd_oobtest: error: read past end of device
mtd_oobtest: attempting to write past end of device
mtd_oobtest: an error is expected...
mtd_oobtest: error occurred as expected
mtd_oobtest: attempting to read past end of device
mtd_oobtest: an error is expected...
mtd_oobtest: error: read past end of device
mtd_oobtest: test 5 of 5
mtd_oobtest: erasing whole device
mtd_oobtest: erased 8 eraseblocks
mtd_oobtest: writing OOBs of whole device
mtd_oobtest: written 7 eraseblocks
mtd_oobtest: verifying all eraseblocks
mtd_oobtest: verified 7 eraseblocks
mtd_oobtest: finished with 3 errors
=================================================
=================================================
mtd_subpagetest: MTD device: 0
mtd_subpagetest: MTD device size 1048576, eraseblock size 131072, page size 2048, subpage size 2048, count of eraseblocks 0, pages per eraseblock 0, OOB size 64
mtd_subpagetest: scanning for bad eraseblocks
mtd_subpagetest: block 0 is bad
mtd_subpagetest: scanned 8 eraseblocks, 1 are bad
mtd_subpagetest: erasing whole device
mtd_subpagetest: erased 8 eraseblocks
mtd_subpagetest: writing whole device
mtd_subpagetest: written 8 eraseblocks
mtd_subpagetest: verifying all eraseblocks
mtd_subpagetest: error: verify failed at 0xa0000
mtd_subpagetest: ------------- written----------------
290a823d1a832f294f3a152962dc06ad94bbe2a0556a0c65921a9092c1b7106f
<cut>
0d4441159c41f58ff943fe9fc93847c9f6d46b283a2b27736d1381b18f37b4bc
mtd_subpagetest: -------------------------------------
mtd_subpagetest: verified 8 eraseblocks
mtd_subpagetest: erasing whole device
mtd_subpagetest: erased 8 eraseblocks
mtd_subpagetest: verifying all eraseblocks for 0xff
mtd_subpagetest: verified 8 eraseblocks
mtd_subpagetest: writing whole device
mtd_subpagetest: written 8 eraseblocks
mtd_subpagetest: verifying all eraseblocks
mtd_subpagetest: error: verify failed at 0x40000
mtd_subpagetest: error: verify failed at 0xc0000
mtd_subpagetest: verified 8 eraseblocks
mtd_subpagetest: erasing whole device
mtd_subpagetest: erased 8 eraseblocks
mtd_subpagetest: verifying all eraseblocks for 0xff
mtd_subpagetest: verified 8 eraseblocks
mtd_subpagetest: finished with 3 errors
=================================================

#1 lore raw
Quoted 12 lines · Lars Michael
Quoted 12 lines · Lars Michael
Quoted 1 line

UBI: scrubbed PEB 863, data moved to PEB 1097 UBI warning:

ubi_eba_copy_leb: read data back from PEB 1092 and it is different UBI
error: wear_leveling_worker: error -22 while moving PEB 868 to PEB 1092 UBI warning: ubi_ro_mode: switch to read-only mode UBI error: do_work:
work failed with error code -22 UBI error: ubi_thread: ubi_bgt0d: work failed with error code -22

It says you that it wrote some date, then read it back, compared, and the data did not match. You need to start with validating your falash drivers - use mtd tests:

Quoted 5 lines
Quoted 2 lines

http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests

The speedtest, stresstest, readtest, pagetest ran ok, but showing 1 bad eraseblock. I guess that is acceptable?

Yes.

Quoted 2 lines

The oobtest and subpagetest found 3 errors, see below. Does it explain my initial problem?

Yes. You cannot go forward with UBIFS before you have fixed those. Esepcially subpage test is relevant to you, you really have to have it fixed, or you can just ask UBIFS to not use sub-pages and see how it behaves, but this is less optimal.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#2 lore raw
Quoted 5 lines · Artem Bityutskiy
Quoted 2 lines

The oobtest and subpagetest found 3 errors, see below.

Does it explain

Quoted 1 line

my initial problem?

Quoted 8 lines

Yes. You cannot go forward with UBIFS before you have fixed those.
Esepcially subpage test is relevant to you, you really have to have it
fixed, or you can just ask UBIFS to not use sub-pages and see how it
behaves, but this is less optimal.

I am running on the TWR-MCF5441X eval. board, which has a 256MB NAND device: MT29F2G16AADWP. From the data sheet it should have no sub pages, and this matches what UBI reports:

UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096

# cat proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 0ff00000 00020000 "ubi"
mtd2: 00100000 00010000 "at26df081a"

I used ubiformat without the -s or -O:
ubiformat /dev/mtd1 -f /root/ubi.img

I tried with -O 2048, but still failed. I guess forcing the VID header to offset 2048 is anyway correct for this device? Are there another way to turn off sub-page in UBIFS?

Here is how i made the UBI image:
./mkfs.ubifs -m 2048 -e 126976 -c 874 -v -Q -r ./rootfs rootfs.img ./mkfs.ubifs -m 2048 -e 126976 -c 36 -v -Q -r ./progfs progfs.img ./mkfs.ubifs -m 2048 -e 126976 -c 49 -v -Q -r ./datafs datafs.img ubinize -o ubi.img -p 128KiB -m 2048 -v ubi-config.ini

Now i rebuild the kernel with additional debug options turned on. Will run subpage test again and submit report on that.

Thanks and regards,
- Lars

#3 lore raw
Quoted 5 lines · Lars Michael

Here is how i made the UBI image:
./mkfs.ubifs -m 2048 -e 126976 -c 874 -v -Q -r ./rootfs rootfs.img ./mkfs.ubifs -m 2048 -e 126976 -c 36 -v -Q -r ./progfs progfs.img ./mkfs.ubifs -m 2048 -e 126976 -c 49 -v -Q -r ./datafs datafs.img ubinize -o ubi.img -p 128KiB -m 2048 -v ubi-config.ini

You also need to give this parameter to UBI:
vid_hdr_offs=2048

I.e., modprobe ubi mtd=1 vid_hdr_offs=2048

Or if UBI is compiled-in, boot with the following kernel argument:

ubi.vid_hdr_offs=2048

With this option UBI will not use sub-pages at all. I think it makes sense for you to try how it works this way.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#4 lore raw
Quoted 22 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>
Subject: Re: mount ubi volume fails: No such device
To: "Lars Michael" <[email protected]>
Cc: [email protected]
Date: Monday, 14 February, 2011, 12:01

Quoted 2 lines · Lars Michael

Here is how i made the UBI image:
./mkfs.ubifs -m 2048 -e 126976 -c 874 -v -Q -r

./rootfs rootfs.img

Quoted 1 line

./mkfs.ubifs -m 2048 -e 126976 -c 36 -v -Q -r ./progfs

progfs.img

Quoted 1 line

./mkfs.ubifs -m 2048 -e 126976 -c 49 -v -Q -r ./datafs

datafs.img

Quoted 1 line

ubinize -o ubi.img -p 128KiB -m 2048 -v

ubi-config.ini

You also need to give this parameter to UBI:
vid_hdr_offs=2048

I.e., modprobe ubi mtd=1 vid_hdr_offs=2048

Quoted 9 lines

Or if UBI is compiled-in, boot with the following kernel argument:

ubi.vid_hdr_offs=2048

With this option UBI will not use sub-pages at all. I think it makes
sense for  you to try how it works this way.

I believe this is the correct syntax:

[root@M54418TWR /]# insmod ubi mtd=1,2048
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19
insmod: cannot insert '/lib/modules/2.6.29/kernel/drivers/mtd/ubi/ubi.ko': No such device

Unfortunately, booting Linux the NAND flash is now detected bad, so I do not have an mtd1! what is the best way to try to recover? I do not understand how the flash can suddenly become bad!

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit) Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad eraseblock 0 at 0x000000000000
Bad eraseblock 1 at 0x000000020000
Bad eraseblock 2 at 0x000000040000
Bad eraseblock 3 at 0x000000060000
Bad eraseblock 4 at 0x000000080000
Bad eraseblock 5 at 0x0000000a0000
Bad eraseblock 6 at 0x0000000c0000
<cut>
Bad eraseblock 2046 at 0x00000ffc0000
Bad eraseblock 2047 at 0x00000ffe0000
No space left to write bad block table
fsl_nfc: NAND Flash not found !
m25p80 spi1.1: at26df081a (1024 Kbytes)
Creating 1 MTD partitions on "Atmel at26df081a SPI Flash chip":
0x000000000000-0x000000100000 : "at26df081a"
DSPI: Coldfire master initialized
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

Thanks and regards,
- Lars