ubi create rootfs fails

  • Hello,


    i want to flash a new root filesystem, but in U-Boot the command run .ubivol_std fails:


    PicoCoreMX6SX # run .ubivol_std

    ubi0: attaching mtd1

    ubi0: scanning is finished

    ubi0: attached mtd1 (name "mtd=7", size 500 MiB)

    ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes

    ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048

    ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096

    ubi0: good PEBs: 4000, bad PEBs: 0, corrupted PEBs: 0

    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128

    ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0

    ubi0: available PEBs: 0, total reserved PEBs: 4000, PEBs reserved for bad PEB handling: 80

    No size specified -> Using max size (0)

    No space left in UBI device!

    verify_mkvol_req failed 12


    What can be the reason?


    Thanks

  • Hello,


    sorry for late response.


    The command ".ubivol_std" executes the following commands:

    • ubi part TargetFS
    • ubi create rootfs

    Your error no space left comes from the fact that already a partition with ubi create "name" has been created. But there is already a partition which takes the the whole size. This does not make it possible to create a second partition. If you want to execute the command

    Code
    1. .ubivol_std

    then you have to make sure that the partition is empty. The easiest way is to delete the partition

    Code
    1. nand erase.part TargetFS

    After that you can run the command

    Code
    1. run .ubivol_std


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Some important additional information. The command is not missing, we have deliberately not mentioned it, because it is usually wrong to use this command.

    Code
    1. run .ubivol_std

    is only used once, when the board is completely fresh. Then the MTD partition TargetFS is converted to an UBI and the rootfs volume is created. Later, when you just want to install a new rootfs, you simply download your image and then call

    Code
    1. ubi part TargetFS
    2. ubi write $loadaddr rootfs $filesize

    You do not have to create the rootfs volume over and over again, just write to to the already existing rootfs volume. UBI will erase any old content automatically.


    Erasing the partition by hand has a very very big disadvantage. Let me explain why.


    UBI does wear leveling. That means it counts how often each block was erased and if single blocks have been erased quite often, i.e. have a high erase count, UBI prefers other blocks when writing, and even relocates data from time to time, even read-only data, so that other blocks with low erase counts will be used, too. So for a short period of time, blocks may show different erase counts, but in the long term, the counts are as similar as possible.


    If you erase such a partition with a low-level nand erase command, you also delete those UBI erase counters, or in other words the wear leveling history. This renders the whole procedure rather useless. So avoid erasing any MTD partition with UBI on it wherever possible.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.