UBI volume update
A UBI volume update replaces a volume's contents using a declared byte count and a persistent marker that identifies interrupted replacement.
In Linux v6.16, UBI_IOCVOLUP declares the image length on the volume character device, followed by writes supplying that payload. This is whole-volume replacement, unlike the single-LEB UBI_IOCEBCH operation. [1]
The update marker is stored before old logical eraseblocks are unmapped. An interrupted replacement can leave the marker set and ordinary I/O restricted until another update; the old image is not automatically restored. A zero-byte update still wipes the volume, so it is not a harmless capability probe. [2]
Closing with payload missing does not finish the update. A write extending past the declared length is limited to the remaining bytes; callers must inspect returned counts and errors. [3] [2]
After payload completion, ubi_check_volume scans static-volume data with CRC checks but skips dynamic volumes. A positive corruption result sets the corrupted flag while the final write can still return its byte count; negative check errors are returned. Successful input delivery alone is therefore not an integrity verdict. [4] [3]
For read-only diagnostics, Linux v6.16 exposes upd_marker and corrupted under /sys/class/ubi/ubiX_Y/. The sysfs handler reports two separate in-memory flags; reading them does not perform a fresh integrity scan, and separate reads are not an atomic snapshot. A cleared upd_marker alone is not an integrity verdict. [5] [4]
Relations
Citations
- Linux v6.16, UBI userspace volume-update and atomic-LEB-change contracts
- Linux v6.16, ubi_start_update and ubi_more_update_data
- Linux v6.16, vol_cdev_release and vol_cdev_write
- Linux v6.16, ubi_check_volume: static-volume CRC scan and dynamic-volume bypass
- Linux v6.16, UBI volume sysfs attributes: independent update and corruption flags
Sources & caveats
- Source review pinned to Linux v6.16. No flash update, power-cut experiment or image-boot validation was performed.