1nbdkit-offset-filter(1)             NBDKIT             nbdkit-offset-filter(1)
2
3
4

NAME

6       nbdkit-offset-filter - nbdkit offset filter
7

SYNOPSIS

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

DESCRIPTION

12       "nbdkit-offset-filter" is a filter that limits requests to the byte
13       range "[offset .. offset+range-1]" within another plugin.
14

PARAMETERS

16       offset=OFFSET
17           The start offset.  The offset must be ≥ 0.
18
19           This parameter is optional.  If not given then "offset=0" is
20           assumed.
21
22       range=LENGTH
23           The length of data to serve.
24
25           This parameter is optional.  If not given then the range is served
26           starting from the offset through to the end of the underlying
27           file/device.
28
29       Note it is an error if the offset and/or range specify data which lies
30       beyond the end of the underlying device.  Use nbdkit-truncate-filter(1)
31       to truncate or extend the size of plugins.
32

EXAMPLES

34   Serve part of a file
35       Using nbdkit-file-plugin(1), serve the file "disk.img" starting at
36       offset "1M".  The total length served is "100M" (the underlying file
37       must therefore be at least "101M" in length):
38
39        nbdkit --filter=offset file disk.img offset=1M range=100M
40
41   Serve a single partition
42       An easier way to do this is with nbdkit-partition-filter(1).
43
44       One way to serve a single partition from a disk is to find the start
45       and length of the partition, eg using:
46
47        $ parted disk.img -- unit b print
48        ...
49        Number  Start   End         Size        Type     File system  Flags
50         1      65536B  104792575B  104727040B  primary  ext2
51
52       You can then serve the partition only using:
53
54        nbdkit --filter=offset file disk.img offset=65536 range=104727040
55

SEE ALSO

57       nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3),
58       nbdkit-partition-filter(1), nbdkit-truncate-filter(1).
59

AUTHORS

61       Eric Blake
62
63       Richard W.M. Jones
64
66       Copyright (C) 2018 Red Hat Inc.
67

LICENSE

69       Redistribution and use in source and binary forms, with or without
70       modification, are permitted provided that the following conditions are
71       met:
72
73       ·   Redistributions of source code must retain the above copyright
74           notice, this list of conditions and the following disclaimer.
75
76       ·   Redistributions in binary form must reproduce the above copyright
77           notice, this list of conditions and the following disclaimer in the
78           documentation and/or other materials provided with the
79           distribution.
80
81       ·   Neither the name of Red Hat nor the names of its contributors may
82           be used to endorse or promote products derived from this software
83           without specific prior written permission.
84
85       THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
86       EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
87       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
88       PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
89       LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
90       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
91       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
92       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
93       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
94       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
95       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
96
97
98
99nbdkit-1.12.3                     2019-05-21           nbdkit-offset-filter(1)
Impressum