nbdkit-offset-filter(1)

πŸ’– nbdkit-offset-filter(1) πŸ’–

okay bestie, so this is the nbdkit-offset-filter page β€” it lives in section 1 of the NBDKIT manual, and it's genuinely one of the cutest little filters in the whole fam. let's get into it ✨


🌸 NAME 🌸

nbdkit-offset-filter β€” the nbdkit offset filter. that's it, that's the name, she's simple and she serves πŸ’…


✨ SYNOPSIS ✨

nbdkit --filter=offset plugin offset=OFFSET range=LENGTH [plugin-args...]

πŸ¦‹ DESCRIPTION πŸ¦‹

nbdkit-offset-filter is a filter that limits requests to the byte range [offset .. offset+range-1] inside some other plugin. so like… it's a little window. a crop. a slice of the pie πŸ“ you pick where it starts and how much you want, and everything outside that range is simply not invited to the party.

no cap, that's the whole vibe.


πŸŽ€ PARAMETERS πŸŽ€

  • offset=OFFSET β€” the start offset. and listen, the offset must be β‰₯ 0, we do not do negative offsets here, bestie πŸ™ˆ

this one's optional! if you don't hand it over, offset=0 is assumed. very demure, very default.

  • range=LENGTH β€” the length of data to serve. how much you're getting, essentially.

also optional!! if you don't give it, the range gets served starting from the offset all the way through to the end of the underlying file/device. so like, from there to the finish line 🏁

🚨 okay important: it is an error if the offset and/or range specify data that lies beyond the end of the underlying device. that's a whole problem. if you need to truncate or extend the size of plugins, go talk to nbdkit-truncate-filter(1) instead, she handles that.

🌈 EXAMPLES 🌈

πŸ“ Serve part of a file

using nbdkit-file-plugin(1), you can serve the file disk.img starting at offset 1M. the total length served is 100M β€” which means, lowkey, the underlying file has to be at least 101M in length:

nbdkit --filter=offset file disk.img offset=1M range=100M

πŸ‘‘ Serve a single partition

an easier way to do this is with nbdkit-partition-filter(1), just saying.

but one way to serve a single partition off a disk is to find the start and length of the partition, like with this:

$ parted disk.img -- unit b print
...
Number  Start   End         Size        Type     File system  Flags
 1      65536B  104792575B  104727040B  primary  ext2

and then you serve the partition only, like:

nbdkit --filter=offset file disk.img offset=65536 range=104727040

ate. no crumbs. πŸ”₯


🧚 FILES 🧚

  • $filterdir/nbdkit-offset-filter.so β€” the filter itself, the main character πŸ‘‘

use nbdkit --dump-config to find where $filterdir is hiding.


⭐ VERSION ⭐

nbdkit-offset-filter first appeared in nbdkit 1.2. a legend from the start, fr fr.


πŸ’œ SEE ALSO πŸ’œ

nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3), nbdkit-map-filter(1), nbdkit-partition-filter(1), nbdkit-protect-filter(1), nbdkit-tar-filter(1), nbdkit-truncate-filter(1).

iykyk β€” go read them, they're all icons 🫢


🌸 AUTHORS 🌸

  • Eric Blake
  • Richard W.M. Jones

the girls that built it. we stan πŸ˜­πŸ’–


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, and yes the legal bits are the legal bits, I'm not touching those πŸ’€

and that's a wrap! this little love letter to the offset filter came to you from nbdkit-1.48.1, dated 2026-08-29. go crop something gorgeous πŸ’–βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from