nbddump1
Hexdump the content of a disk over nbd
Usage
nbddump [{-n
N | --length
N}]
[{-o
N | --offset
N}]
NBD
NBD {:=
nbd:// ... | nbd+unix://
(or
other
URI
formats)}
nbddump --help
nbddump --version
Overview
nbddump prints the content of a disk from an NBD server using the usual hexdump format:
$ nbddump nbd://localhost0000: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │················│0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │················│☆0100: 68 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 00 00 00 │hello, world!···│0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │················│☆1000: 00 00 00 21 │···! │
Output format
The first field (before the ":") is the offset within the file, in hexadecimal.
The second field shows the hex codes of bytes read from the file.
The third field shows the ASCII equivalent characters (if printable).
A splat character ("☆") indicates lines of repeated output which have been squashed. (Note this is not just for lines of zero bytes, but any case where the next line shown would be the same as the previous line.)
Subprocess
nbddump can also run an NBD server as a subprocess. This requires an NBD server which understands systemd socket activation, such as qemu-nbd(8) or nbdkit(1).
For example, to dump out a qcow2 file as raw data:
$ nbddump -- [ qemu-nbd -r -f qcow2 file.qcow2 ]
To dump out an empty floppy disk created by nbdkit-floppy-plugin(1):
$ mkdir /var/tmp/empty$ nbddump -- [ nbdkit floppy /var/tmp/empty ]0000: 00 00 00 4d 53 57 49 4e 34 2e 31 00 00 00 00 00 |...MSWIN4.1.....|0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|☆01b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fe |................|01c0: ff ff 0c fe ff ff 00 08 00 00 80 00 00 00 00 00 |................|
To dump out some test data using nbdkit-data-plugin(1):
$ nbddump -- [ nbdkit data ' @0x1000 "hello!" ' ]0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │················│☆1000: 68 65 6c 6c 6f 21 │hello! │
Note that "[ ... ]" are separate parameters, and must be surrounded by spaces. "--" separates nbddump parameters from subprocess parameters.
Options
-
--help -
Display brief command line help and exit.
-
--color
-
--colour
-
--no-color
-
--no-colour -
Enable or disable ANSI colours in output. By default we use colours if the output seems to be a terminal, and disable them if not.
-
--length=N
-
--limit=N
-
-n N -
Dump up to N bytes and then stop.
-
--offset=N
-
--skip=N
-
-o N -
Start the dump at offset N bytes.
-
-V
-
--version -
Display the package name and version and exit.
Releases
3 releases since Debian 12 (Bookworm); the text changed 2 times.
--limit since Debian 13 (Trixie);
--offset since Debian 13 (Trixie);
--skip since Debian 13 (Trixie);
-o since Debian 13 (Trixie).