UBINIZE(8)
π UBINIZE(8) π
okay bestie, gather round, because ubinize is literally the tool that makes UBI images and she's about to eat π this page is from the System Manager's Manual section 8 (that's the admin-tools girlies, iykyk).
β¨ NAME β¨
ubinize β a tool for generating UBI images π
πΈ SYNOPSIS πΈ
ubinize [-o filename] [-p <bytes>] [-m <bytes>] [-s <bytes>] [-O <num>]
[-e <num>] [-x <num>] [-Q <num>] [-v] [-h] [-V] [--output=<filename>]
[--peb-size=<bytes>] [--min-io-size=<bytes>] [--sub-page-size=<bytes>]
[--vid-hdr-offset=<num>] [--erase-counter=<num>] [--ubi-ver=<num>]
[--image-seq=<num>] [--verbose] [--help] [--version] ini-file
π¦ DESCRIPTION π¦
so. An UBI image can hold one or more UBI volumes, and those volumes have to be defined in the input configuration ini-file. That ini-file is the main character here β it describes all the UBI volumes, their characteristics and what's inside them π«Ά
BUT (and this is the plot twist) the ini-file does not describe the flash that the UBI image is being generated for. Nope! The flash characteristics come from the command-line options instead. periodt.
pro tip from me to you: if you're not sure about some of the command-line parameters, just don't specify them and let the utility use its default values π no cap.
π OPTIONS π
-o,--output=fileβ specify the output file β¨-p,--peb-size=bytesβ the size of the physical eraseblock of the flash this UBI image is created for, in bytes, kilobytes (KiB), or megabytes (MiB). This parameter is mandatory. like, you cannot skip it, she is required π-m,--min-io-size=bytesβ the minimum input/output unit size of the flash, in bytes-s,--sub-page-size=bytesβ the minimum input/output unit used for UBI headers, e.g. the sub-page size in the case of NAND flash. (By default this is equivalent to the minimum input/output unit size.) πΈ-O,--vid-hdr-offset=numβ the offset of the VID header from the start of the physical eraseblock. Default is the next minimum I/O unit or sub-page after the EC header. π-e,--erase-counter=numβ the erase counter value to put into the EC headers. Default is0.-x,--ubi-ver=numβ the UBI version number to put into the EC headers. Default is1.-Q,--image-seq=numβ the 32-bit UBI image sequence number to use. By default a random number is picked π² (main character energy tbh)-v,--verboseβ be verbose. she talks. a lot. we love her for it π¬-h,--helpβ print a help message and exit-V,--versionβ print the program version and exit
π EXAMPLE π
ubinize -o ubi.img -p 16KiB -m 512 -s 256 cfg.ini
This creates the UBI image ubi.img as described by the configuration file cfg.ini π¦
A physical erase block on the flash is 16KiB in size and has 512 byte pages with 256 byte sub-pages. cute, right?
π INI-FILE FORMAT π
The input configuration ini-file describes all the volumes that have to be included in the output UBI image. Every volume gets its own section, and those sections can be named literally anything you want, bestie. Each section is made of key=value pairs, like this:
[jffs2-volume]
mode=ubi
image=../jffs2.img
vol_id=1
vol_size=30MiB
vol_type=dynamic
vol_name=jffs2_volume
vol_flags=autoresize
vol_alignment=1
This example configuration file tells the utility to create an UBI image with one volume that has ID 1, volume size 30MiB, the volume is dynamic, it's named jffs2_volume, it has the autoresize volume flag, and alignment 1. iconic honestly β¨
The image=../jffs2.img line tells the utility to take the contents of the volume from the ../jffs2.img file. The size of that image file has to be less than or equivalent to the volume size (30MiB).
The mode=ubi line is mandatory and just says that the section describes an UBI volume β other section modes might get added in the future, so stay tuned π
Notes:
- Size in
vol_sizemight be specified in kilobytes (KiB), megabytes (MiB), gigabytes (GiB) or bytes (no modifier). - If the
"vol_size"key is absent, the volume size is assumed to be equivalent to the size of the image file (defined by the"image"key). - If the
"image"is absent, the volume is assumed to be empty. - Volume alignment must not be greater than the logical eraseblock size. π¨ like, don't do it.
- One ini file may contain an arbitrary number of sections, and the utility will put all the volumes described by those sections into the output UBI image file. π
π«Ά AUTHORS π«Ά
Man page written by David Oberhollenzer, based on the help text of the ubinize utility written by Artem Bityutskiy and Oliver Lohmann. kings, all of them π
π REPORTING BUGS π
Report mtd-utils bugs to the Linux mtd mailing list.
- Linux mtd mailing list: <linux-mtd@lists.infradead.org>
- Linux mtd home page: <http://www.linux-mtd.infradead.org/>
π AVAILABILITY π
The ubinize command is part of the mtd-utils package and is available from ftp://ftp.infradead.org/pub/mtd-utils/.
β COPYRIGHT β
Copyright Β© International Business Machines Corp., 2006 Copyright Β© 2008 Nokia Corporation Copyright Β© 2016 sigma star gmbh
License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl2.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. π (that's the legal girlies talking, not me)
π SEE ALSO π
mtd-utils Β· September 2016 β and that's the whole page bestie, mwah π go make some UBI images, you're gonna slay π¦πβ¨
π¦ where this page comes from
- alpine 3.22: mtd-utils-doc 2.2.1-r0 Β· GPL-2.0-only
- alpine 3.23: mtd-utils-doc 2.2.1-r0 Β· GPL-2.0-only
- alpine 3.24: mtd-utils-doc 2.2.1-r0 Β· GPL-2.0-only
- arch rolling: mtd-utils 2.3.1-1 Β· GPL-2.0-only
- debian bookworm: mtd-utils 1:2.1.5-1 Β· GPL-2.0-or-later
- debian trixie: mtd-utils 1:2.3.0-1 Β· GPL-2.0-or-later
- fedora 43: mtd-utils 2.2.1-3.fc43 Β· GPL-2.0-or-later
- fedora 44: mtd-utils 2.2.1-4.fc44 Β· GPL-2.0-or-later
- nixos 26.05: mtd-utils 2.3.1
- nixpkgs unstable: mtd-utils 2.3.1
- opensuse-leap 16.0: mtd-utils 2.2.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mtd-utils 2.2.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mtd-utils 2.2.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: mtd-utils 2.2.0-bp160.1.12 Β· GPL-2.0-or-later
- ubuntu jammy: mtd-utils 1:2.1.4-1 Β· GPL-2.0-or-later
- ubuntu noble: mtd-utils 1:2.2.0-1ubuntu2 Β· GPL-2.0-or-later
- ubuntu questing: mtd-utils 1:2.3.0-1ubuntu1
- ubuntu resolute: mtd-utils 1:2.3.0-1ubuntu2 Β· GPL-2.0-or-later
- ubuntu stonking: mtd-utils 1:2.3.1-3ubuntu3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms