1nbdkit-truncate-filter(1) NBDKIT nbdkit-truncate-filter(1)
2
3
4
6 nbdkit-truncate-filter - change the size of plugins
7
9 nbdkit --filter=truncate plugin [truncate=SIZE]
10 [round-up=N] [round-down=N]
11
13 "nbdkit-truncate-filter" is a filter that changes the size of the
14 underlying plugin. It can:
15
16 · Make the plugin smaller (truncate it). Use the "truncate=SIZE"
17 parameter to set the smaller size.
18
19 · Make the plugin larger (the additional bytes read back as zeroes).
20 Use "truncate=SIZE" to set the larger size.
21
22 · Round the size of the plugin up or down to the next multiple of
23 "N". Use either "round-up=N" or "round-down=N".
24
25 A common use for this filter is to handle NBD clients which have a
26 problem dealing with device sizes which are not a multiple of 512
27 bytes. Use "round-up=512" to round the size up to the next multiple of
28 512 bytes. If the size is already a multiple of 512 bytes then this
29 has no effect.
30
32 truncate=SIZE
33 Set the absolute size in bytes of the apparent device. This may be
34 smaller or larger or the same as the underlying plugin.
35
36 If the size is larger than the underlying plugin, reading the extra
37 space returns zeroes. Writes are also permitted to the extra
38 space, but you must only write zeroes (any attempts to write non-
39 zero bytes will return an error back to the client).
40
41 This parameter is optional.
42
43 round-up=N
44 Round the size up to the next multiple of "N" bytes. If the size
45 of the underlying plugin is already a multiple of "N" bytes, this
46 has no effect.
47
48 This parameter is optional.
49
50 round-down=N
51 Round the size down to a multiple of "N" bytes. If the size of the
52 underlying plugin is already a multiple of "N" bytes, this has no
53 effect.
54
55 This parameter is optional.
56
58 nbdkit(1), nbdkit-file-plugin(1), nbdkit-filter(3),
59 nbdkit-offset-filter(1), nbdkit-partition-filter(1).
60
62 Richard W.M. Jones
63
65 Copyright (C) 2018 Red Hat Inc.
66
68 Redistribution and use in source and binary forms, with or without
69 modification, are permitted provided that the following conditions are
70 met:
71
72 · Redistributions of source code must retain the above copyright
73 notice, this list of conditions and the following disclaimer.
74
75 · Redistributions in binary form must reproduce the above copyright
76 notice, this list of conditions and the following disclaimer in the
77 documentation and/or other materials provided with the
78 distribution.
79
80 · Neither the name of Red Hat nor the names of its contributors may
81 be used to endorse or promote products derived from this software
82 without specific prior written permission.
83
84 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
85 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
86 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
87 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
88 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
89 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
90 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
91 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
92 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
93 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
94 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95
96
97
98nbdkit-1.12.3 2019-05-22 nbdkit-truncate-filter(1)