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 -k option, or the key read from the file specified with the --keyfile option, to the specified RPMB target given with --target or -t options. 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 --msgfile or -f option. (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 --msgfile or -f options to the RPMB target specified with --target or -t options. (and yes, it says "byes" β€” genuinely iconic typo, keeping it ✨)
    • read-data β€” supports authenticated data reading from the specified RPMB target (--target or -t option) at the given offset specified with --address or -o option, using the key specified using --keyfile or -k options. --blocks or -o option 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 (--target or -t option) at the given offset specified with --address or -o option, using the key specified using --keyfile or -k options. --blocks or -o option 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 failed nvme-rpmb without sending it to device. RPMB target 0 is used as the default target if --target or -t is not specified. 0x0 is used as the default address if no -address or -o option 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 the info command. If nothing is given, the default of 0 is 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 the program-key command for the given target. Key can be specified on the command line using --key or -k options. Key can also be specified using the file argument specified with --keyfile or -g options. 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 from 0) 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 to normal, json or binary. 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 🌈

  1. Print RPMB support information of an NVMe device
# nvme rpmb /dev/nvme0 --cmd=info
  1. Program SecretKey as authentication key for target 1
# nvme rpmb /dev/nvme0 --cmd=program-key -key='SecretKey' --target=1
  1. Read current write counter of RPMB target 0
# nvme rpmb /dev/nvme0 --cmd=read-counter --target=0
  1. Read configuration data block of target 2 into config.bin file
# nvme rpmb /dev/nvme0 --cmd=read-config --target=2 -f config.bin
  1. Write 200 blocks of (512 bytes) from input.bin onto target 0
# nvme rpmb /dev/nvme0 -c write-data -t 0 -f input.bin -b 200 -k 'SecretKey'
  1. Read 200 blocks of (512 bytes) from target 2, at offset 0x100 and save the
  2. 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