nbddump(1)
π nbddump β hexdump the content of a disk over NBD β¨
okay so bestie, welcome to nbddump(1) from the LIBNBD squad π«Ά this is the part of the libnbd family that lets you literally look at a disk over NBD. like, peek inside. with your eyeballs. iconic behaviour fr fr π
β¨ SYNOPSIS β¨
nbddump [-n N|--length N] [-o N|--offset N] NBD
"NBD" is an NBD URI or a subprocess, and yes those are your two flavours π:
NBD := nbd://... | nbd+unix:// (or other URI formats)
| [ CMD ARGS ... ]
also, the two little help-me-out modes:
nbddump --help
nbddump --version
πΈ DESCRIPTION πΈ
nbddump prints the content of a disk from an NBD server using the usual hexdump format, and ngl the output is so satisfying to look at ππ:
$ nbddump nbd://localhost
0000: 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 π
okay so let's break down the ~anatomy~ of a line, because it's giving three fields and each one is doing its own thing:
- the first field (everything before the
":") is the offset within the file, in hexadecimal. that's your "where am I" β¨ - the second field shows the hex codes of bytes read from the file. the raw material π
- the third field shows the ASCII equivalent characters β but only if printable π
and then there's the splat character "β" β a literal little star πβ β which means lines of repeated output have been squashed. and listen, bestie, this is not just for lines of zero bytes: it's any case where the next line shown would be the same as the previous line. so don't come for me saying "why is there a star on my non-zero data" because that's the whole point π«Ά
π¦ Subprocess π¦
nbddump can also run an NBD server as a subprocess, which is highkey the coolest feature ngl π₯. this requires an NBD server which understands systemd socket activation β like 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) β yes, an empty floppy, main character energy πΎβ¨:
$ 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! β
β οΈ okay important bestie note:"[ ... ]"are separate parameters, and they must be surrounded by spaces. and"--"separatesnbddumpparameters from subprocess parameters. do not skip the spaces, i am begging π
π OPTIONS π
--helpβ display brief command line help and exit. your little "what do i do" button π--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. (and yes, they accept both spellings, we're inclusive here π«Άπ)--length=N,--limit=N,-n Nβ dump up to N bytes and then stop. so you can be like "okay i've seen enough" π--offset=N,--skip=N,-o Nβ start the dump at offset N bytes. skip to the good part π΅-V,--versionβ display the package name and version and exit. the classic π
π SEE ALSO π
go check out the whole fam, they're all iconic π:
libnbd(3), nbdcopy(1), nbddiscard(1), nbdfuse(1), nbdinfo(1), nbdsh(1), nbdzero(1), hexdump(1), file(1), qemu-img(1), nbdkit(1), nbdkit_debug_hexdump(3), qemu-nbd(8).
π AUTHORS π
Richard W.M. Jones β the legend themselves π«‘π
π COPYRIGHT π
Copyright Red Hat
β LICENSE β
okay so legal bit, but make it cute:
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. π
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. (like, fr fr, no promises π)
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
and that's the page, bestie!! π¦ this little gem is libnbd-1.25.8, dated 2026-10-13 β go hexdump something and slay π
β¨π
π¦ where this page comes from
- centos-stream 10: libnbd 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms