This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Mounting UBIFS at U-boot.

Hi All,

I am trying to mount the UBI image from NAND on custom board(OMAP4 DM37 processors). I have followed below steps to mount the UBI image.

1. Enabled the UBIFS support at U-boot.

2. MTDPARTIONS_DEFAULT, MTDIDS_DEFAULT are added. I have checked these partitions, by giving the "mtdparts" command from the cutecom. Getting the expected partitions.

3. Now i have attached the on one of the MTD partion to the UBI device by giving the command "ubi part system".

         

VAR-OM3xxx # ubi part system

Creating 1 MTD partitions on "nand0":
0x000000780000-0x000006b80000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size: 131072 bytes (128 KiB)
UBI: logical eraseblock size: 126976 bytes
UBI: smallest flash I/O unit: 2048
UBI: VID header offset: 2048 (aligned 2048)
UBI: data offset: 4096
UBI: attached mtd1 to ubi0
UBI: MTD device name: "mtd=3"
UBI: MTD device size: 100 MiB
UBI: number of good PEBs: 800
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: 800
UBI: number of PEBs reserved for bad PEB handling: 8
UBI: max/mean erase counter: 1/0

4. Here i want to create a volume on the UBI device. It is giving error : ubi_create_volume : not enough pebs, only 0 available.

    The  command used to create the UBI volume on the UBI device is  ubi create usystem 0x3c00 d

Why i am facing this error?  Is this is the process to mount the ubi image or any mistake?

BR

Kishore

  • Hi Kishore,

    The error message "ubi_create_volume : not enough pebs, only 0 available" appears because you have 0 available PEBs as you see in the "ubi part system" command output.  

    Are you creating the UBIFS as it is described at the link:

    http://processors.wiki.ti.com/index.php/UBIFS_Support#Creating_UBIFS_file_system

    If all is right about creation you can try to start some debugging by starting with ubi_create_volume function in the u-boot/drivers/mtd/ubi/vmt.c file.

    BR

    Tsvetolin Shulev

  • Hi Tsvetolin ,

    I have created ubi images as specified in the link. I am able to mount those images from kernel, but failing to mount at U-boot.

    1. After UBI device creation by the command "ubi part system" , i have given following command.

    VAR-OM3xxx # ubi info l

    UBI: volume information dump:
    UBI: vol_id 0
    UBI: reserved_pebs 788
    UBI: alignment 1
    UBI: data_pad 0
    UBI: vol_type 3
    UBI: name_len 6
    UBI: usable_leb_size 126976
    UBI: used_ebs 788
    UBI: used_bytes 100057088
    UBI: last_eb_bytes 126976
    UBI: corrupted 0
    UBI: upd_marker 0
    UBI: name system

    UBI: volume information dump:
    UBI: vol_id 2147479551
    UBI: reserved_pebs 2
    UBI: alignment 1
    UBI: data_pad 0
    UBI: vol_type 3
    UBI: name_len 13
    UBI: usable_leb_size 126976
    UBI: used_ebs 2
    UBI: used_bytes 253952
    UBI: last_eb_bytes 2
    UBI: corrupted 0
    UBI: upd_marker 0
    UBI: name layout volume

    2. From the above log we can observe that UBI volumes(system voume) are created when the UBI device is created. Here i didn't create the UBI volume explicitly.
    3. I have tried to mount the system ubi volume by the command "ubifsmount system". Here U-boot is stuck and not responding to any commands.

    This command is stuck at the function *sget() in file fs/ubifs/super.c


    BR
    Kishore
  • Hi Kishore,
    Could you continue with debugging to localize at which row in the sget() function the command stuck?

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Command is stuck at the function *sget() in file fs/ubifs/super.c at line "list_add(&s->s_instances, &type->fs_supers);"

    BR
    Kishore