Comment 6 for bug 1750519

Revision history for this message
Ryan Harper (raharper) wrote :

Here's what was happening. After one deployment, the raid array had a bcache superblock on it. when we clear a raid array, we wipe the raid metadata, but not any of the data on the assembled devices. so when the same disks where re-assembled into md0 again, it immediately looked like a bcache device, but it was inactive; not bound to the cache device.

There will be two issues to fix.

1) when we attempt to validate that a bcache device was created, we need to check that it is actively running (/sys/class/block/<backing dev kname>/bcache/running == 1) the mere presence of a bcache sysfs dir is not sufficient; if not running ,then we should run make-bcache -B which would create new superblock and activate it in the kernel.

2) In clear-holders, for layered devices (raid, bcache, lvm, crypt) we should wipe the superblock of the composed devices (/dev/md0, /dev/lvoot, etc) before we decompose them so that if we put the same devices back together we don't "accidently" restore data.