linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MTD : cannot reserve enough PEBs for bad PEB handling
@ 2013-04-22  9:38 Mark Jackson
  2013-04-22  9:41 ` Mark Jackson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Jackson @ 2013-04-22  9:38 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: dedekind1, linux-omap@vger.kernel.org, lkml

I'm trying to work out how to generate a "valid" UBI image, but I keep
getting a "cannot get enough PEBs" warning.

I generate my image (destined for a 64MB NAND partition) using:-

$ mkfs.ubifs -d output/target -e 0x1f000 -c 483 -m 0x800 -x none -F -o
output/images/rootfs.ubifs
$ ubinize -o output/images/rootfs.ubi -m 0x800 -p 0x20000 -s 512 -O 2048
ubinize.cfg

My .cfg file is:-

[ubifs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
vol_flags=autoresize
vol_size=61MiB
image=output/images/rootfs.ubifs

And the resulting image is:-

-rw-rw-r-- 1 mpfj mpfj 9437184 Apr 16 10:19 rootfs.ubi

This is then written to a freshly erased 64MB NAND partition, and
appears to mount correctly, apart from the warning about not enough
reserved PEBs, as follows:-

...
[    0.792456] UBI: attaching mtd7 to ubi0
[    1.540858] UBI: scanning is finished
[    1.557578] UBI warning: print_rsvd_warning: cannot reserve enough
PEBs for bad PEB handling, reserved 4, need 40
[    1.561346] UBI: attached mtd7 (name "rootfs", size 64 MiB) to ubi0
[    1.561404] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    1.561434] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    1.561464] UBI: VID header offset: 2048 (aligned 2048), data offset:
4096
[    1.561493] UBI: good PEBs: 512, bad PEBs: 0, corrupted PEBs: 0
[    1.561520] UBI: user volume: 1, internal volumes: 1, max. volumes
count: 128
[    1.561554] UBI: max/mean erase counter: 2/1, WL threshold: 4096,
image sequence number: 1434266085
[    1.561591] UBI: available PEBs: 0, total reserved PEBs: 512, PEBs
reserved for bad PEB handling: 4
[    1.562374] UBI: background thread "ubi_bgt0d" started, PID 598
...

I think I've calculated the various option values correctly for
mkfs.ubifs and ubinize.

But since I'm getting the warning, can anyone explain where I've gone
wrong ?

Thanks in advance
Mark J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MTD : cannot reserve enough PEBs for bad PEB handling
  2013-04-22  9:38 MTD : cannot reserve enough PEBs for bad PEB handling Mark Jackson
@ 2013-04-22  9:41 ` Mark Jackson
  2013-04-23  8:31 ` MTD : cannot reserve enough PEBs for bad PEB handling [SOLVED] Mark Jackson
  2013-05-15  7:55 ` MTD : cannot reserve enough PEBs for bad PEB handling Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Jackson @ 2013-04-22  9:41 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: dedekind1, linux-omap@vger.kernel.org, lkml

On 22/04/13 10:38, Mark Jackson wrote:
> I'm trying to work out how to generate a "valid" UBI image, but I keep
> getting a "cannot get enough PEBs" warning.

<snip>

> ...
> [    0.792456] UBI: attaching mtd7 to ubi0
> [    1.540858] UBI: scanning is finished
> [    1.557578] UBI warning: print_rsvd_warning: cannot reserve enough
> PEBs for bad PEB handling, reserved 4, need 40
> [    1.561346] UBI: attached mtd7 (name "rootfs", size 64 MiB) to ubi0
> [    1.561404] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> [    1.561434] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
> [    1.561464] UBI: VID header offset: 2048 (aligned 2048), data offset:
> 4096
> [    1.561493] UBI: good PEBs: 512, bad PEBs: 0, corrupted PEBs: 0
> [    1.561520] UBI: user volume: 1, internal volumes: 1, max. volumes
> count: 128
> [    1.561554] UBI: max/mean erase counter: 2/1, WL threshold: 4096,
> image sequence number: 1434266085
> [    1.561591] UBI: available PEBs: 0, total reserved PEBs: 512, PEBs
> reserved for bad PEB handling: 4
> [    1.562374] UBI: background thread "ubi_bgt0d" started, PID 598
> ...

And some additional UBI messages I failed to copy in:-

...
[    1.728485] UBIFS: recovery needed
[    1.824972] UBIFS: recovery deferred
[    1.825553] UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O
mode
[    1.825595] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O
unit sizes: 2048 bytes/2048 bytes
[    1.825638] UBIFS: FS size: 60059648 bytes (57 MiB, 473 LEBs),
journal size 7999488 bytes (7 MiB, 63 LEBs)
[    1.825677] UBIFS: reserved for root: 0 bytes (0 KiB)
[    1.825711] UBIFS: media format: w4/r0 (latest is w4/r0), UUID
93286679-C044-4BC4-8FCB-6E5055E65825, small LPT model
[    2.088284] UBIFS: completing deferred recovery
[    2.204405] UBIFS: background thread "ubifs_bgt0_0" started, PID 613
[    2.206118] UBIFS: deferred recovery completed

