I've tried echoing to detach and stop.  The device will remove itself, but will show up again on reboot.  One time on reboot, it restored the mdadm raid I had as a backing device!The other time I disabled the ramdrive that it was paired with, did a detach. And /dev/bcache0 came back up again after reboot.There is no unregister under/sys/fs/block/bcacheI've also looked in /sys/fs/bcache.../sys/block/md0/md0p1/bcachefor this non existent unregister.only register and register-quietI even uninstalled bcache-tools, and /dev/bcache0 still shows up after reboot and is caching /dev/md0!
How to remove bcache0 volume?
bcache
If you want to permanently destroy the bcache volume, you need to wipe the bcache superblock from the underlying device. This operation is not exposed through the sysfs interface. So:Stop the bcache device as usual with echo 1 > /sys/block/<device>/bcache/stop.Wipe the superblock with head -c 1M /dev/zero > /dev/<device>. (If you have a sufficiently new version of util-linux, you can use wipefs instead, which is more precise in wiping the bcache signature: wipefs -a /dev/<device>.) Obviously, you need to be careful to select the right device because this is a destructive operation that will wipe the header of the device. Take note that you will no longer have access to any data in the bcache volume!