nbddiscard(1)
π nbddiscard(1) β the LIBNBD one, bestie π
okay so real talk, this is the nbddiscard page from the libnbd crew, and it also covers its twin nbdzero (they're literally the same program wearing different hats, iykyk). Buckle up π
β¨ 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
(spot the difference: nbdzero doesn't take -z, because zeroing is its whole thing π
)
πΈ DESCRIPTION πΈ
So nbddiscard discards all the data on a Network Block Device (NBD) endpoint. If the server supports it, this frees up the backing storage and makes the device completely sparse β like, hollowed out, ghost mode π». 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 thing, except the data gets replaced by allocated, zeroed blocks instead of just vanishing into the void.
β οΈ bestie. ALL data in the discarded or zeroed region is PERMANENTLY ERASED. Not "moved to trash", not "recoverable later", gone. π
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-zthat it already reads as zero. Like a vibe check for your disk π no changes, just gossip.--fast-zeroβ Attempt fast zero (seenbd_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. So it's either speeding or it's honest β no in-between ποΈ
-h,--helpβ Display brief command line help and exit. Your little escape hatch π«Ά-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. Portion control, but for erasure π-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. Pick your starting line β¨-q,--quietβ Quiet mode, do not print any warnings. Shhh π€«-v,--verboseβ Enable verbose libnbd messages. This has the same effect as setting the environment variableLIBNBD_DEBUG=1. Everything, out loud, all at once π-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.
π fr fr: this is the "skip the safety net" flag. Great in scripts, absolutely feral at a keyboard. Use it on purpose.
-z,--zeroβ Zero, instead of discarding.nbdzerois justnbddiscardwith-z. Same icon, different setting π«
π 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).
(the whole friend group, go say hi π«Ά)
π 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
and that's the whole page, bestie π this one's from libnbd-1.24.4, dated 2026-10-13, and it's giving "erase responsibly" energy. mwah π
π¦ where this page comes from
- arch rolling: libnbd 1.24.4-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms