Getting Started

You need three things to get going:

The git repositories are git://evilpiepirate.org/~kent/linux-bcache.git and git://evilpiepirate.org/~kent/bcache-tools.git.

To get started, you'll need make-bcache from the tools repository. Set the bucket size to match your SSD's erase block size - for Intel SSDs this should be 128k, for most others I believe it's 512k. And if you're using a partition, you'll want it aligned to to an erase block boundary.

# make-bcache -b128k /dev/sdb1

Once you're running your shiny new kernel, bcache is controlled via sysfs. It indexes cached devices by their UUID, so data can safely persist across reboots even when device names change:

# echo "/dev/sdb1" > /sys/kernel/bcache/register_cache
# echo "<UUID> /dev/md1" > /sys/kernel/bcache/register_dev

And you're up and running. One easy way to grab the UUID automatically is to use this form:

# echo "`blkid /dev/md1 -s UUID -o value` /dev/md1" > /sys/kernel/bcache/register_dev

To verify that bcache recognizes both new cache devices and new filesystems to cache, run:

dmesg | tail

BcacheWiki: GettingStarted (last edited 2011-09-08 05:18:06 by Kent)