nbdkit-map-filter(1)
π nbdkit-map-filter β remap disk blocks
okay bestie, welcome to nbdkit-map-filter(1) from the NBDKIT manual family π. This is the one where we move disk blocks around like we're rearranging our room at 2am. Let's get into it.
β¨ NAME β¨
nbdkit-map-filter β remap disk blocks
πΈ SYNOPSIS πΈ
nbdkit --filter=map PLUGIN [map=START-END:DEST [map=...]]
[map-size=SIZE]
π¦ DESCRIPTION π¦
nbdkit-map-filter is an nbdkit(1) filter that can remap parts of the underlying plugin, like moving a sector or a partition. it's giving "cut and paste but for disk geometry" fr fr.
To select part of a disk, use nbdkit-offset-filter(1) instead. To select a partition, use nbdkit-partition-filter(1). And even though this filter can change the size of the disk, nbdkit-truncate-filter(1) is easier to use. iykyk, use the right tool for the job babes π
π₯ EXAMPLES π₯
π« Swap over the first two sectors in a disk
Using two map parameters, this remaps the first sector (bytes 0-511) on to the second sector (starting at 512), and the second sector (bytes 512-1023) on to the first sector (0). literally just swapping them. iconic behaviour.
nbdkit --filter=map file orig.img map=0-511:512 map=512-1023:0
π PARAMETERS π
map=START-END:DESTβ map bytes in the rangeSTARTtoEND(inclusive) toDESTin the underlying plugin. the destination range ends at:
DEST_END = DEST+END-START
so this means that when the byte at offset START is read or written (or any other operation such as trim), the request is redirected to the byte at offset DEST in the underlying plugin, and so on for the following bytes up to and including offset END which is mapped to DEST_END. it's a whole relay race πβοΈ
DEST through to DEST_END must exist in the underlying plugin. attempts to map requests beyond the end of the underlying plugin will return I/O errors. no cap, that's an error not a vibe.
you can give this parameter multiple times. if overlapping ranges are described then the first matching range on the command line takes precedence (so order matters, bestie). there is an implicit 1-1 mapping covering parts of the disk not covered by explicit map parameters β so anything you didn't touch stays exactly where it was, lowkey the default behaviour.
if you have a large number of mappings, consider using the nbdkit @PATH parameter to read them from an external file (see @PATH in nbdkit(1)). perfect for when your map list is giving "I have 400 of these" energy π
map-size=SIZEβ if this parameter is set, the size of the disk is set toSIZE. note ifSIZEis larger than the underlying plugin then you must map areas of the disk beyond the plugin up toSIZE, otherwise accesses will return I/O errors. β οΈ
if this parameter is not set, the size of the underlying plugin is used.
π FILES π
$filterdir/nbdkit-map-filter.soβ the filter. the actual star of the show β¨
use nbdkit --dump-config to find the location of $filterdir.
β VERSION β
nbdkit-map-filter first appeared in nbdkit 1.46. a true 2025-ish debut, we been knew π
π«Ά SEE ALSO π«Ά
nbdkit(1), nbdkit-extentlist-filter(1), nbdkit-offset-filter(1), nbdkit-partition-filter(1), nbdkit-protect-filter(1), nbdkit-truncate-filter(1), nbdkit-filter(3).
π AUTHORS π
Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat
π§ LICENSE π§
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
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.
and that's the whole page bestie π«Ά this was nbdkit-1.48.1, dated 2026-08-29 β the nbdkit-map-filter(1) manual page, remapped straight into your brain. slay, go remap something πβ¨
π¦ where this page comes from
- fedora 44: nbdkit-basic-filters 1.48.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms