Bcache and LVM non-destructive setup
The filesystem-caching tool bcache was recently added to the linux kernel in 3.10. What it allows you to do is cache both reads and writes on an intermediate device for great system performance. I figured now would be a good time to play with it since I managed to pick up a lot of 4GB SSDs on ebay.
Blocks is a Python 3.3 utility to convert existing block devices and LVMs to bcache devices. It has a pretty good readme which I sugges you at least skim.
Create Cache Device
First of all you're going to need that actual caching device to be setup first.
make-bcache -C /dev/md1
My device is
/dev/md1, because I threw two of the SSDs I recieved into a mirrored raid. This command also has the side effect of creating a new bcache set. The UUID for this set is spit out as the
Set UUID: output. Mine happens to be
Convert Existing Device
From here it's a rather trivial matter. Supposedly. I downloaded and installed blocks, and then ran:
blocks to-bcache --join=c4f68165-bf87-4d29-8e8e-3f3338deb3f9 /dev/volumegroup/logical_volume
which will do some wizardry and resize and convert the device to a bcache backing device. Or it's supposed to. Doesn't quite work yet..
I'll finish this post once I either get it working or get a response back from the blocks author.
Update: My specific issue was fixed as of here. After updating blocks and making sure everything was working perfectly I ran:
python3.3 -m blocks to-bcache --join=c4f68165-bf87-4d29-8e8e-3f3338deb3f9 /dev/vg/lvm
which successfully completed. After that I had a
/dev/bcache0 to mount. Props to g2p.