STRUCT UBI_DEVICE_INFO(9)
๐ struct ubi_device_info(9) ๐
okay so this is a page from the Kernel API Manual and it's all about struct ubi_device_info โ literally the little data structure that describes a UBI device ๐ฆ
โจ NAME โจ
struct ubi_device_info โ the UBI device description data structure, bestie. that's it, that's the vibe ๐
๐ธ SYNOPSIS ๐ธ
struct ubi_device_info {
int ubi_num;
int leb_size;
int leb_start;
int min_io_size;
int max_write_size;
int ro_mode;
dev_t cdev;
};
look at her. seven fields. main character energy ๐
๐ซถ Members ๐ซถ
ubi_numโ the ubi device number, like her little ID card ๐ชชleb_sizeโ logical eraseblock size on this UBI device, so validleb_startโ where the logical eraseblocks kick off inside the physical eraseblocks (the starting offset, periodt)min_io_sizeโ minimal I/O unit size. tiny but mighty โจmax_write_sizeโ the max amount of bytes the underlying flash can write at one time (that's the MTD write buffer size, iykyk)ro_modeโ flags whether this device is stuck in read-only mode ๐cdevโ the UBI character device major and minor numbers ๐
๐ Description ๐
heads up: leb_size is the logical eraseblock size that the UBI device itself offers. but volumes of this UBI device may have a smaller logical eraseblock size if their alignment isn't equivalent to 1. so yeah, don't assume, ok? ๐
so the max_write_size field is describing the flash write maximum write unit. example time: NOR flash lets you change individual bytes, so min_io_size is 1. but no cap, that does not mean NOR flash has to write data byte-by-byte ๐ญ instead, CFI NOR flashes have a write-buffer of, like, e.g., 64 bytes, and when they're writing large chunks of data they write 64-bytes at a time. obviously that improves write throughput โ slay, efficiency ๐ฅ
alsoooo, the MTD device may have N interleaved (striped) flash chips underneath it ๐ in that case min_io_size can be the physical min. I/O size of a single flash chip, while max_write_size can be N * min_io_size. math queen ๐งฎ
and the max_write_size field is always greater or equivalent to min_io_size. e.g., some NOR flashes may have (min_io_size = 1, max_write_size = 64). in contrast, NAND flashes usually have min_io_size = max_write_size = NAND page size. iconic, consistent, no notes โญ
๐ SEE ALSO ๐
- Kernel file
./include/linux/mtd/ubi.h struct ubi_volume_info(9)struct ubi_sgl(9)ubi_sgl_init(9)
ok that's the whole page bestie, go read the kernel file if you want more lore ๐ฆ
sign-off time ๐ซ this lil masterpiece lives in ./include/linux/mtd, it's dated October 2026, and it's filed under struct ubi_device_info(9) โ mwah, bye ๐๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms