=head1 NAME

nbdkit-floppy-plugin - create virtual floppy disk from directory

=head1 SYNOPSIS

 nbdkit floppy [dir=]DIRECTORY
               [label=LABEL] [size=SIZE]

=head1 DESCRIPTION

C<nbdkit-floppy-plugin> is a plugin for L<nbdkit(1)> which creates a
virtual FAT-formatted floppy disk image from a directory on the fly.
The files in the specified directory (and subdirectories) appear in
the virtual floppy, which is served read-only over the NBD protocol.

The virtual floppy disk will have a single partition (using an MBR
partition table).  In that partition will be a virtual FAT32
filesystem containing the files.  Long filenames are supported.

To create a CD/ISO, see L<nbdkit-iso-plugin(1)>.  To create a Linux
compatible virtual disk, see L<nbdkit-linuxdisk-plugin(1)>.

B<Note:> The plugin does not save a temporary copy of the files, so
you must leave the directory alone while nbdkit is running, else you
may get an error (for example if the plugin tries to open one of the
files which you have moved or deleted).  This is different from how
L<nbdkit-iso-plugin(1)> and L<nbdkit-linuxdisk-plugin(1)> work, as
both of those plugins keep a temporary copy of the files and
directories.

=head1 EXAMPLE

Create a virtual floppy disk:

 nbdkit floppy /path/to/directory

=head1 PARAMETERS

=over 4

=item [B<dir=>]DIRECTORY

Specify the directory containing files and subdirectories which will
be added to the virtual floppy disk.  Files inside this directory will
appear in the root directory of the virtual floppy.

This parameter is required.

C<dir=> __IS_MAGIC__

=item B<label=>LABEL

The optional volume label for the filesystem.  This may be up to 11
ASCII characters.  If omitted, C<NBDKITFLOPY> is used.

=item B<size=>SIZE

Optional total disk size.  If omitted then the disk will only be large
enough to store all the files and directories from C<DIRECTORY> with
no free space.

=back

=head1 LIMITATIONS

The maximum size of the disk is around 2TB.  The maximum size of a
single file is 4GB.  Non-regular files (such as block special,
symbolic links, sockets) are not supported and will be ignored.

The plugin does not support writes.  L<nbdkit-cow-filter(1)> can be
placed on top to enable writes, but they will be thrown away when
nbdkit exits and not written to the underlying directory.

The virtual floppy will not be bootable.  This could be added in
future (using SYSLINUX) but requires considerable work.  As a
workaround use L<nbdkit-iso-plugin(1)> instead.

FAT32 is always used, even for small disks (where dosfstools, for
example, would choose FAT12 or FAT16).  This results in extra wasted
space, but since it is only I<virtual> wasted space it isn't really
important, and it simplifies the implementation greatly.

=head1 FILES

=over 4

=item F<$plugindir/nbdkit-floppy-plugin.so>

The plugin.

Use C<nbdkit --dump-config> to find the location of C<$plugindir>.

=back

=head1 VERSION

C<nbdkit-floppy-plugin> first appeared in nbdkit 1.8.

=head1 SEE ALSO

L<nbdkit(1)>,
L<nbdkit-plugin(3)>,
L<nbdkit-file-plugin(1)>,
L<nbdkit-linuxdisk-plugin(1)>,
L<nbdkit-iso-plugin(1)>.

=head1 AUTHORS

Richard W.M. Jones

=head1 COPYRIGHT

Copyright Red Hat
