nvm_bbt

NVM bad-block-table (nvm_bbt_*) -- Ver { major(0), minor(1), patch(5) }

Retrieve (get) and modify (set/mark) the bad block table

Usage:
 nvm_bbt          get dev_path ch lun [-h] [-v]
 nvm_bbt        set_f dev_path ch lun [-h] [-v]
 nvm_bbt        set_b dev_path ch lun [-h] [-v]
 nvm_bbt        set_g dev_path ch lun [-h] [-v]
 nvm_bbt        set_d dev_path ch lun [-h] [-v]
 nvm_bbt        set_h dev_path ch lun [-h] [-v]
 nvm_bbt       mark_f dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_bbt       mark_b dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_bbt       mark_g dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_bbt       mark_d dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_bbt       mark_h dev_path 0xADDR [0xADDR...] [-h] [-v]

Options:
 -h       Print usage
 -v       Dump CLI state to stdout

See: http://lightnvm.io/liblightnvm/cli/ for usage examples

Tip

See section Environment Variables for a full list of environment variables modifying command behavior

See also

See nvm_addr on how to construct the 0xADDR parameter

Update block state

Set state of block 4 in LUN 2 in channel 1 as grown bad.

sudo nvm_bbt mark_g /dev/nvme0n1 0x0102000000000004
# nvm_bbt_mark
0x0102000000000004: {ch: 01, lun: 02, pl: 0, blk: 0004, pg: 000, sec: 0}

Note

SYSADMIN priviliges are required to modify the BBT

Retrieve block state

Retrieve the entire block state for all blocks in LUN 2 in Channel 1

nvm_bbt get /dev/nvme0n1 1 2
# nvm_bbt_get
bbt:
  addr: 0x0102000000000000: {ch: 01, lun: 02, pl: 0, blk: 0000, pg: 000, sec: 0}
  nblks: 2040
  npl_blks: 1020
  pl_blks:
    0000: [ FREE(0), FREE(0) ]
    0001: [ FREE(0), FREE(0) ]
    0002: [ FREE(0), FREE(0) ]
    0003: [ FREE(0), FREE(0) ]
    0004: [ GBAD(2), GBAD(2) ]
    0005: [ FREE(0), FREE(0) ]
    0006: [ FREE(0), FREE(0) ]
    0007: [ FREE(0), FREE(0) ]
    0008: [ FREE(0), FREE(0) ]
... output for entries 10 to 1013 omitted for brevity ...
    1013: [ FREE(0), FREE(0) ]
    1014: [ FREE(0), FREE(0) ]
    1015: [ FREE(0), FREE(0) ]
    1016: [ FREE(0), FREE(0) ]
    1017: [ FREE(0), FREE(0) ]
    1018: [ FREE(0), FREE(0) ]
    1019: [ FREE(0), FREE(0) ]
  nbad: 1
  gbad: 1
  ndmrk: 0
  nhmrk: 0