Contents
What happens if I remove the cache device from bcache?
I used bcache only in a writethrough configuration, and IIRC even then bcache doesn’t like at all if the cache device vanishes while the machine is running. Expect the bcache device to stall completely if that happens. I haven’t tried to remove the cache device while the machine is powered down, so I can’t say anything about that.
How to control bcache devices in the Linux kernel?
As well as (with udev): You can control bcache devices through sysfs at /sys/block/bcache /bcache . You can also control them through /sys/fs//bcache/ / . Cache devices are managed as sets; multiple caches per set isn’t supported yet but will allow for mirroring of metadata and dirty data in the future.
How is a backing device attached to a cache?
After your cache device and backing device are registered, the backing device must be attached to your cache set to enable caching. Attaching a backing device to a cache set is done thusly, with the UUID of the cache set in /sys/fs/bcache: This only has to be done once.
Can a bcache device be registered without udev?
Without udev, you can manually register devices like this: Registering the backing device makes the bcache device show up in /dev; you can now format it and use it as normal. But the first time using a new bcache device, it’ll be running in passthrough mode until you attach it to a cache.
Why do I need bcache on my MD device?
Putting bcache to cache the whole md device sacrifices the whole idea of having raid, because it introduces another single point of failure.
Is it safe to use bcache on OTH failurs?
OTH failurs of SSD disks are relatively rare, and bcache can be put into the writethrough / writearound mode (in contrast to the writeback mode), where there is no data stored only to the cache device, and failure of the cache doesn’t kill the information in the raid makes it a relatively safe option.
Is there a difference between bcache and read caching?
AFAIK it should not make a big difference, since for example during a normal (and repeated) boots, there should be little deleting taking place. Also, not having a SSD with discard enabled, the option should not do anything. None of these have any (discernible) effect.
Why is no data put into the cache?
So, it seems, that no data will be put into the cache if (just) red (or, sequential_cutoff is not working for reads). Data will be only put into cache if written to. This just does not seem to be right, but does explain the (lack of) performance I’m observing.
What is the default metadata size for bcache?
The defaults are intended to be reasonable for typical desktop and server workloads, but they’re not what you want for getting the best possible numbers when benchmarking. The default metadata size in bcache is 8k. If your backing device is RAID based, then be sure to align this by a multiple of your stride width using bcache make –data-offset.
What should I do if my cache device is gone?
If you’re booting up and your cache device is gone and never coming back, you can force run the backing device: (You need to use /sys/block/sdb (or whatever your backing device is called), not /sys/block/bcache0, because bcache0 doesn’t exist yet.
What to do if your bcache is dirty?
Note that if your bcache is dirty (and you can’t use it any more), you’ll have to fsck your partition and mess with corrupted data. I had good luck that only a few files was corrupted after a manual fsck.