Search code examples
azureubuntubcache

Bcache directory not showing up after make-bcache


I'm setting up bcache on an ubuntu virtual machine on azure. I'm following the instructions from http://blog.rralcala.com/2014/08/using-bcache-in-ec2.html.

After running make-bcache -B /dev/sdc1, the /dev/bcache0 device is not yet available.

When running make-bcache -B /dev/sdc1 a second time, /dev/bcache suddenly exists, as does /sys/fs/bcache and /sys/fs/block/bcache0 etc.

A weird side-note is that running make-bcache -B for the second time in a script (even with sleeps in between) does not fix the issue, but running it manually does.

Once bcache has initiated properly it stays stable, also after reboots and VM-relocations. You can read the configuration scripts at https://github.com/okke-formsma/azure-bcache.

Does anyone have a clue how to enable bcache on my ubuntu 16.04 machine without having to resort to a double manual make-bcache -B xxx?

[edit] According to the archlinux wiki not having a /sys/fs/bcache means that "The kernel you booted is not bcache enabled", however that is not the case.


Solution

  • I figured it out!

    The module was not loaded by the kernel. Doing a sudo modprobe bcache made all bcache functionality available without weird workarounds.