block2mtd and ubi
Artem Bityutskiy
dedekind1 at gmail.com
Mon Nov 22 03:12:42 EST 2010
On Sun, 2010-11-21 at 01:01 +0100, Lluís Batlle i Rossell wrote:
> On Sat, Nov 20, 2010 at 06:58:56PM +0100, Lluís Batlle i Rossell wrote:
> > Hello,
> >
> > I'm trying to use the qemu mipsel malta board to boot an ubifs image, prepared
> > with 'ubinize', and using block2mtd on /dev/hda, where qemu receives the image
> > through -hda ubifs.img.
> >
> > The problem I have summarizes in this UBI complain while booting:
> > block2mtd: mtd0: [/dev/hda] erase_size = 512KiB [524288]
> > UBI: attaching mtd0 to ubi0
> > UBI: physical eraseblock size: 524288 bytes (512 KiB)
> > UBI: logical eraseblock size: 524160 bytes
> > UBI: smallest flash I/O unit: 1
> > UBI: VID header offset: 64 (aligned 64)
> > UBI: data offset: 128
> > UBI warning: check_what_we_have: 1008 PEBs are corrupted
> > corrupted PEBs are: 0 1 2 3 4 5 6 7 .....
> > UBI error: check_what_we_have: too many corrupted PEBs, refusing this device
> > UBI error: ubi_init: cannot attach mtd0
> Solved!
>
> The first PEBs were corrupt because I was using 'dd' wrong. Nevertheless,
> filling the rest of image with zeros gave corrupt PEBs on the rest. joer on #mtd
> (oftc irc) helped me suggesting maybe 0xff would work. And appending 0xff
> instead of 0x00 worked great.
>
> It's a pity that the same 'ubinize' cannot do that job automatically, and give
> an image filling all the memory blocks. That would easy down a lot the job for
> block2mtd.
Use ubiformat - it should get it right:
http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd
mailing list