ubi_leb_erase(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ubi_leb_erase(9) β€” Kernel API Manual, bestie edition

Okay so real quick before we dive in: this is a page from the Kernel API Manual about ubi_leb_erase β€” no cap, it's the whole function, and we're gonna get into it. πŸ¦‹


✨ NAME ✨

ubi_leb_erase β€” erase a logical eraseblock. That's it, that's the job. Iconic, honestly. πŸŽ€


✨ SYNOPSIS ✨

int ubi_leb_erase (struct ubi_volume_desc *desc , int lnum );

✨ ARGUMENTS ✨

  • desc β€” the volume descriptor, like your little entry pass to the volume. 🫢
  • lnum β€” the logical eraseblock number. That's the one getting yeeted. πŸ’…

✨ DESCRIPTION ✨

Okay so bestie, what this function does is it un-maps logical eraseblock lnum and then synchronously erases the correspondent physical eraseblock. Like it's not doing it in the background, it's doing it right there, right then, watching it happen. Main character energy fr fr. πŸ”₯

Return-wise: it gives you back zero if everything's slay, and a negative error code if something went off. 😭

🚨 And heads up β€” if the volume is damaged because of an interrupted update, this function just returns immediately with the -EBADF code. No drama, no erasing, just straight back out the door. πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/mtd/ubi/kapi.c, plus the whole friend group:


⭐ And that's the whole page, bestie β€” go erase something (safely). ⭐

Sign-off time πŸŽ€: this one lives at ./drivers/mtd/ubi, dated October 2026. Catch you in the next manpage, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from