Cheers
Mark J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MTD : cannot reserve enough PEBs for bad PEB handling [SOLVED]
  2013-04-22  9:38 MTD : cannot reserve enough PEBs for bad PEB handling Mark Jackson
  2013-04-22  9:41 ` Mark Jackson
@ 2013-04-23  8:31 ` Mark Jackson
  2013-05-15  7:55 ` MTD : cannot reserve enough PEBs for bad PEB handling Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Jackson @ 2013-04-23  8:31 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: linux-omap@vger.kernel.org, lkml, dedekind1

On 22/04/13 10:38, Mark Jackson wrote:
> I'm trying to work out how to generate a "valid" UBI image, but I keep
> getting a "cannot get enough PEBs" warning.
> 
> I generate my image (destined for a 64MB NAND partition) using:-
> 
> $ mkfs.ubifs -d output/target -e 0x1f000 -c 483 -m 0x800 -x none -F -o
> output/images/rootfs.ubifs
> $ ubinize -o output/images/rootfs.ubi -m 0x800 -p 0x20000 -s 512 -O 2048
> ubinize.cfg
> 
> My .cfg file is:-
> 
> [ubifs]
> mode=ubi
> vol_id=0
> vol_type=dynamic
> vol_name=rootfs
> vol_alignment=1
> vol_flags=autoresize
> vol_size=61MiB

I just removed this vol_size entry and it all seems to be fine now.

I guess this was too big ??

Mark J.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MTD : cannot reserve enough PEBs for bad PEB handling
  2013-04-22  9:38 MTD : cannot reserve enough PEBs for bad PEB handling Mark Jackson
  2013-04-22  9:41 ` Mark Jackson
  2013-04-23  8:31 ` MTD : cannot reserve enough PEBs for bad PEB handling [SOLVED] Mark Jackson
@ 2013-05-15  7:55 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2013-05-15  7:55 UTC (permalink / raw)
  To: Mark Jackson
  Cc: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, lkml

On Mon, 2013-04-22 at 10:38 +0100, Mark Jackson wrote:
> I'm trying to work out how to generate a "valid" UBI image, but I keep
> getting a "cannot get enough PEBs" warning.
> 
> I generate my image (destined for a 64MB NAND partition) using:-
> 
> $ mkfs.ubifs -d output/target -e 0x1f000 -c 483 -m 0x800 -x none -F -o
> output/images/rootfs.ubifs
> $ ubinize -o output/images/rootfs.ubi -m 0x800 -p 0x20000 -s 512 -O 2048
> ubinize.cfg
> 
> My .cfg file is:-
> 
> [ubifs]
> mode=ubi
> vol_id=0
> vol_type=dynamic
> vol_name=rootfs
> vol_alignment=1
> vol_flags=autoresize
> vol_size=61MiB
> image=output/images/rootfs.ubifs
> 
> And the resulting image is:-
> 
> -rw-rw-r-- 1 mpfj mpfj 9437184 Apr 16 10:19 rootfs.ubi
> 
> This is then written to a freshly erased 64MB NAND partition, and
> appears to mount correctly, apart from the warning about not enough
> reserved PEBs, as follows:-
> 
> ...
> [    0.792456] UBI: attaching mtd7 to ubi0
> [    1.540858] UBI: scanning is finished
> [    1.557578] UBI warning: print_rsvd_warning: cannot reserve enough
> PEBs for bad PEB handling, reserved 4, need 40
> [    1.561346] UBI: attached mtd7 (name "rootfs", size 64 MiB) to ubi0
> [    1.561404] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
> [    1.561434] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
> [    1.561464] UBI: VID header offset: 2048 (aligned 2048), data offset:
> 4096
> [    1.561493] UBI: good PEBs: 512, bad PEBs: 0, corrupted PEBs: 0
> [    1.561520] UBI: user volume: 1, internal volumes: 1, max. volumes
> count: 128
> [    1.561554] UBI: max/mean erase counter: 2/1, WL threshold: 4096,
> image sequence number: 1434266085
> [    1.561591] UBI: available PEBs: 0, total reserved PEBs: 512, PEBs
> reserved for bad PEB handling: 4
> [    1.562374] UBI: background thread "ubi_bgt0d" started, PID 598
> ...
> 
> I think I've calculated the various option values correctly for
> mkfs.ubifs and ubinize.
> 
> But since I'm getting the warning, can anyone explain where I've gone
> wrong ?

This is because UBI is trying to reserve 40 PEBs for bad block handling.
Why so much? See the explanations here:

http://www.linux-mtd.infradead.org/doc/ubi.html#L_max_beb

You may adjust this value, but the default for UBI is the most
pessimistic scenario.

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-15  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22  9:38 MTD : cannot reserve enough PEBs for bad PEB handling Mark Jackson
2013-04-22  9:41 ` Mark Jackson
2013-04-23  8:31 ` MTD : cannot reserve enough PEBs for bad PEB handling [SOLVED] Mark Jackson
2013-05-15  7:55 ` MTD : cannot reserve enough PEBs for bad PEB handling Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).