STRUCT UBI_RNVOL_REQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct ubi_rnvol_req β€” volumes re-name request πŸ¦‹

okay so we're deep in the Kernel API Manual rn and honestly? this one's a baddie. it's the struct that handles re-naming UBI volumes, and it's doing the absolute most in the best way πŸ’…


✨ NAME ✨

struct ubi_rnvol_req β€” the volumes re-name request struct, no cap. it's giving "let me rename a bunch of volumes at once" energy πŸ”₯


🌸 SYNOPSIS 🌸

like, here's literally the whole shape of it, bestie:

struct ubi_rnvol_req {
    __s32 count;
    __s8 padding1[12];
    struct {
      __s32 vol_id;
      __s16 name_len;
      __s8 padding2[2];
      char name[UBI_MAX_VOLUME_NAME + 1];
    } ents[UBI_MAX_RNVOL];
};

look at that nested struct. a whole little struct inside a struct. main character behavior tbh πŸ‘‘


πŸŽ€ Members πŸŽ€

  • count β€” how many volumes we're re-naming. that's it, that's the count πŸ“
  • padding1 β€” reserved for future, not used, and it has to be zeroed. do not forget. i'm serious. don't be that person πŸ™ˆ

πŸ’– Description πŸ’–

so UBI lets you re-name up to 32 volumes in one single go. iconic. the number of volumes you're re-naming goes in the count field. the ID of the volumes you're re-naming goes in vol_id, and the shiny new names go in name. easy πŸ’œ

lowkey the most important part: the UBI volume re-name operation is atomic. meaning if a power cut happens (😭), the volumes will have either the old name or the new name. never some cursed in-between state. we love a clean cut πŸ’…

so the possible use-case for this command is atomic upgrade, fr fr. like β€” say you wanna upgrade volumes A and B. you could create temporary volumes A1 and B1 with the new contents, then atomically re-name A1->A and B1->B, in which case old A and B will be removed. yes, removed. gone. bye πŸ‘‹

but wait β€” what if you don't want old A and B to get deleted? valid. in that case the re-name request has to contain 4 entries: A1->A, A->A1, B1->B, B->B1 β€” in which case old A1 and B1 become A and B, and old A and B will become A1 and B1. everybody swaps, nobody gets removed. slay πŸ”„

it's also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1 and B1 become A and B, and old A and B become X and Y. truly whatever you want ✨

in other words β€” the way this works is: in case of re-naming into an existing volume name, the existing volume is removed, unless it is re-named as well at the same re-name request. that's the whole rule. memorize it. put it on a sticky note 🫢


🌈 SEE ALSO 🌈

  • the kernel file ./include/uapi/mtd/ubi-user.h
  • struct ubi_attach_req(9)
  • struct ubi_mkvol_req(9)
  • struct ubi_rsvol_req(9)
  • struct ubi_ecinfo_req(9)
  • struct ubi_leb_change_req(9)
  • struct ubi_map_req(9)
  • struct ubi_set_vol_prop_req(9)
  • struct ubi_blkcreate_req(9)

okay that's the whole page bestie, go forth and re-name your volumes atomically βœ¨πŸ’– this queen lives in ./include/uapi/mtd and the version vibes are dated October 2026 β€” see u in the next manpage, mwah πŸ’‹πŸ‘‘

πŸ“¦ where this page comes from