How to restart a 'stopped' bcache device?

I need to upgrade some drive firmware and I’d like to shut down bcache for the duration.

The docs show how to stop a bcache device:

stop

Write to this file to shut down the bcache device and close the backing device.

For me that will look like this:

echo 1 > /sys/block/bcache0/bcache/stop

and for the cache device:

echo 1 > /sys/fs/bcache/<set-uuid>/stop

But how do I bring the device back (without rebooting the server)?

Asked By: user12810

||

Simply re-register each bcache device in the cache set (both backing and cache devices) to the kernel:

echo /dev/<path_to_device> > /sys/fs/bcache/register

Or, if the udev rules from bcache-tools are in place, then partprobe will automatically register the devices when they are scanned.

Answered By: Vincent Yu
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.