nbdkit-nozero-filter(1)
π nbdkit-nozero-filter(1) π
okay so bestie, you found your way to nbdkit-nozero-filter(1) β part of the NBDKIT manual pages, and honestly? this one is a whole mood. it's a filter that is petty on purpose. let's get into it π«Ά
β¨ NAME β¨
nbdkit-nozero-filter β the nbdkit nozero filter. that's it, that's the name, she's simple and she knows what she wants πββοΈ
π SYNOPSIS π
nbdkit --filter=nozero plugin [plugin-args...] \
[zero-mode=MODE] [fast-zero-mode=MODE]
π¦ DESCRIPTION π¦
so nbdkit-nozero-filter is a filter that intentionally disables the efficient handling of sparse file holes (aka ranges of all-zero bytes) across the NBD protocol. like, on purpose. deliberately. it's giving chaos but make it useful π
why would anyone do this?? two reasons, and they're both valid:
- to evaluate timing differences between naive connections vs. sparse-aware ones β±οΈ
- to test client or server fallbacks π§ͺ
that's it. that's the gig. no cap.
π PARAMETERS π
the parameters zero-mode and fast-zero-mode are both optional, and they control which mode the filter will use. pick your fighter π
zero-mode=none,zeromode=noneβ zero support is not advertised to the client at all. clients have to explicitly write any regions of zero like any other normal write. no shortcuts, no glamour, just work. this is the default if thezeromodeparameter is not specified.zero-mode=emulate,zeromode=emulateβ zero support is advertised, but it's emulated by the filter using the plugin'spwritecallback. and it does this regardless of whether the plugin itself has a more efficientzerocallback. so like, even if your plugin could do it better, the filter says "no bestie, we're doing it the long way" πzero-mode=notrim,zeromode=notrimβ (nbdkit β₯ 1.14) β zero requests get forwarded on to the plugin, EXCEPT the plugin will never see theNBDKIT_MAY_TRIMflag. this can help determine if the client permitting trimming during zero operations actually makes a difference. β οΈ it is an error to request this mode if the plugin lacks thezerocallback.zero-mode=plugin,zeromode=pluginβ (nbdkit β₯ 1.16) β zero requests are forwarded on to the plugin, unchanged by the filter. this mode is helpful when you're experimenting with thefastzeromodeparameter π¬. β οΈ it is an error to request this mode if the plugin lacks thezerocallback.fast-zero-mode=none,fastzeromode=noneβ (nbdkit β₯ 1.16) β support for fast zeroing is not advertised to the client. that's it. nothing to see here π«fast-zero-mode=slow,fastzeromode=slowβ (nbdkit β₯ 1.16) β fast zero support is advertised to the client, but every single fast zero request results in an immediateENOTSUPfailure instead of performing any fallback attempts. it says yes and then immediately says no. iconic behavior tbh πfast-zero-mode=ignore,fastzeromode=ignoreβ (nbdkit β₯ 1.16) β π¨ this mode is unsafe π¨ β fast zero support is advertised to the client, but all fast zero requests behave as if the fast zero flag had not been included. this behavior is typically contrary to the NBD specification, but it can be useful for comparison against the actual fast zero implementation to see if fast zeroes make a difference. dangerous? yes. useful for science? also yes πfast-zero-mode=default,fastzeromode=defaultβ (nbdkit β₯ 1.16) β this mode is the default. here's how she pairs up:- when paired with
zero-mode=emulate, fast zeroes are advertised but fast zero requests always fail (similar toslow) - when paired with
zero-mode=notrimorzero-mode=plugin, fast zero support is left to the plugin (although in the latter case, the nozero filter could be omitted for the same behavior)
- when paired with
π EXAMPLES π
exhibit one β serve the file disk.img, but force the client to write zeroes explicitly rather than with NBD_CMD_WRITE_ZEROES:
nbdkit --filter=nozero file disk.img
exhibit two β serve the file disk.img, allowing the client to take advantage of less network traffic via NBD_CMD_WRITE_ZEROES, but fail any fast zero requests up front and force all other zero requests to write data explicitly rather than punching any holes:
nbdkit --filter=nozero file zero-mode=emulate disk.img
exhibit three β serve the file disk.img, but do not advertise fast zero support to the client even if the plugin supports it:
nbdkit --filter=nozero file zero-mode=plugin fast-zero-mode=none disk.img
π§ FILES π§
$filterdir/nbdkit-nozero-filter.soβ the filter itself π
use nbdkit --dump-config to find the location of $filterdir. go get her π
β VERSION β
nbdkit-nozero-filter first appeared in nbdkit 1.4. a legend from the start π
πΈ SEE ALSO πΈ
the whole squad, go read them too:
nbdkit(1)nbdkit-file-plugin(1)nbdkit-filter(3)nbdkit-fua-filter(1)nbdkit-multi-conn-filter(1)nbdkit-nocache-filter(1)nbdkit-noparallel-filter(1)nbdkit-noextents-filter(1)
π AUTHORS π
Eric Blake π«Ά
π COPYRIGHT π
Copyright Red Hat
π LICENSE π
redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
okay that's the whole page bestie, you're officially smarter than you were five minutes ago π β¨ this was nbdkit-1.48.1, dated 2026-08-29, and she ate. no crumbs left. bye pookie π«Άππ
π¦ where this page comes from
- fedora 44: nbdkit-basic-filters 1.48.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms