Thread (1 message) 1 message, 1 author, 2012-02-01

Re: Formatting of backing device

From: Adam Berkan <hidden>
Date: 2012-02-01 21:43:23

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.

At that point you can attach or detach the drive while it is in use.

On Wed, Feb 1, 2012 at 12:54 PM, Piergiorgio Sartor
[off-list ref] wrote:
Hi Adam,

thanks for the answer, see below.

On Wed, Feb 01, 2012 at 11:04:59AM -0800, Adam Berkan wrote:
quoted
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
quoted
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:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help