Device Media StateΒΆ
Before submitting IO, then it is useful to obtain the state of the device
media, this can by done via the nvm_cmd rprt_all
and nvm_cmd rprt_lun
.
nvm_cmd rprt_all /dev/nvme0n1
Which will yield device information as shown below:
# nvm_cmd_rprt: (nil)
rprt:
ndescr: 47168
rprt_descr:
- { slba: 0x0000000000000000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x0000000000002000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x0000000000004000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x0000000000006000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x0000000000008000, cnlb: 0x1800, wp: 0x0000000000001800, cs: 0x02, ct: 0x01, wli: 0x00 }
- { slba: 0x000000000000A000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
... block address output omitted for brevity ...
- { slba: 0x000000001FB66000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB68000, cnlb: 0x1800, wp: 0x000000000000ffff, cs: 0x08, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB6A000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB6C000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB6E000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB70000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB72000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB74000, cnlb: 0x1800, wp: 0x000000000000ffff, cs: 0x08, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB76000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB78000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB7A000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB7C000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB7E000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB80000, cnlb: 0x1800, wp: 0x000000000000ffff, cs: 0x08, ct: 0x01, wli: 0x00 }
- { slba: 0x000000001FB82000, cnlb: 0x1800, wp: 0x0000000000000000, cs: 0x01, ct: 0x01, wli: 0x00 }
The output is abbreviated as it contains states for all chunks.
Note
The slba
is on device-format use nvm_addr_dev2gen
to convert
it to general format.