Recently, because of the work of the cause of exposure to the Bcache cache technology some fur, make a note memo.
Bcache is integrated into the Linux kernel since 3.10, and several additions have been added to the later versions.
Another alternative technology option is the Flashcache created by Facebook. But the author says on GitHub, the basic dare not use.
This project is not actively maintained. Proceed at your own risk!
In addition to providing support in the Linux 3.10 kernel, there is a bcache-tools tool that allows users to define caches and devices that need to be accelerated. Once the Bcache device is formatted and ready to be used, the tool will register with the kernel via the Sysfs file. Different from the usual contact tools have command operation, Bcache operation is to the/sys/fs/file incoming configuration
Installation
The Debian Wheezy upgraded to the latest version, confirming that the kernel is 3.16, and after installing Bcache-tools, reboot the system after Updateramfs. If you do not already have a bcache device, Lsmod cannot see the bcache loaded, but the module is working properly
#apt-get Install initramfs-tools#dpkg-i bcache-tools_1.0.8-2_amd64.deb#update-initramfs-u
Two methods of Creation
Backing with the cache device
#make-bcache-b/dev/sdb/dev/sdc-c/dev/sda3
Separate initialization (register) backing device and cache device (this is recommended if you do not currently have a cache device but you want to add it later). Once you have created the backing device, you can format it, mount it using the
#make-bcache-b/dev/sdb#make-bcache-c/dev/sda3
With this approach, you will need to add backing device attach manually to the cache device in order to end up using it. Otherwise backing device is equivalent to running on Passthrough mode
We can manage bcache devices through/sys/fs or/sys/block.
/sys/block/bcache<n>/bcache/sys/fs//bcache/<cset-uuid>/
After you initialize two devices, you need attch to really enable Bcache caching
echo <CSET-UUID> >/sys/block/bcache0/bcache/attach
Even if the cache device is dropped, you can set the force back-end device to run (note that using writeback mode may cause data loss):
Echo 1 >/sys/block/sdb/bcache/running
This article is from "houstonwongのtech! "Blog, be sure to keep this provenance http://hzc989.blog.51cto.com/6678611/1909833
Some things about Bcache.