.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Podwrapper::Man 1.24.0 (Pod::Simple 3.45) .\" .\" 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "nbddiscard 1" .TH nbddiscard 1 2025-12-16 libnbd-1.24.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 nbddiscard, nbdzero \- discard or zero all data on a Network Block Device .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& nbddiscard [\-c|\-\-check] [\-z|\-\-zero] [\-\-fast\-zero] \& [\-q|\-\-quiet] [\-v|\-\-verbose] [\-y|\-\-yes] \& [\-o|\-\-offset OFFSET] [\-l|\-\-length LENGTH] NBD\-URI \& \& nbddiscard \-V|\-\-version \& \& nbddiscard \-h|\-\-help .Ve .PP .Vb 3 \& nbdzero [\-c|\-\-check] [\-\-fast\-zero] \& [\-q|\-\-quiet] [\-v|\-\-verbose] [\-y|\-\-yes] \& [\-o|\-\-offset OFFSET] [\-l|\-\-length LENGTH] NBD\-URI \& \& nbdzero \-V|\-\-version \& \& nbdzero \-h|\-\-help .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" nbddiscard discards all data on a Network Block Device (NBD) endpoint. If supported, this frees up the backing storage and makes the device completely sparse. For example, if an NBD server is running locally on port 10809 you could do: .PP .Vb 3 \& $ nbddiscard nbd://localhost \& PERMANENTLY ERASE everything on nbd://localhost bytes 0 \- 1073741823 \& (y/N)? y .Ve .PP nbdzero is the same, but the data is replaced by allocated, zeroed blocks. .PP \&\fBAll data in the discarded or zeroed region is PERMANENTLY ERASED.\fR .PP For information about NBD URIs, see \fBnbd_connect_uri\fR\|(3). .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-c\fR 4 .IX Item "-c" .PD 0 .IP \fB\-\-check\fR 4 .IX Item "--check" .PD Rather than modify the disk, merely check whether it is already sparse, or with \fI\-z\fR that it already reads as zero. .IP \fB\-\-fast\-zero\fR 4 .IX Item "--fast-zero" Attempt fast zero (see \fBnbd_can_fast_zero\fR\|(3)), which implies \&\fI\-\-zero\fR. .Sp Not all servers support the fast zero flag, but those that do promise that an attempted fast zero operation will either complete more quickly than explicitly writing zeroes to the image, or that it will immediately fail because the operation is not inherently faster. .IP \fB\-h\fR 4 .IX Item "-h" .PD 0 .IP \fB\-\-help\fR 4 .IX Item "--help" .PD Display brief command line help and exit. .IP "\fB\-l\fR LENGTH" 4 .IX Item "-l LENGTH" .PD 0 .IP "\fB\-\-length\fR LENGTH" 4 .IX Item "--length LENGTH" .PD Instead of discarding to the end of the disk, discard only length bytes. You can use the normal suffixes like \f(CW\*(C`K\*(C'\fR, \f(CW\*(C`M\*(C'\fR etc. .IP "\fB\-o\fR OFFSET" 4 .IX Item "-o OFFSET" .PD 0 .IP "\fB\-\-offset\fR OFFSET" 4 .IX Item "--offset OFFSET" .PD Instead of starting from the beginning of the disk, start at the given offset. You can use the normal suffixes like \f(CW\*(C`K\*(C'\fR, \f(CW\*(C`M\*(C'\fR etc. .IP \fB\-q\fR 4 .IX Item "-q" .PD 0 .IP \fB\-\-quiet\fR 4 .IX Item "--quiet" .PD Quiet mode, do not print any warnings. .IP \fB\-v\fR 4 .IX Item "-v" .PD 0 .IP \fB\-\-verbose\fR 4 .IX Item "--verbose" .PD Enable verbose libnbd messages. This has the same effect as setting the environment variable \f(CW\*(C`LIBNBD_DEBUG=1\*(C'\fR .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. .IP \fB\-y\fR 4 .IX Item "-y" .PD 0 .IP \fB\-\-yes\fR 4 .IX Item "--yes" .PD Assume yes to all questions. This will proceed straight to erasing your data. Use this in scripts to avoid interactivity. .IP \fB\-z\fR 4 .IX Item "-z" .PD 0 .IP \fB\-\-zero\fR 4 .IX Item "--zero" .PD Zero, instead of discarding. nbdzero is just nbddiscard with \fI\-z\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBlibnbd\fR\|(3), \&\fBlibnbd\-python\fR\|(3), \&\fBnbd_connect_uri\fR\|(3), \&\fBnbdcopy\fR\|(1), \&\fBnbddump\fR\|(1), \&\fBnbdfuse\fR\|(1), \&\fBnbdinfo\fR\|(1), \&\fBnbdsh\fR\|(1), \&\fBnbdublk\fR\|(1), \&\fBblkdiscard\fR\|(8), \&\fBqemu\-img\fR\|(1). .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