create_bbt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… create_bbt β€” the Kernel API Manual page, but make it cute ✨

okay so this is create_bbt(9) from the Kernel API Manual and honestly? it's a baddie little function. let's get into it πŸŽ€


🌸 NAME

create_bbt β€” [GENERIC] create a bad block table by scanning the device. that's it. that's the whole vibe. it scans, it tables, it slays πŸ’…


✨ SYNOPSIS

int create_bbt (struct nand_chip *this , uint8_t *buf , struct
       nand_bbt_descr *bd , int chip );

like yes, it returns an int, and yes, those spaces before the commas are just how the manpage formatted it β€” we don't touch the code, bestie, not ever πŸ™ˆ


πŸ¦‹ ARGUMENTS

  • this β€” the NAND chip object itself, the main character of this whole operation πŸ‘‘
  • buf β€” a temporary buffer. it's giving "grab a scratchpad, we're working" energy πŸ“
  • bd β€” the descriptor for the good/bad block search pattern, aka the little instruction sheet for what counts as bad. iykyk πŸ”
  • chip β€” create the table for a specific chip, or -1 to read all chips. heads up though: this only applies if the NAND_BBT_PERCHIP option is set. no option, no per-chip life, fr fr πŸ’€

πŸ’– DESCRIPTION

so what it does is: create a bad block table by scanning the device for the given good/bad block identify pattern. that's literally the whole thing. it scans, it finds the pattern, it builds the table. iconic behaviour, no notes 🌈⭐


πŸ”₯ SEE ALSO

kernel file ./drivers/mtd/nand/raw/nand_bbt.c β€” and honestly the whole friend group came through for this one, so let's give them their flowers πŸ’:

check_pattern(9), check_short_pattern(9), add_marker_len(9), read_bbt(9), read_abs_bbt(9), scan_read_oob(9), read_abs_bbts(9), search_bbt(9), search_read_bbts(9), get_bbt_block(9), mark_bbt_block_bad(9), write_bbt(9), nand_memory_bbt(9), check_create(9), nand_update_bbt(9), mark_bbt_region(9), verify_bbt_descr(9), nand_scan_bbt(9), nand_create_badblock_pattern(9), nand_create_bbt(9), nand_isreserved_bbt(9), nand_isbad_bbt(9), nand_markbad_bbt(9)

like, genuinely the whole squad. obsessed 🫢


and that's the page!! this little gem lives in ./drivers/mtd/nand/raw, dated October 2026, and it's filed under create_bbt(9) in the Kernel API Manual. go forth and scan those bad blocks, bestie β€” periodt πŸ’œβœ¨

πŸ“¦ where this page comes from