HeadlinesBriefing favicon HeadlinesBriefing.com

Changing bcache Block Size Without a Cache Device

DEV Community •
×

Changing a bcache block size requires recreating the backing device, as the block size is set at creation time. This guide outlines a procedure for systems already operating without a cache device. The process involves recording the current data offset, stopping the bcache device cleanly, wiping signatures, and recreating the metadata with the new parameters.

First, use `bcache-super-show` to capture the existing data offset, which must be reused to maintain data alignment. Next, unmount any filesystems and stop the bcache device via sysfs. This is a destructive operation, so ensure you have a verified backup. After stopping, use `wipefs -a` to remove old signatures from the backing device.

Finally, recreate the backing device with `make-bcache --block <new> --data-offset <old> -B`. Verify the new `/dev/bcache*` device exists and is active. Without a cache device, bcache acts as a pass-through wrapper, offering no caching benefits until a cache set is attached. Always record the offset directly to avoid data layout mismatches.