ubi_leb_erase(9)
π 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:
ubi_do_get_device_info(9)ubi_get_device_info(9)ubi_do_get_volume_info(9)ubi_get_volume_info(9)ubi_open_volume(9)ubi_open_volume_nm(9)ubi_get_num_by_path(9)ubi_open_volume_path(9)ubi_close_volume(9)leb_read_sanity_check(9)ubi_leb_read(9)ubi_leb_read_sg(9)ubi_leb_write(9)ubi_leb_unmap(9)ubi_leb_map(9)ubi_is_mapped(9)ubi_sync(9)ubi_register_volume_notifier(9)ubi_unregister_volume_notifier(9)
β 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
- 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