linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Quick howto?
@ 2012-04-09 11:23 Gerrit Tamboer
  2012-04-09 11:37 ` Joseph Glanville
  0 siblings, 1 reply; 2+ messages in thread
From: Gerrit Tamboer @ 2012-04-09 11:23 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA

Hi!

I am currently trying to test bcache stability in combination with the btrfs
filesystem. I am currently stuck with some unanswered questions and I was
hoping that someone could help me out on the following;

1. The documentation on the website is out of date, this means there is not
quickstart guide on how to actually use bcache. I was able to compile the
kernel with bcache support but how do I further configure it? I have a sata
disk on sda with sda1 and sda2 used for / and /home. My sdb is an
unformatted SSD which I want to use for caching. In this particular setup,
how do I configure the kernel to use sdb for caching sda1 and sda2?

2. Currently the git repo is a full kernel with bcache support, is there a
way to only fetch the bcache patch for other kernels? I have a linux box
with linux 2.6.x and I would like to patch bcache into it instead of
compiling 3.1.x and migrating to it.

3. If I would temporarily want to disable caching to do maintenance, is
there a way to flush the current queue to disk?

Thanks in advance!

Regards,

Gerrit Tamboer

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Quick howto?
  2012-04-09 11:23 Quick howto? Gerrit Tamboer
@ 2012-04-09 11:37 ` Joseph Glanville
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Glanville @ 2012-04-09 11:37 UTC (permalink / raw)
  To: Gerrit Tamboer; +Cc: linux-bcache-u79uwXL29TY76Z2rM5mHXA

On 9 April 2012 21:23, Gerrit Tamboer <gtamboer-JFNXyGN8thM@public.gmane.org> wrote:
> Hi!
>
> I am currently trying to test bcache stability in combination with the btrfs
> filesystem. I am currently stuck with some unanswered questions and I was
> hoping that someone could help me out on the following;
>
> 1. The documentation on the website is out of date, this means there is not
> quickstart guide on how to actually use bcache. I was able to compile the
> kernel with bcache support but how do I further configure it? I have a sata
> disk on sda with sda1 and sda2 used for / and /home. My sdb is an
> unformatted SSD which I want to use for caching. In this particular setup,
> how do I configure the kernel to use sdb for caching sda1 and sda2?

First make sure you have built bcache into the kernel. In my
experience building as a module caused me a few issues with 3.2. (will
test and get back to the list at some stage)

Next you need to get the bcache-tools repository.
  git://evilpiepirate.org/~kent/bcache-tools.git
Run make to build the tools, and make install to install them. You may
have issues with it trying to install initramfs hooks if you distro
doesnt use the same directory.

Format the devices.
make-bcache -C /dev/sdb #setup the cache device with defaults, you can
tune these later
make-bcache -B /dev/sda2 # I would recommend starting with a spare
disk or partition before attempting to get a system booting from
bcache

Register the devices with bcache
echo /dev/sdb > /sys/fs/bcache/register
echo /dev/sda2 > /sys/fs/bcache/register

Attach the cache to the backing device. To do this you need the UUID
of the cache set. This was returned in make-bcache -C step but you can
get it back with "ls /sys/fs/bcache" or the blk-id command in
bcache-tools.
echo "$UUIDHERE" > /sys/block/bcache0/bcache/attach

The cache is now online and you should be able to see bcache stats etc
in /sys/block/bcache0/bcache/

>
> 2. Currently the git repo is a full kernel with bcache support, is there a
> way to only fetch the bcache patch for other kernels? I have a linux box
> with linux 2.6.x and I would like to patch bcache into it instead of
> compiling 3.1.x and migrating to it.

There is some 2.6.32/34 code hanging about. Wait for Kent to reply
with details of what is available.
I would highly recommend running the 3.1 or 3.2 builds however,
changes beside bcache have make the Linux kernel much more performant
recently.
If you want to apply bcache as a single monolithic patch against a
stock 3.2 kernel you can generate the patch with this command:
git diff 805a6af8dba5dfdd35ec35dc52ec0122400b2610 > /path/to/file.patch

Else you can generate a full patch series with:
git format-patch 805a6af8dba5dfdd35ec35dc52ec0122400b2610

>
> 3. If I would temporarily want to disable caching to do maintenance, is
> there a way to flush the current queue to disk?

I think the "stop' method will do this. Currently I pause I/O on the
volumes and wait for the dirty data to drain (because I am paranoid)
before running stop though.
Kent might be able to offer some additional insight here.

>
> Thanks in advance!
>
> Regards,
>
> Gerrit Tamboer
>
> --
> 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



-- 
Founder | Director | VP Research
Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56
99 52 | Mobile: 0428 754 846

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-09 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-09 11:23 Quick howto? Gerrit Tamboer
2012-04-09 11:37 ` Joseph Glanville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).