File: nbdkit-offset-filter.pod

package info (click to toggle)
nbdkit 1.46.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,504 kB
  • sloc: ansic: 63,658; sh: 18,717; makefile: 6,814; python: 1,848; cpp: 1,143; perl: 504; ml: 504; tcl: 62
file content (100 lines) | stat: -rw-r--r-- 2,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
=head1 NAME

nbdkit-offset-filter - nbdkit offset filter

=head1 SYNOPSIS

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

=head1 DESCRIPTION

C<nbdkit-offset-filter> is a filter that limits requests to the byte
range C<[offset .. offset+range-1]> within another plugin.

=head1 PARAMETERS

=over 4

=item B<offset=>OFFSET

The start offset.  The offset must be E<ge> 0.

This parameter is optional.  If not given then C<offset=0> is assumed.

=item B<range=>LENGTH

The 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.

=back

Note it is an error if the offset and/or range specify data which lies
beyond the end of the underlying device.  Use
L<nbdkit-truncate-filter(1)> to truncate or extend the size of
plugins.

=head1 EXAMPLES

=head2 Serve part of a file

Using L<nbdkit-file-plugin(1)>, serve the file C<disk.img> starting at
offset C<1M>.  The total length served is C<100M> (the underlying file
must therefore be at least C<101M> in length):

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

=head2 Serve a single partition

I<An easier way to do this is with L<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  Flags
  1      65536B  104792575B  104727040B  primary  ext2

You can then serve the partition only using:

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

=head1 FILES

=over 4

=item F<$filterdir/nbdkit-offset-filter.so>

The filter.

Use C<nbdkit --dump-config> to find the location of C<$filterdir>.

=back

=head1 VERSION

C<nbdkit-offset-filter> first appeared in nbdkit 1.2.

=head1 SEE ALSO

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

=head1 AUTHORS

Eric Blake

Richard W.M. Jones

=head1 COPYRIGHT

Copyright Red Hat