nbdkit-offset-filter(1) | NBDKIT | nbdkit-offset-filter(1) |
nbdkit-offset-filter - 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.
This parameter is optional. If not given then "offset=0" is assumed.
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 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
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-offset-filter" first appeared in nbdkit 1.2.
nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3), nbdkit-partition-filter(1), nbdkit-tar-filter(1), nbdkit-truncate-filter(1).
Eric Blake
Richard W.M. Jones
Copyright (C) 2018 Red Hat Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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.
2021-01-20 | nbdkit-1.24.1 |