nbdkit-truncate-filter(1) | NBDKIT | nbdkit-truncate-filter(1) |
nbdkit-truncate-filter - change the size of plugins
nbdkit --filter=truncate plugin [truncate=SIZE] [round-up=N] [round-down=N]
"nbdkit-truncate-filter" is a filter that changes the size of the underlying plugin. It can:
A common use for this filter is to handle NBD clients which have a problem dealing with device sizes which are not a multiple of 512 bytes. Use "round-up=512" to round the size up to the next multiple of 512 bytes. If the size is already a multiple of 512 bytes then this has no effect.
If the size is larger than the underlying plugin, reading the extra space returns zeroes. Writes are also permitted to the extra space, but you must only write zeroes (any attempts to write non-zero bytes will return an error back to the client).
This parameter is optional.
This option is useful when combined with other filters (such as nbdkit-blocksize-filter(1)) that normally round down due to a larger granularity, in order to access the last few bytes of a file that would otherwise be rendered inaccessible.
This parameter is optional.
This parameter is optional.
Serve a file as if it were a block device that insists on 4k alignment, while still allowing access to any unaligned bytes at the end of the file:
nbdkit --filter=blocksize --filter=truncate file /path/to/file \ minblock=4k round-up=4k
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-truncate-filter" first appeared in nbdkit 1.6.
nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3), nbdkit-blocksize-filter(1), nbdkit-cache-filter(1), nbdkit-cow-filter(1), nbdkit-offset-filter(1), nbdkit-partition-filter(1).
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.
2023-01-04 | nbdkit-1.32.5 |