LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 06-09-2011, 06:46 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 660

Rep: Reputation: 35
Question [Ubifs] "vtbl_check: too large reserved_pebs"


Hello

I went through the docs/FAQs on the MTD/UBI site and elsewhere, and proceeded to create a Ubifs root filesystem and flash a NAND partition with it.
However, "ubiattach" fails, so I guess I didn't use the right settings in mkfs.ubifs and/or ubinize and/or ubiformat for use with that NAND partition.

Here are the steps I took.

First, get infos about NAND
Code:
appliance:/> mtdinfo /dev/mtd2 -u
mtd2
Name:                           filesystem_nand
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          1984 (260046848 bytes, 248.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  512 bytes
OOB size:                       64 bytes
Character device major/minor:   90:4
Bad blocks are allowed:         true
Device is writable:             true
Default UBI VID header offset:  512
Default UBI data offset:        2048
Default UBI LEB size:           129024 bytes, 126.0 KiB
Maximum UBI volumes count:      128
Next, cCreate root filesystem
Code:
ubuntu:/> mkfs.ubifs --squash-uids -m 2048 -e 131072 -c 1984 -d
./romfs -D device_table-min.txt -o ./images/rootfs.ubifs
Ubinize image
Code:
ubuntu:/> cat ubi.cfg
[ubifs]
mode=ubi
image=./images/rootfs.ubifs
vol_id=0
vol_size=248MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

ubuntu:/> ubinize -o rootfs.ubi.img -m 2048 -p 128KiB -s 512 ./ubi.cfg
On the appliance, format the partition on the NAND memory:
Code:
appliance:/> ubiformat /dev/mtd2 -s 512 -f rootfs.ubi.img
Finally, attach the MTD partition to Ubi before mounting it:
Code:
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 error: vtbl_check: too large reserved_pebs 2016, good PEBs 1984
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_attach_mtd_dev: failed to attach by scanning, error -22
ubiattach: error!: cannot attach mtd2
           error 22 (Invalid argument)
I assume I used one or more settings wrong, but I don't know which. Maybe I must leave some room for the journal + recovery data?

Thank you.
 
Old 06-10-2011, 07:25 AM   #2
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 660

Original Poster
Rep: Reputation: 35
In case someone has the same problem... the solution is to...
  1. Edit the Makefile that runs mkfs.ubifs so that it uses the right setting for the "-e" option, which is computed by this formula:

    LEB_size = PEB_size - ((Subpage_size + Page_size)) / Page_size) * Page_size
    (In the division, keep the integer part)

    Also make sure you use the right setting for "-c" ("Amount of eraseblocks")
  2. In ubi.cfg, make sure you use a "vol_size" that's smaller than the actual size of the partition on the NAND to leave room for Ubifs internal data. With "vol_type=dynamic", Ubifs will end up using the whole space automatically
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [ubifs] "cannot parse device table file 'device_table.txt'" littlebigman Linux - Software 1 05-27-2011 07:03 AM
Troubleshooting large partition "attempt to access beyond end of device" dear mr. trout Linux - Server 4 10-21-2008 09:02 AM
Moving a file into a large directory: "No space left on device" Jimantha Linux - General 2 09-09-2008 11:40 PM
Put the "Forums" link nice and LARGE on the front page resetreset LQ Suggestions & Feedback 9 06-17-2008 10:43 AM
make bzImage failure - "Value too large for defined data type" hce_ Linux - Kernel 2 07-01-2007 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration