Some things about Bcache.

Source: Internet
Author: User
Tags uuid

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


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

    1. Backing with the cache device

    2. 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


      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.


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

Some things about Bcache.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.