* block2mtd and ubi
@ 2010-11-20 17:58 Lluís Batlle i Rossell
2010-11-21 0:01 ` Lluís Batlle i Rossell
0 siblings, 1 reply; 8+ messages in thread
From: Lluís Batlle i Rossell @ 2010-11-20 17:58 UTC (permalink / raw)
To: linux-mtd
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
The ubifs.img file I create first with ubinize, and then I append zeros until it
has the size of 512MiB.
The ubi volume is set to be dynamic and of 256MiB in size (so there should be
plenty of space in the block2mtd mtd0 device)
The kernel commandline I use is
root=ubi0:rootfs rootfstype=ubifs block2mtd.block2mtd=/dev/hda,524288 ubi.mtd=0
I don't know what I am doing bad. Other examples I see on the net seem to do as
I do, and everything works. Not in my case.
Can somebody explain me what I am missing on block2mtd and ubi?
Thank you,
Lluís.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-20 17:58 block2mtd and ubi Lluís Batlle i Rossell
@ 2010-11-21 0:01 ` Lluís Batlle i Rossell
2010-11-22 8:12 ` Artem Bityutskiy
0 siblings, 1 reply; 8+ messages in thread
From: Lluís Batlle i Rossell @ 2010-11-21 0:01 UTC (permalink / raw)
To: linux-mtd
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.
Regards,
Lluís.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-21 0:01 ` Lluís Batlle i Rossell
@ 2010-11-22 8:12 ` Artem Bityutskiy
2010-11-22 9:09 ` Lluís Batlle i Rossell
0 siblings, 1 reply; 8+ messages in thread
From: Artem Bityutskiy @ 2010-11-22 8:12 UTC (permalink / raw)
To: Lluís Batlle i Rossell; +Cc: linux-mtd
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 (Артём Битюцкий)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-22 8:12 ` Artem Bityutskiy
@ 2010-11-22 9:09 ` Lluís Batlle i Rossell
2010-11-22 9:32 ` Artem Bityutskiy
0 siblings, 1 reply; 8+ messages in thread
From: Lluís Batlle i Rossell @ 2010-11-22 9:09 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Lluís Batlle i Rossell, linux-mtd
On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> 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:
> > 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
I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
'ubinize' ubi image.
Regards,
Lluís.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-22 9:09 ` Lluís Batlle i Rossell
@ 2010-11-22 9:32 ` Artem Bityutskiy
2010-11-22 10:00 ` Lluís Batlle i Rossell
0 siblings, 1 reply; 8+ messages in thread
From: Artem Bityutskiy @ 2010-11-22 9:32 UTC (permalink / raw)
To: Lluís Batlle i Rossell; +Cc: linux-mtd
On Mon, 2010-11-22 at 10:09 +0100, Lluís Batlle i Rossell wrote:
> On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> > 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:
> > > 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
>
> I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
> the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
> 'ubinize' ubi image.
Why you can dd buy cannot ubiformat? What is the fundamental difference?
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-22 9:32 ` Artem Bityutskiy
@ 2010-11-22 10:00 ` Lluís Batlle i Rossell
2010-11-22 10:21 ` Artem Bityutskiy
0 siblings, 1 reply; 8+ messages in thread
From: Lluís Batlle i Rossell @ 2010-11-22 10:00 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Lluís Batlle i Rossell, linux-mtd
On Mon, Nov 22, 2010 at 11:32:45AM +0200, Artem Bityutskiy wrote:
> On Mon, 2010-11-22 at 10:09 +0100, Lluís Batlle i Rossell wrote:
> > On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> > > 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:
> > > > 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
> >
> > I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
> > the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
> > 'ubinize' ubi image.
>
> Why you can dd buy cannot ubiformat? What is the fundamental difference?
ubiformat works on a mtd character device, while dd works on a block device.
Maybe ubiformat can work on a 'file'? I think I tried and it did not work.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-22 10:00 ` Lluís Batlle i Rossell
@ 2010-11-22 10:21 ` Artem Bityutskiy
2010-11-22 10:37 ` Lluís Batlle i Rossell
0 siblings, 1 reply; 8+ messages in thread
From: Artem Bityutskiy @ 2010-11-22 10:21 UTC (permalink / raw)
To: Lluís Batlle i Rossell; +Cc: linux-mtd
On Mon, 2010-11-22 at 11:00 +0100, Lluís Batlle i Rossell wrote:
> On Mon, Nov 22, 2010 at 11:32:45AM +0200, Artem Bityutskiy wrote:
> > On Mon, 2010-11-22 at 10:09 +0100, Lluís Batlle i Rossell wrote:
> > > On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> > > > 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:
> > > > > 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
> > >
> > > I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
> > > the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
> > > 'ubinize' ubi image.
> >
> > Why you can dd buy cannot ubiformat? What is the fundamental difference?
> ubiformat works on a mtd character device, while dd works on a block device.
But you can turn a block device into mtd device using block2mtd, so I do
not still see the fundamental difference.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: block2mtd and ubi
2010-11-22 10:21 ` Artem Bityutskiy
@ 2010-11-22 10:37 ` Lluís Batlle i Rossell
0 siblings, 0 replies; 8+ messages in thread
From: Lluís Batlle i Rossell @ 2010-11-22 10:37 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Lluís Batlle i Rossell, linux-mtd
On Mon, Nov 22, 2010 at 12:21:23PM +0200, Artem Bityutskiy wrote:
> On Mon, 2010-11-22 at 11:00 +0100, Lluís Batlle i Rossell wrote:
> > On Mon, Nov 22, 2010 at 11:32:45AM +0200, Artem Bityutskiy wrote:
> > > On Mon, 2010-11-22 at 10:09 +0100, Lluís Batlle i Rossell wrote:
> > > > On Mon, Nov 22, 2010 at 10:12:42AM +0200, Artem Bityutskiy wrote:
> > > > > 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:
> > > > > > 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
> > > >
> > > > I know, but I cannot do that on a block2mtd, if the block2mtd device I use is
> > > > the rootfs of the system. All I have is a kernel, qemu, and a rootfs in a
> > > > 'ubinize' ubi image.
> > >
> > > Why you can dd buy cannot ubiformat? What is the fundamental difference?
> > ubiformat works on a mtd character device, while dd works on a block device.
>
> But you can turn a block device into mtd device using block2mtd, so I do
> not still see the fundamental difference.
That requires root access in the machine, which is something I want to avoid.
And quite a complex setup for the host system:
- make a file of the size I want
- set up a loop device
- load a block2mtd for it
- ubiformat it
- unload block2mtd
- detach loop device
Notice that I use block2mtd as rootfs in a qemu guest passing something like
"-hda flash_image -append blockmtd.blockmtd=/dev/hda". Appending 0xff to the
ubinized image is for me a far easier solution than that above requiring road
access.
Regards,
Lluís.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-11-22 10:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-20 17:58 block2mtd and ubi Lluís Batlle i Rossell
2010-11-21 0:01 ` Lluís Batlle i Rossell
2010-11-22 8:12 ` Artem Bityutskiy
2010-11-22 9:09 ` Lluís Batlle i Rossell
2010-11-22 9:32 ` Artem Bityutskiy
2010-11-22 10:00 ` Lluís Batlle i Rossell
2010-11-22 10:21 ` Artem Bityutskiy
2010-11-22 10:37 ` Lluís Batlle i Rossell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.