Create Partitions

  • Hello Support Team,


    I'm using a PicoCOMA7 with the release picocoma7-B2019.11.2.


    I’m trying to create a partition in Linux, I want to have in TargetFS two separated partitions ‘rootfs’ (which would be the default with the Linux filesystem and ro mode) and ‘logs’ (which would exist only to write and store some logs with rw mode).

    In the update.scr I have the following:


    […]

    # Create UBI with volume rootfs on partition TargetFS

    nand erase.part TargetFS

    ubi part TargetFS

    # 5MiB for logs

    ubi create logslf 0x00500000

    ubi create rootfs


    # Load root filesystem and store in UBI volume rootfs

    load ${updatedev} $loadaddr rootfs.ubifs

    ubi write $loadaddr rootfs $filesize

    # Set default configuration: kernel and fdt from NAND, rootfs from ubifs

    run .kernel_nand

    run .fdt_nand

    run .rootfs_ubifs


    Should I add a “run .logs_ubi” in the script?


    Also, when the system with this udate.scr is created I notice that the 5MB for the logs partition is reserved and in the location /dev there is a device called ubi0_1 and ubi0_0 (don’t really know if one of them is the logs partitions).

    I’m pretty new with partitions so I’m a little bit lost, I know from your pdfs that as I have it now I already have the partition created but what it’s missing is putting a filesystem inside. I don’t really know neither how to create this filesystem nor what type, because for the logs I would need an empty filesystem (?).


    Could you help me with this?


    Best regards,

    Carles

  • Hello Carles and welcome to the forum,


    for creating an UBIpartition in Uboot you can refer to chapter 5.5 UBI Concepts of the Linux OnFS Boards documentation.

    https://www.fs-net.de/assets/d…n/LinuxOnFSBoards_eng.pdf


    This seems fine so far. Please keep in mind that erasing a valid UBI partition in an update-script with nand erase.part TargetFS also erases the list of erase count and might not be a good idea. For more information please see chapter 5.5 UBI Concepts of the Linux OnFS Boards documentation. If you have already installed a rootfs run ubi remove rootfs instaed.



    No, this is only necessary to tell the Uboot to load the rootfile system from the NAND flash.


    Quote

    Also, when the system with this udate.scr is created I notice that the 5MB for the logs partition is reserved and in the location /dev there is a device called ubi0_1 and ubi0_0 (don’t really know if one of them is the logs partitions).

    I’m pretty new with partitions so I’m a little bit lost, I know from your pdfs that as I have it now I already have the partition created but what it’s missing is putting a filesystem inside. I don’t really know neither how to create this filesystem nor what type, because for the logs I would need an empty filesystem (?).


    ubi0_0 should be your logs partition as you created it first.

    If you mount an empty UBI partition an ubifs will automatically get created. Just run


    mount -t ubifs /dev/ubi0_0 /mnt/


    And you should be able to read/write to it like to your rootfs.


    I hope this helps.


    Best regards and have a great day


    Your F&S Support Team

  • Thank you very much,


    I had tried to mount it but I did it wrong.

    There's still a thing I don't quite understand, I have reserved 5MB for this partition and yet, when I mount it in /mnt/ I only get 2.9MB (See the screenshot attached).


    Why does this happen?