How to use UBIFS

Time:2020-2-25

Common commands:

View block device partition information
cat /proc/mtd

View block device information
mtdinfo /dev/mtd0

Format MTD partition
ubiformat /dev/mtd0

Associate MTD partition with UBI
ubiattach /dev/ubi_ctrl -m 0

Cancel Association
ubidetach /dev/ubi_ctrl -m 0

View information about UBI devices
ubinfo /dev/ubi0

Create logical volume
ubimkvol /dev/ubi0 -N rootfs -s 115MiB

mount
mount -t ubifs ubi0_0 /mnt

First use execution:
ubiformat /dev/mtd0
ubiattach /dev/ubi_ctrl -m 0
ubimkvol /dev/ubi0 -N rootfs -s 115MiB
mount -t ubifs ubi0_0 /mnt

After creating the sub volume, use it again to execute:
ubiattach /dev/ubi_ctrl -m 0
mount -t ubifs ubi0_0 /mnt