3 nbdkit-offset-filter - nbdkit offset filter
7 nbdkit --filter=offset plugin offset=OFFSET range=LENGTH [plugin-args...]
11 C<nbdkit-offset-filter> is a filter that limits requests to the byte
12 range C<[offset .. offset+range-1]> within another plugin.
18 =item B<offset=>OFFSET
20 The start offset. The offset must be E<ge> 0.
22 This parameter is optional. If not given then C<offset=0> is assumed.
26 The length of data to serve.
28 This parameter is optional. If not given then the range is served
29 starting from the offset through to the end of the underlying
34 Note it is an error if the offset and/or range specify data which lies
35 beyond the end of the underlying device. Use
36 L<nbdkit-truncate-filter(1)> to truncate or extend the size of
41 =head2 Serve part of a file
43 Using L<nbdkit-file-plugin(1)>, serve the file C<disk.img> starting at
44 offset C<1M>. The total length served is C<100M> (the underlying file
45 must therefore be at least C<101M> in length):
47 nbdkit --filter=offset file disk.img offset=1M range=100M
49 =head2 Serve a single partition
51 I<An easier way to do this is with L<nbdkit-partition-filter(1)>.>
53 One way to serve a single partition from a disk is to find the start
54 and length of the partition, eg using:
56 $ parted disk.img -- unit b print
58 Number Start End Size Type File system Flags
59 1 65536B 104792575B 104727040B primary ext2
61 You can then serve the partition only using:
63 nbdkit --filter=offset file disk.img offset=65536 range=104727040
69 =item F<$filterdir/nbdkit-offset-filter.so>
73 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
79 C<nbdkit-offset-filter> first appeared in nbdkit 1.2.
84 L<nbdkit-file-plugin(1)>,
86 L<nbdkit-partition-filter(1)>,
87 L<nbdkit-protect-filter(1)>,
88 L<nbdkit-tar-filter(1)>,
89 L<nbdkit-truncate-filter(1)>.