[Ubiattach] "vtbl_check: too large reserved_pebs"
Gilles
gilles.ganault at free.fr
Thu Jun 9 11:18:35 EDT 2011
On Thu, 09 Jun 2011 15:38:25 +0300, Artem Bityutskiy
<dedekind1 at gmail.com> wrote:
>On Thu, 2011-06-09 at 12:24 +0200, Gilles wrote:
>> vol_size=248MiB
>
>Put, say, 230MiB here. 248MiB is the total amount of space. UBI adds
>some overhead, so your volume size will be smaller, see here:
After updating ubi.cfg with "vol_size=230MiB" and re-running "ubinize
-o rootfs.ubi.img -m 2048 -p 128KiB -s 512 ./ubi.cfg", I reformateed
the appliance and tried to attach mtd2 to Ubi... and it worked! :-)
===============
appliance:> ubiformat /dev/mtd2 -s 512 -f rootfs.ubi.img
appliance:> ubiattach /dev/ubi_ctrl -m 2
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 129024 bytes
UBI: smallest flash I/O unit: 2048
UBI: sub-page size: 512
UBI: VID header offset: 512 (aligned 512)
UBI: data offset: 2048
UBI: volume 0 ("rootfs") re-sized from 1870 to 1961 LEBs
UBI: attached mtd2 to ubi0
UBI: MTD device name: "filesystem_nand"
UBI: MTD device size: 248 MiB
UBI: number of good PEBs: 1984
UBI: number of bad 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: 1984
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 14/9
UBI: image sequence number: 1879706523
mtd: Giving out device 3 to rootfs
UBI: background thread "ubi_bgt0d" started, PID 136
UBI device number 0, total 1984 LEBs (255983616 bytes, 244.1 MiB),
available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
===============
So apparently, I lost about 4MiB in the process (248MiB -> 244.1).
I'll take advantage of this thread to ask a few questions that I have
after reading the docs + experimenting:
1. After running "ubiattach", I get a new mtd3 partition that is
linked to mtd2:
appliance> cat /proc/mtd
dev: size erasesize name
mtd0: 00800000 00001000 "ROMfs"
mtd1: 00800000 00020000 "kernel_nand"
mtd2: 0f800000 00020000 "filesystem_nand"
mtd3: 0f14b800 0001f800 "rootfs"
To reboot and use the NAND partition as root filesystem, am I correct
that I should forget about mtd2, and use this kernel command line:
"ubi.mtd=3 rootfstype=ubifs root=ubi0:rootfs rw"
?
2. ubiformat takes about 10-15mn to complete: Is there a way to speed
things up, or is it just due to the CPU+NAND that the appliance uses?
3. Finally, when do I have to use ubimkvol?
Thank you.
More information about the linux-mtd
mailing list