STRUCT UBI_VOLUME(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 either UBI_DYNAMIC_VOLUME or UBI_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 the LEB->PEB mapping.
  • skip_check β€” 1 if the CRC check of this static volume should be skipped. It directly reflects the presence of the UBI_VTBL_SKIP_CRC_CHECK_FLG flag in the vtbl entry.
  • checked β€” 1 if this static volume was checked.
  • corrupted β€” 1 if the volume is corrupted, static volumes only.
  • upd_marker β€” 1 if the update marker is set for this volume.
  • updating β€” 1 if the volume is being updated.
  • changing_leb β€” 1 if the atomic LEB change ioctl command is in progress.
  • direct_writes β€” 1 if direct writes are enabled for this volume.
  • checkmap β€” a bitmap to remember which PEB->LEB mappings 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:


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