NAME

nbddiscard, nbdzero - discard or zero all data on a Network Block Device

SYNOPSIS

 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
 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

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:

 $ nbddiscard nbd://localhost
 PERMANENTLY ERASE everything on nbd://localhost bytes 0 - 1073741823
 (y/N)? y

nbdzero is the same, but the data is replaced by allocated, zeroed blocks.

All data in the discarded or zeroed region is PERMANENTLY ERASED.

For information about NBD URIs, see nbd_connect_uri(3).

OPTIONS

-c
--check

Rather than modify the disk, merely check whether it is already sparse, or with -z that it already reads as zero.

--fast-zero

Attempt fast zero (see nbd_can_fast_zero(3)), which implies --zero.

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.

-h
--help

Display brief command line help and exit.

-l LENGTH
--length LENGTH

Instead of discarding to the end of the disk, discard only length bytes. You can use the normal suffixes like K, M etc.

-o OFFSET
--offset OFFSET

Instead of starting from the beginning of the disk, start at the given offset. You can use the normal suffixes like K, M etc.

-q
--quiet

Quiet mode, do not print any warnings.

-v
--verbose

Enable verbose libnbd messages. This has the same effect as setting the environment variable LIBNBD_DEBUG=1

-V
--version

Display the package name and version and exit.

-y
--yes

Assume yes to all questions. This will proceed straight to erasing your data. Use this in scripts to avoid interactivity.

-z
--zero

Zero, instead of discarding. nbdzero is just nbddiscard with -z.

SEE ALSO

libnbd(3), libnbd-python(3), nbd_connect_uri(3), nbdcopy(1), nbddump(1), nbdfuse(1), nbdinfo(1), nbdsh(1), nbdublk(1), blkdiscard(8), qemu-img(1).

AUTHORS

Richard W.M. Jones

COPYRIGHT

Copyright Red Hat

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.

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.

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