$filterdir/nbdkit-offset-filter.so
The filter.
Use "nbdkit --dump-config" to find the location of $filterdir.
Nbdkit offset filter
nbdkit --filter=offset
plugin
offset=OFFSET
range=LENGTH
[plugin-args ...]
"nbdkit-offset-filter" is a filter that limits requests to the byte range "[offset .. offset+range-1]" within another plugin.
offset=OFFSETThe start offset. The offset must be ≥ 0.
This parameter is optional. If not given then "offset=0" is assumed.
range=LENGTHThe length of data to serve.
This parameter is optional. If not given then the range is served starting from the offset through to the end of the underlying file/device.
Note it is an error if the offset and/or range specify data which lies beyond the end of the underlying device. Use nbdkit-truncate-filter(1) to truncate or extend the size of plugins.
Using nbdkit-file-plugin(1), serve the file "disk.img" starting at offset "1M". The total length served is "100M" (the underlying file must therefore be at least "101M" in length):
nbdkit --filter=offset file disk.img offset=1M range=100M
An easier way to do this is with nbdkit-partition-filter(1).
One way to serve a single partition from a disk is to find the start and length of the partition, eg using:
$ parted disk.img -- unit b print...Number Start End Size Type File system Flags1 65536B 104792575B 104727040B primary ext2
You can then serve the partition only using:
nbdkit --filter=offset file disk.img offset=65536 range=104727040
$filterdir/nbdkit-offset-filter.so
The filter.
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-offset-filter" first appeared in nbdkit 1.2.
4 releases since Debian 10 (Buster); the text changed 3 times.