plugins: Wire up nbd plugin support for NBD_INFO_INIT_STATE
[nbdkit/ericb.git] / plugins / ext2 / nbdkit-ext2-plugin.pod
blobb8d6c21ebe5a51fb03d4c843c87c2383d6af9348
1 =head1 NAME
3 nbdkit-ext2-plugin - read and write files inside ext2, ext3 or
4 ext4 filesystems
6 =head1 SYNOPSIS
8  nbdkit ext2 disk=fs.img file=/disks/disk.raw
10 =head1 DESCRIPTION
12 C<nbdkit-ext2-plugin> is an nbdkit plugin which can read and
13 write files inside ext2, ext3 or ext4 filesystem images.
15 Suppose you have an ext2/3/4 filesystem image called F<fs.img>
16 which contains inside itself a file called F<disk.raw>
17 inside a directory on the filesystem called F</disks>, then
18 you could serve that file over NBD using:
20  nbdkit ext2 disk=fs.img file=/disks/disk.raw
22 This plugin can both read and write to the file inside the filesystem.
23 Use the I<-r> flag to force a readonly connection, but note this does
24 I<not> guarantee that no writes are made to the filesystem.  In
25 particular we may have to replay the ext3 journal in order to open a
26 filesystem even read-only.
28 The plugin does I<not> support multiple parallel connections, because
29 there is a risk of corrupting the filesystem (as if the filesystem was
30 mounted by multiple machines).  If a second connection is made to
31 nbdkit, it will block until the first connection closes.
33 The plugin is implemented using the ext2fs library which is provided
34 in most Linux distros, and also available as part of the e2fsprogs
35 project.
37 L<nbdkit-guestfs-plugin(1)> is a more generic plugin which can read
38 files from all kinds of different filesystem types, even if they are
39 partitioned or use logical volumes.  It uses libguestfs instead of
40 e2fsprogs.
42 =head1 PARAMETERS
44 =over 4
46 =item B<disk=>FILENAME
48 The ext2, ext3 or ext4 filesystem, a file on the host.
50 You could also use a device name here if the filesystem is located on
51 a device.  Be careful that the filesystem is not being accessed in
52 parallel by another program and is not mounted, as that will almost
53 certainly result in disk corruption in the filesystem.
55 The plugin expects a raw filesystem.  If the file/device is
56 partitioned, use L<nbdkit-partition-filter(1)>.
58 =item B<file=>PATH
60 The full path of the file within the filesystem that will be exposed
61 over NBD.  The path must be absolute (starts with C</>).
63 =back
65 =head1 FILES
67 =over 4
69 =item F<$plugindir/nbdkit-ext2-plugin.so>
71 The plugin.
73 Use C<nbdkit --dump-config> to find the location of C<$plugindir>.
75 =back
77 =head1 VERSION
79 C<nbdkit-ext2-plugin> first appeared in nbdkit 1.4.
81 =head1 SEE ALSO
83 L<nbdkit(1)>,
84 L<nbdkit-plugin(3)>,
85 L<nbdkit-partition-filter(1)>,
86 L<nbdkit-guestfs-plugin(1)>,
87 L<http://e2fsprogs.sourceforge.net/>,
88 L<fuse2fs(1)>.
90 =head1 AUTHORS
92 Richard W.M. Jones
94 =head1 COPYRIGHT
96 Copyright (C) 2018 Red Hat Inc.