On Wed, Sep 06, 2017 at 05:44:21PM +0200, Patrick Wildt wrote: > Hi, > > I'm testing some SoftRAID in a Mirroring setup and stumbled upon > something. When I set a disk offline, zero out the disk and the > metadata blocks, reboot, and then try to assemble it, it will > fail. Rightfully so, since the metadata information is completely > gone from one disk. That's not a reassemble, that's a rebuild. > > Now in the case that I want to actually force a whole new RAID > it looks like I have to pass -C force, to clear the metadata and > force creation of a new RAID. Unfortunately this does not work, > because sr_meta_native_attach(), which is called by > sr_meta_native_attach(), wants to make sure that all devices are > either non-SoftRAID or SoftRAID. Now in my case the disks are > kinda both. One zeroed, one not. In that case sr && not_sr is > true and it will exit with "not all chunks are of the native > metadata format". > > Is there a reason that sr_meta_attach() has to be called before > clearing the metadata on force? > > Untested diff below. > > Patrick
Ah, well, sr_meta_clear() memsets sd->sd_meta, which is only later allocated during sr_meta_native_attach(), and sr_meta_read() of course also makes use of it. Maybe sr_meta_native_attach() can be more lax.
