From: "Richard W.M. Jones" <rjones@redhat.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: nbdkit as a flexible alternative to loopback mounts
Date: Wed, 5 Sep 2018 15:31:48 +0100 [thread overview]
Message-ID: <20180905143148.GA2680@redhat.com> (raw)
In-Reply-To: <CAJCQCtTH-z5u9d6AmommSgC+bESp+Ze4WHMwKueiD+OYpphcqg@mail.gmail.com>
On Tue, Sep 04, 2018 at 07:55:00PM -0600, Chris Murphy wrote:
> https://rwmj.wordpress.com/2018/09/04/nbdkit-as-a-flexible-alternative-to-loopback-mounts/
>
> This is a pretty cool writeup. I can vouch Btrfs will format mount,
> write to, scrub, and btrfs check works on an 8EiB (virtual) disk.
>
> The one thing I thought might cause a problem is the ndb device has a
> 1KiB sector size, but Btrfs (on x86_64) still uses 4096 byte "sector"
> and it all seems to work fine despite that.
Thanks for the kind words. I did an updated post verifying what you
said and also noting that the ‘nbd-client -b’ option can be used to
adjust the sector size:
https://rwmj.wordpress.com/2018/09/05/nbdkit-for-loopback-pt-5-8-exabyte-btrfs-filesystem/
Btrfs still seems to believe the sector size is 4k, although as you
say it doesn't seem to cause any issues.
> Anyway, maybe it's useful for some fstests instead of file backed
> losetup devices?
One interesting feature of nbdkit is that you can write your own
plugins. For my demonstration, I used the nbdkit-memory-plugin which
implements a purely in-memory sparse array:
https://github.com/libguestfs/nbdkit/blob/master/plugins/memory/memory.c
https://github.com/libguestfs/nbdkit/tree/master/common/sparse
But to test btrfs you might want to write a custom plugin. For
example you might choose a sparse array implementation which is more
suitable for storing specifically btrfs metadata structures, or can
spill to a disk file (which nbdkit-memory-plugin cannot, except swap).
Another thing that's interesting from a testing point of view is the
ability to inject block device errors on demand. You can either do
this using the supplied nbdkit-error-filter:
https://rwmj.wordpress.com/2018/09/04/nbdkit-for-loopback-pt-2-injecting-errors/
or if you were writing your own plugin you'd probably want to do it
there.
Anyway hope you find it interesting.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
next prev parent reply other threads:[~2018-09-05 19:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 1:55 nbdkit as a flexible alternative to loopback mounts Chris Murphy
2018-09-05 14:31 ` Richard W.M. Jones [this message]
2018-09-10 13:23 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180905143148.GA2680@redhat.com \
--to=rjones@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=lists@colorremedies.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.