.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Podwrapper::Man 1.20.0 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "nbddump 1" .TH nbddump 1 2024-05-31 libnbd-1.20.0 LIBNBD .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME nbddump \- hexdump the content of a disk over NBD .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& nbddump NBD .Ve .PP \&\f(CW\*(C`NBD\*(C'\fR is an NBD URI or subprocess: .PP .Vb 2 \& NBD := nbd://... | nbd+unix:// (or other URI formats) \& | [ CMD ARGS ... ] .Ve .PP .Vb 1 \& nbddump \-\-help .Ve .PP .Vb 1 \& nbddump \-\-version .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" nbddump prints the content of a disk from an NBD server using the usual hexdump format: .PP .Vb 8 \& $ 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 │···! │ .Ve .SS "Output format" .IX Subsection "Output format" The first field (before the \f(CW\*(C`:\*(C'\fR) is the offset within the file, in hexadecimal. .PP The second field shows the hex codes of bytes read from the file. .PP The third field shows the ASCII equivalent characters (if printable). .PP A splat character (\f(CW\*(C`☆\*(C'\fR) 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.) .SS Subprocess .IX Subsection "Subprocess" nbddump can also run an NBD server as a subprocess. This requires an NBD server which understands systemd socket activation, such as \&\fBqemu\-nbd\fR\|(8) or \fBnbdkit\fR\|(1). .PP For example, to dump out a qcow2 file as raw data: .PP .Vb 1 \& $ nbddump \-\- [ qemu\-nbd \-r \-f qcow2 file.qcow2 ] .Ve .PP To dump out an empty floppy disk created by \fBnbdkit\-floppy\-plugin\fR\|(1): .PP .Vb 7 \& $ 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 |................| .Ve .PP To dump out some test data using \fBnbdkit\-data\-plugin\fR\|(1): .PP .Vb 4 \& $ nbddump \-\- [ nbdkit data \*(Aq @0x1000 "hello!" \*(Aq ] \& 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! │ .Ve .PP Note that \f(CW\*(C`[\ ...\ ]\*(C'\fR are separate parameters, and must be surrounded by spaces. \f(CW\*(C`\-\-\*(C'\fR separates nbddump parameters from subprocess parameters. .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-\-help\fR 4 .IX Item "--help" Display brief command line help and exit. .IP \fB\-\-color\fR 4 .IX Item "--color" .PD 0 .IP \fB\-\-colour\fR 4 .IX Item "--colour" .IP \fB\-\-no\-color\fR 4 .IX Item "--no-color" .IP \fB\-\-no\-colour\fR 4 .IX Item "--no-colour" .PD 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. .IP \fB\-\-length=\fRN 4 .IX Item "--length=N" .PD 0 .IP "\fB\-n\fR N" 4 .IX Item "-n N" .PD Dump up to \fIN\fR bytes and then stop. .IP \fB\-V\fR 4 .IX Item "-V" .PD 0 .IP \fB\-\-version\fR 4 .IX Item "--version" .PD Display the package name and version and exit. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBlibnbd\fR\|(3), \&\fBnbdcopy\fR\|(1), \&\fBnbdfuse\fR\|(1), \&\fBnbdinfo\fR\|(1), \&\fBnbdsh\fR\|(1), \&\fBhexdump\fR\|(1), \&\fBfile\fR\|(1), \&\fBqemu\-img\fR\|(1), \&\fBnbdkit\fR\|(1), \&\fBqemu\-nbd\fR\|(8). .SH AUTHORS .IX Header "AUTHORS" Richard W.M. Jones .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright Red Hat .SH LICENSE .IX Header "LICENSE" 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. .PP 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. .PP 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