nvm_addr

NVM address (nvm_addr_*) -- Ver { major(0), minor(1), patch(5) }

Construct and convert addresses

Usage:
 nvm_addr   s12_to_gen dev_path ch lun blk pl pg sec [-h] [-v] [-t]
 nvm_addr   s20_to_gen dev_path pugrp punit chunk sectr [-h] [-v] [-t]
 nvm_addr      gen2dev dev_path 0xADDR [0xADDR...] [-h] [-v] [-t]
 nvm_addr      dev2gen dev_path 0xVAL [0xVAL...] [-h] [-v] [-t]
 nvm_addr      gen2off dev_path 0xADDR [0xADDR...] [-h] [-v] [-t]
 nvm_addr      off2gen dev_path val [val...] [-h] [-v] [-t]
 nvm_addr      gen2lpo dev_path 0xADDR [0xADDR...] [-h] [-v] [-t]
 nvm_addr      lpo2gen dev_path val [val...] [-h] [-v] [-t]
 nvm_addr   gen_as_geo dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_addr   dev_as_geo dev_path 0xVAL [0xVAL...] [-h] [-v]

Options:
 -h       Print usage
 -v       Dump CLI state to stdout
 -t       Print only the address

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

Tip

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

Address Formats

The command-line parameter 0xADDR is a textual hexadecimal representation of a physical address in generic format.

Generic Format

The relative location in device geometry can be used to construct physical address in generic format, e.g. pugrp(2), punit(1), chunk(0), sectr(10):

nvm_addr s20_to_gen /dev/nvme0n1 4 2 142 0
naddrs: 1
addrs:
  - {val: 0x0402008e00000000, pugrp: 04, punit: 02, chunk: 0142, sectr: 0000}

Device Format

A physical address in device format can be construct from the physical address in generic format:

nvm_addr gen2dev /dev/nvme0n1 0x020100000000000a
- {gen: 0x020100000000000a, dev: 0x000000000900000a}

Terse Format

Prints the just the address:

nvm_addr s20_to_gen /dev/nvme0n1 0 3 42 134 -t
0x0003002a00000086
nvm_vblk erase /dev/nvme0n1 $(sudo nvm_addr s20_to_gen /dev/nvme0n1 0 0 3 4 -t)
vblk:
  dev: {pmode: 'SNGL'}
  nblks: 1
  nmbytes: 24
  pos_write: 0
  pos_read: 0
  flags: 0x08c8
naddrs: 1
addrs:
  - {val: 0x0000000300000004, pugrp: 00, punit: 00, chunk: 0003, sectr: 0004}
nvm_vblk_erase: {elapsed: 0.0054, mb: 24.00, mbsec: 4483.72}