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 "--" separates nbddump parameters 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 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