nbdkit-partition-filter(1)

πŸ’– nbdkit-partition-filter(1) β€” the nbdkit partition filter, bestie edition πŸ’–

okay so this is a page from the NBDKIT manual, and it's literally about a filter called nbdkit-partition-filter. buckle up, it's cute and it's useful πŸŽ€


✨ NAME ✨

nbdkit-partition-filter β€” nbdkit partition filter


🌸 SYNOPSIS 🌸

nbdkit --filter=partition plugin partition=PART [plugin-args...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so nbdkit-partition-filter is a filter, right, and what it does is it limits requests to a single partition inside a disk image that's being served by another plugin. like, one partition only. that's the whole vibe. no cap πŸ’…

partition numbers come from the required partition parameter, and bestie, they count from 1. not 0. from 1. iykyk.

this works exactly like the qemu-nbd -P option, in case you've met that one before 🫢

and the opposite of this filter? that's nbdkit-partitioning-plugin(1), which adds a virtual partition table to a file or files. mirror image energy ✨


πŸŽ€ PARAMETERS πŸŽ€

  • partition=PART β€” the partition number you want to serve. counts from 1, periodt. this parameter is required, so don't come to the function without it πŸ™ˆ
  • partition-sectorsize=SECTOR_SIZE β€” the default here gets picked according to the minimum block size that the underlying device advertises. if that's 512 or 4K, then the sector size is set to that. and if the underlying device doesn't advertise a minimum block size at all, or it's advertising something that isn't 512 or 4K? then the default is 512 bytes. that's the fallback, no drama 🌈

you can also set it manually, and the user may specify 512 or 4096 as the sector size via config. those are the options, bestie, nothing else πŸ‘‘

but however it gets set, this parameter is telling the partition table logic to treat the underlying storage as having the indicated sector size. and that? that's important for MBR and GPT logic using LBA (logical block addressing). like genuinely important, don't skip it πŸ’€


⭐ EXAMPLE ⭐

say disk.img is a partitioned disk image (eg. a virtual machine disk image). to serve the first partition only, you'd go:

nbdkit --filter=partition file disk.img partition=1

and that's it. iconic. ate. πŸ”₯


🧚 FILES 🧚

  • $filterdir/nbdkit-partition-filter.so β€” the filter itself πŸ’–

use nbdkit --dump-config to find the location of $filterdir. that's how you find your filterdir, bestie, go look πŸ‘€


πŸ‘‘ VERSION πŸ‘‘

nbdkit-partition-filter first appeared in nbdkit 1.2. vintage but make it fashion ✨


πŸ’œ SEE ALSO πŸ’œ

nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3), nbdkit-map-filter(1), nbdkit-offset-filter(1), nbdkit-partitioning-plugin(1), nbdkit-protect-filter(1), nbdkit-truncate-filter(1), parted(8).

go read them, they're all part of the squad 🫢


🌟 AUTHORS 🌟

Eric Blake

Richard W.M. Jones


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.

and that's the whole page bestie!! this one's from nbdkit-1.48.1, dated 2026-08-29, and it's the nbdkit-partition-filter(1) page β€” mwah, slay, go partition something πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from