Scroll to navigation

nbdkit-ext2-plugin(1) NBDKIT nbdkit-ext2-plugin(1)

NAME

nbdkit-ext2-plugin - read and write files inside ext2, ext3 or ext4 filesystems

SYNOPSIS

 nbdkit ext2 disk=fs.img file=/disks/disk.raw

 nbdkit --filter=partition ext2 \
                           disk=disk.img file=/disks/disk.raw \
                           partition=1

DESCRIPTION

"nbdkit-ext2-plugin" is an nbdkit plugin which can read and write files inside ext2, ext3 or ext4 filesystem images.

Suppose you have an ext2/3/4 filesystem image called fs.img which contains inside itself a file called disk.raw inside a directory on the filesystem called /disks, then you could serve that file over NBD using:

 nbdkit ext2 disk=fs.img file=/disks/disk.raw

Commonly disk images are partitioned. In that case you must use nbdkit-partition-filter(1) to select the partition:

 nbdkit --filter=partition ext2 disk=.. file=.. partition=1

This plugin can both read and write to the file inside the filesystem. Use the -r flag to force a readonly connection, but note this does not guarantee that no writes are made to the filesystem. In particular we may have to replay the ext3 journal in order to open a filesystem even read-only.

The plugin does not support multiple parallel connections, because there is a risk of corrupting the filesystem (as if the filesystem was mounted by multiple machines). If a second connection is made to nbdkit, it will block until the first connection closes.

The plugin is implemented using the ext2fs library which is provided in most Linux distros, and also available as part of the e2fsprogs project.

nbdkit-guestfs-plugin(1) is a more generic plugin which can read files from all kinds of different filesystem types, even if they are partitioned or use logical volumes. It uses libguestfs instead of e2fsprogs.

PARAMETERS

disk=FILENAME
The ext2, ext3 or ext4 filesystem, a file on the host.

You could also use a device name here if the filesystem is located on a device. Be careful that the filesystem is not being accessed in parallel by another program and is not mounted, as that will almost certainly result in disk corruption in the filesystem.

The plugin expects a raw filesystem. If the file/device is partitioned, use nbdkit-partition-filter(1).

file=PATH
The full path of the file within the filesystem that will be exposed over NBD. The path must be absolute (starts with "/").

SEE ALSO

nbdkit(1), nbdkit-plugin(3), nbdkit-partition-filter(1), nbdkit-guestfs-plugin(1), http://e2fsprogs.sourceforge.net/, fuse2fs(1).

AUTHORS

Richard W.M. Jones

COPYRIGHT

Copyright (C) 2018 Red Hat Inc.

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.

2019-01-26 nbdkit-1.10.3