STRUCT UBI_VOLUME(9)
π NAME π
struct ubi_volume β UBI volume description data structure. This is the struct ubi_volume(9) page from the Kernel API Manual, and bestie we are going through every single field like it's a group-chat screenshot. No skipping, no cap. π
β¨ SYNOPSIS β¨
Okay so here's the whole struct, copied exactly, character for character:
struct ubi_volume {
struct device dev;
struct cdev cdev;
struct ubi_device *ubi;
int vol_id;
int ref_count;
int readers;
int writers;
int exclusive;
int metaonly;
bool is_dead;
int reserved_pebs;
int vol_type;
int usable_leb_size;
int used_ebs;
int last_eb_bytes;
long long used_bytes;
int alignment;
int data_pad;
int name_len;
char name[UBI_VOL_NAME_MAX + 1];
int upd_ebs;
int ch_lnum;
long long upd_bytes;
long long upd_received;
void *upd_buf;
struct ubi_eba_table *eba_tbl;
unsigned int skip_check:1;
unsigned int checked:1;
unsigned int corrupted:1;
unsigned int upd_marker:1;
unsigned int updating:1;
unsigned int changing_leb:1;
unsigned int direct_writes:1;
#ifdef CONFIG_MTD_UBI_FASTMAP;
unsigned long *checkmap;
#endif;
};
π Members π
devβ the device object that makes use of the Linux device model. Very main character energy for the device model. πcdevβ the character device object used to create the character device.ubiβ a reference to the UBI device description object.vol_idβ the volume ID.ref_countβ the volume reference count.readersβ how many users are holding this volume in read-only mode.writersβ how many users are holding this volume in read-write mode.exclusiveβ whether somebody holds this volume in exclusive mode.metaonlyβ whether somebody is altering only meta data of this volume.reserved_pebsβ how many physical eraseblocks are reserved for this volume.vol_typeβ the volume type, which is eitherUBI_DYNAMIC_VOLUMEorUBI_STATIC_VOLUME.usable_leb_sizeβ the logical eraseblock size without padding.used_ebsβ how many logical eraseblocks in this volume contain data.last_eb_bytesβ how many bytes are stored in the last logical eraseblock.used_bytesβ how many bytes of data this volume contains.alignmentβ the volume alignment.data_padβ how many bytes are not used at the end of physical eraseblocks to satisfy the requested alignment.name_lenβ the volume name length.nameβ the volume name.upd_ebsβ how many eraseblocks are expected to be updated.ch_lnumβ the LEB number that is being changed by the atomic LEB change operation.upd_bytesβ how many bytes are expected to be received for volume update or atomic LEB change.upd_receivedβ how many bytes were already received for volume update or atomic LEB change.upd_bufβ the update buffer used to collect update data or data for atomic LEB change.eba_tblβ the EBA table of this volume, aka theLEB->PEBmapping.skip_checkβ1if the CRC check of this static volume should be skipped. It directly reflects the presence of theUBI_VTBL_SKIP_CRC_CHECK_FLGflag in the vtbl entry.checkedβ1if this static volume was checked.corruptedβ1if the volume is corrupted, static volumes only.upd_markerβ1if the update marker is set for this volume.updatingβ1if the volume is being updated.changing_lebβ1if the atomic LEB change ioctl command is in progress.direct_writesβ1if direct writes are enabled for this volume.checkmapβ a bitmap to remember whichPEB->LEBmappings got checked, protected by the UBI LEB lock tree.
Tiny aside, bestie: is_dead is chilling in the struct above, but the original Members rundown doesn't give it its own description, so I'm not inventing one. We respect the source in this chat. π«Ά
π Description π
The corrupted field is telling you that the volume's contents is corrupted. Since UBI protects only static volumes, this field is not relevant to dynamic volumes β it is the user's responsibility to assure their data integrity. Periodt. No cap. β¨
The upd_marker flag means this volume is either being updated at the moment or is damaged because of an unclean reboot. That's the whole warning, and yes it's giving "handle with care" energy. π
π¦ SEE ALSO π¦
Kernel file ./drivers/mtd/ubi/ubi.h β and the whole friend group:
struct ubi_vid_io_buf(9)struct ubi_wl_entry(9)struct ubi_ltree_entry(9)struct ubi_rename_entry(9)struct ubi_fastmap_layout(9)struct ubi_fm_pool(9)struct ubi_eba_leb_desc(9)struct ubi_volume_desc(9)struct ubi_debug_info(9)struct ubi_device(9)struct ubi_ainf_peb(9)struct ubi_ainf_volume(9)struct ubi_attach_info(9)struct ubi_work(9)ubi_init_vid_buf(9)ubi_free_vid_buf(9)ubi_get_vid_hdr(9)ubi_ro_mode(9)vol_id2idx(9)idx2vol_id(9)ubi_is_fm_vol(9)ubi_find_fm_block(9)
Okay that's the whole page, bestie. Footer source/version vibes: ./drivers/mtd/ubi; date: October 2026; and it's the struct ubi_volume(9) Kernel API Manual page. Mwah πβ¨
π¦ 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