From: Piergiorgio Sartor <piergiorgio.sartor-KvP5wT2u2U0@public.gmane.org>
To: Adam Berkan <aberkan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Piergiorgio Sartor
<piergiorgio.sartor-KvP5wT2u2U0@public.gmane.org>,
linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Formatting of backing device
Date: Thu, 2 Feb 2012 20:01:22 +0100 [thread overview]
Message-ID: <20120202190122.GA2353@lazy.lzy> (raw)
In-Reply-To: <CAHYUNGYyPafQzmwMdS-tRAPsYYM+9uRpN-38Av4uDJwtwY_d=A@mail.gmail.com>
Hi Adam,
On Wed, Feb 01, 2012 at 03:11:54PM -0800, Adam Berkan wrote:
> When we make-bcache on a drive we need to replace the filesytem
> superblock with a bcache superblock so the kernel knows to load the
> drive through bcache, but this destroys the filesystem. We've talked
well, I guess it will destroy the md superblock 1.1 too,
how about LVM metadata?
I think the mismatch is with /dev/bcacheX device.
The first implementation, as far as I remember, was simply
telling the caching device (using UUID) which was the
backing device, i.e. it was registering the backing to
the caching.
Then, still if I got it right, the bcache was caching the
backing device directly, without any need of a third
device (/dev/bcacheX).
I understand that the actual implementation is easier and,
maybe, simpler, since a completely new device is added,
which will have the new caching "features", while the
old one (backing device) is just a further layer.
This is similar to LVM over md over /dev/sdX.
Nevertheless, my opinioni is, while still considering bcache
a great project, that it should work on already existing
devices, without touching them.
Anyway, thanks a lot for the chat,
bye,
pg
> about hacky ways to hide the bcache superblock somewhere else, but
> it's very dangerous stuff that's likely to fail and we don't want to
> support it.
>
> Adam
>
>
>
> On Wed, Feb 1, 2012 at 1:44 PM, Piergiorgio Sartor
> <piergiorgio.sartor-KvP5wT2u2U0@public.gmane.org> wrote:
> > Hi Adam,
> >
> > On Wed, Feb 01, 2012 at 01:38:12PM -0800, Adam Berkan wrote:
> >> Oh, sorry I misunderstood.
> >>
> >> You have to run make-bcache once to add a bcache superblock to the drive.
> >> After that the drive contents are destroyed and it needs to be formatted
> >> with a filesystem.
> >
> > ah! That's not good...
> >
> > Is there any plan to have the caching device attachable
> > and detachable from *any* backing device without prior
> > "formatting" of this second one?
> >
> > I think bcache is a very interesting and promising
> > project, but formatting the backing device is
> > something, I think, that should be avoided.
> >
> > bye,
> >
> > pg
> >
> >> At that point you can attach or detach the drive while it is in use.
> >>
> >> Adam
> >>
> >> On Wed, Feb 1, 2012 at 12:54 PM, Piergiorgio Sartor <
> >> piergiorgio.sartor-KvP5wT2u2U0@public.gmane.org> wrote:
> >>
> >> > Hi Adam,
> >> >
> >> > thanks for the answer, see below.
> >> >
> >> > On Wed, Feb 01, 2012 at 11:04:59AM -0800, Adam Berkan wrote:
> >> > > You can attach bcache to a drive with an existing file system, and it
> >> > will
> >> > > continue as normal. If you connect to a drive without a file system,
> >> > then
> >> > > it will continue to not have a file system, but you can format it while
> >> > > attached.
> >> >
> >> > Maybe I misused the term "format".
> >> >
> >> > I did not mean filesystem format, but bcache format.
> >> >
> >> > What I understood, maybe I'm wrong, is that the backing
> >> > device, before being used, must be "initialized" with
> >> > the bcache tool.
> >> >
> >> > From the docs:
> >> >
> >> > Getting started:
> >> > You'll need make-bcache from the bcache-tools repository. Both the cache
> >> > device
> >> > and backing device must be formatted before use.
> >> > make-bcache -B /dev/sdb
> >> > make-bcache -C -w2k -b1M -j64 /dev/sdc
> >> >
> >> > I understand this as the backing device gets something
> >> > on written on it (note the term "formatted").
> >> >
> >> > Am I wrong? I hope so...
> >> >
> >> > Thanks again,
> >> >
> >> > bye,
> >> >
> >> > pg
> >> >
> >> > > Attach/detach should work while the device is in use. This isn't the
> >> > most
> >> > > tested code path, especially with writeback on, but it's supposed to
> >> > work.
> >> > > Detaching while the cache is dirty requires flushing all that data so
> >> > > performance will be bad until the detach completes.
> >> > >
> >> > > Let us know if you find any bugs.
> >> > > Adam
> >> > >
> >> > > On Wed, Feb 1, 2012 at 2:10 AM, Piergiorgio Sartor <
> >> > > piergiorgio.sartor-KvP5wT2u2U0@public.gmane.org> wrote:
> >> > >
> >> > > > Hi all,
> >> > > >
> >> > > > first of all I would like to congratulate for this
> >> > > > project, I think it is one of the most promising
> >> > > > feature the Linux kernel can have.
> >> > > >
> >> > > > Wrote that, I've a question about the concept of
> >> > > > formatting the backing device.
> >> > > >
> >> > > > As far as I understood, the first concept of bcache
> >> > > > was to simply "register" or "attach" a cache to a
> >> > > > backing device, that is, the backing device had not
> >> > > > to be formatted.
> >> > > >
> >> > > > Lately, still if I understood it correctly, this
> >> > > > behaviour was changed and, now, the backing device
> >> > > > needs to be formatted.
> >> > > >
> >> > > > So, the question is:
> >> > > >
> >> > > > How about an already running device? Is it still
> >> > > > possible to attach a cache under such situation?
> >> > > >
> >> > > > In general, would it be possible to attach/detach
> >> > > > a cache to any already available device (in the
> >> > > > future)? Or the caching/backing setup must be planned
> >> > > > before the HW is available, so to speak?
> >> > > >
> >> > > > It would be useful (and cool too), to have the
> >> > > > possibility to attach/detach the SSD cache, on
> >> > > > the fly (at run-time) to any device it needs it.
> >> > > >
> >> > > > I hope the question(s) are clear, if not please
> >> > > > let me know.
> >> > > >
> >> > > > Thanks a lot in advance,
> >> > > >
> >> > > > bye,
> >> > > >
> >> > > > --
> >> > > >
> >> > > > piergiorgio
> >> > > > --
> >> > > > To unsubscribe from this list: send the line "unsubscribe
> >> > linux-bcache" in
> >> > > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >> > > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > > >
> >> >
> >> > --
> >> >
> >> > piergiorgio
> >> >
> >
> > --
> >
> > piergiorgio
--
piergiorgio
next prev parent reply other threads:[~2012-02-02 19:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 10:10 Formatting of backing device Piergiorgio Sartor
[not found] ` <20120201101041.GA2779-W+Wf6LxwHt0@public.gmane.org>
2012-02-01 19:12 ` Adam Berkan
[not found] ` <CAHYUNGYcs3CeRA8Pk-R_3hA6mFHshKzysxRaCcsfm3WLT__B0A@mail.gmail.com>
[not found] ` <CAHYUNGYcs3CeRA8Pk-R_3hA6mFHshKzysxRaCcsfm3WLT__B0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 20:54 ` Piergiorgio Sartor
[not found] ` <20120201205456.GA7669-W+Wf6LxwHt0@public.gmane.org>
2012-02-01 21:43 ` Adam Berkan
[not found] ` <CAHYUNGaB4LCESDWU1tWB1ZJp_kBH_=19e07vCndxXS5T98_xBA@mail.gmail.com>
[not found] ` <CAHYUNGaB4LCESDWU1tWB1ZJp_kBH_=19e07vCndxXS5T98_xBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 21:44 ` Piergiorgio Sartor
[not found] ` <20120201214443.GA8544-W+Wf6LxwHt0@public.gmane.org>
2012-02-01 23:11 ` Adam Berkan
2012-02-02 19:01 ` Piergiorgio Sartor [this message]
[not found] ` <20120202190122.GA2353-W+Wf6LxwHt0@public.gmane.org>
2012-02-02 22:11 ` Kent Overstreet
[not found] ` <20120202221101.GA26768-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-02-02 22:24 ` Piergiorgio Sartor
2012-02-16 19:42 ` Alex Elsayed
[not found] ` <loom.20120216T200235-190-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2012-02-16 20:33 ` Piergiorgio Sartor
[not found] ` <20120216203332.GA6597-W+Wf6LxwHt0@public.gmane.org>
2012-02-16 20:50 ` Alex Elsayed
[not found] ` <CA++fp8wcxTDJ=mbsKmWi27+yRZg-tyNdWgmhWU6=UeWgC0TZuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 20:52 ` Alex Elsayed
2012-02-16 22:35 ` Piergiorgio Sartor
[not found] ` <20120216223554.GA6947-W+Wf6LxwHt0@public.gmane.org>
2012-02-16 23:09 ` Joseph Glanville
[not found] ` <CAOzFzEhO+6ECN-WjvtMK+-2g7Dwo+DPwQMVWuCZG=Y3BVRNEBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 23:17 ` Piergiorgio Sartor
[not found] ` <20120216231754.GA14206-W+Wf6LxwHt0@public.gmane.org>
2012-02-16 23:34 ` Alex Elsayed
[not found] ` <CA++fp8w7_uUd35Tcwy1bwEYpR6tJ+fkWMEg+iVEyJ1H4hqKBKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 23:35 ` Alex Elsayed
2012-02-17 19:12 ` Piergiorgio Sartor
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=20120202190122.GA2353@lazy.lzy \
--to=piergiorgio.sartor-kvp5wt2u2u0@public.gmane.org \
--cc=aberkan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox