I believe, that once I made sure my cache device state is "clean":
$ sudo cat /sys/block/bcache0/bcache/state
I can just physically remove it from the machine when it is powered off or boot with liveCD and clean the superblock with:
$ sudo dd if=/dev/zero of=<backing device for cache> bs=1024 count=1024
But I cannot find anywhere a confirmation, that this procedure wouldn't mess anything up.
Best Answer
I used
bcache
only in a writethrough configuration, and IIRC even thenbcache
doesn't like at all if the cache device vanishes while the machine is running. Expect thebcache
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. I do think though that
bcache
is still pretty touchy, so I'd recommend that you try that with a VM or a physical test machine first.To safely remove the cache device, you can detach the cache set from the bcache device:
To determine the necessary cache set UUID, look in
/sys/fs/bcache/
:So for example in this case, run:
The
state
file should sayno cache
after that: