NVME-RPMB(1)
π nvme-rpmb(1) β like, the NVMe Manual page, but make it make sense β¨
okay bestie, so this is nvme-rpmb(1), straight out of the NVMe Manual β and it's literally the page that teaches you how to yeet RPMB commands at an NVMe device. get comfy π«Ά
πΈ NAME πΈ
nvme-rpmb β send RPMB commands to an NVMe device. that's the whole vibe. no cap.
π SYNOPSIS π
nvme rpmb <device> [--cmd=<command> | -c <command>]
[--msgfile=<data-file> | -f <data-file>]
[--keyfile=<key-file> | -g <key-file>]
[--key=<key> | -k <key>] [--msg=<data> | -d <data>]
[--address=<offset> | -o <offset>]
[--blocks=<512 byte sectors> | -b <sectors>]
[--target=<target-id> | -t <id>]
[--output-format=<fmt> | -o <fmt>] [--verbose | -v]
like yes, there are two -os in there π that's not me being messy, that's the page, okay. we don't edit the source. periodt.
β¨ DESCRIPTION β¨
So for the NVMe device you hand it, it sends an nvme rpmb command and gives you the results back. iconic behavior honestly.
The <device> parameter is mandatory β it's giving "you literally cannot skip this" β and an NVMe character device must be specified (ex: /dev/nvme0).
The way it works: if the given device supports RPMB targets, the command you gave with --cmd or -c shall be sent to the controller. But if your NVMe device doesn't support RPMB targets? Then a message indicating the same shall be printed, along with the controller register values related to RPMB. so you get a consolation prize of register values π
π OPTIONS π
-c <command>,--cmd=<command>β the RPMB command to be sent to the device. bestie, it can be one of these:infoβ print information regarding supported RPMB targets and access and total sizes. No further arguments are required. (the "just vibes, no setup" option π)program-keyβ program the 'key' specified with the-koption, or the key read from the file specified with the--keyfileoption, to the specified RPMB target given with--targetor-toptions. Per spec, this is a one time action which can't be undone. π so like... be SO sure. this is not a "whoopsie undo" situation. no take-backsies, fr fr.read-counterβ read the 'write counter' of the specified RPMB target. The counter value read is printed onto STDOUT. little number, big meaning π₯read-configβ read 512 bytes of device configuration block data of the specified RPMB target of the NVMe device. The data read is written to the input file specified with--msgfileor-foption. (yes, it says "input file" for a read β that's the page, we don't touch it π )write-configβ write 512 byes of device configuration block data from the file specified by--msgfileor-foptions to the RPMB target specified with--targetor-toptions. (and yes, it says "byes" β genuinely iconic typo, keeping it β¨)read-dataβ supports authenticated data reading from the specified RPMB target (--targetor-toption) at the given offset specified with--addressor-ooption, using the key specified using--keyfileor-koptions.--blocksor-ooption should be given to read the amount of data to be read in 512 byte blocks.write-dataβ supports authenticated data writing to the specified RPMB target (--targetor-toption) at the given offset specified with--addressor-ooption, using the key specified using--keyfileor-koptions.--blocksor-ooption should be given to indicate the amount of data to be written in 512 byte blocks.
For data transfer (read/write) commands, if the specified size is not within the total size supported by a target, the request is failednvme-rpmbwithout sending it to device. RPMB target0is used as the default target if--targetor-tis not specified.0x0is used as the default address if no-addressor-ooption is specified,
(yes, -address with one dash, and yes, that trailing comma β we're keeping the source exactly as it is. main character energy means respecting the original π«Ά)
-t <target>,--target=<target>β RPMB target id. This should be one of the supported RPMB targets as reported by theinfocommand. If nothing is given, the default of0is used as the RPMB target. defaults are a gift π-k <key>,--key=<key>,-g <key-file>,--keyfile=<key-file>β the authentication key to be used for read/write commands. This should have already been programmed by theprogram-keycommand for the given target. Key can be specified on the command line using--keyor-koptions. Key can also be specified using the file argument specified with--keyfileor-goptions. two ways to serve the same key, choose your fighter β-f <data-file>,--msgfile=<data-file>β name of the file to be used for data transfer commands (read or write). For read command, if an existing file is specified, it will be appended. not overwritten, appended. the way that matters π-d <data>,--msg=<data>β these options provide the data on the command line itself. right there. in the open. bold of you, honestly π-o <offset>,--address=<offset>β the address (in 512 byte sector offset from0) to be used for data transfer commands (read or write) for a specified RPMB target.-b,--blocks=<sectors>β the size in 512 byte sectors to be used for data transfer commands (read or write) for a specified RPMB target.-o <fmt>,--output-format=<fmt>β set the reporting format tonormal,jsonorbinary. Only one output format can be used at a time. pick one, babe, you can't have all three π¦-v,--verboseβ increase the information detail in the output. more words, more lore π
π EXAMPLES π
- Print RPMB support information of an NVMe device
# nvme rpmb /dev/nvme0 --cmd=info
- Program
SecretKeyas authentication key for target 1
# nvme rpmb /dev/nvme0 --cmd=program-key -key='SecretKey' --target=1
- Read current write counter of RPMB target 0
# nvme rpmb /dev/nvme0 --cmd=read-counter --target=0
- Read configuration data block of target 2 into
config.binfile
# nvme rpmb /dev/nvme0 --cmd=read-config --target=2 -f config.bin
- Write 200 blocks of (512 bytes) from
input.binonto target 0
# nvme rpmb /dev/nvme0 -c write-data -t 0 -f input.bin -b 200 -k 'SecretKey'
- Read 200 blocks of (512 bytes) from target 2, at offset
0x100and save the - data onto
output.bin
# nvme rpmb /dev/nvme0 -c read-data -t 2 -f out.bin -b 200 -o 0x100
(yes, items 6 and 7 are split like that in the original β the sentence really does break across two bullets and the command lands after. we preserve. we don't fix. that's the rule π β¨)
π§ NVME π§
Part of the nvme-user suite. you're in good company, bestie π
and that's the whole page!! π this was NVMe Β· 11/04/2025 Β· go forth and RPMB responsibly, my love β especially with program-key, because that one's forever ππ₯π
π¦ where this page comes from
- alpine 3.23: nvme-cli-doc 2.16-r1 Β· GPL-2.0-or-later
- alpine 3.24: nvme-cli-doc 2.16-r1 Β· GPL-2.0-or-later
- nixpkgs unstable: nvme-cli 2.16
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms