linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* regression: drive was detected as raid member due to metadata on partition
@ 2024-04-08 23:31 Sven Köhler
  2024-04-10  1:56 ` Li Nan
  2024-05-07  7:32 ` Mariusz Tkaczyk
  0 siblings, 2 replies; 11+ messages in thread
From: Sven Köhler @ 2024-04-08 23:31 UTC (permalink / raw)
  To: linux-raid

Hi,

I was shocked to find that upon reboot, my Linux machine was detecting 
/dev/sd[abcd] as members of a raid array. It would assign those members 
to  /dev/md4. It would not run the raid arrays /dev/mdX with members 
/dev/sda[abcd]X for X=1,2,3,4 as it usually did for the past couple of 
years.

My server was probably a unicorn in the sense that it used metadata 
version 0.90. This version of software RAID metadata is stored at the 
_end_ of a partition. In my case, /dev/sda4 would be the last partition 
on drive /dev/sda. I confirmed with mdadm --examine that metadata with 
the identical UUID would be found on both /dev/sda4 and /dev/sda.

Here's what I think went wrong: I believe either the kernel or mdadm 
(likely the latter) was seeing the metadata at the end of /dev/sda and 
ignored the fact that the location of the metadata was actually owned by 
a partition (namely /dev/sda4). The same happened for /dev/sd[bcd] and 
thus I ended up with /dev/md4 being started with members /dev/sda[abcd] 
instead of members /dev/sda[abcd]4.

This behavior started recently. I saw in the logs that I had updated 
mdadm but also the Linux kernel. mdadm and an appropriate mdadm.conf is 
part of my initcpio. My mdadm.conf lists the arrays with their metadata 
version and their UUID.

Starting a RAID array with members /dev/sda[abcd] somehow removed the 
partitions of the drives. The partition table would still be present, 
but the partitions would disappear from /dev. So /dev/sda[abcd]1-3 were 
not visible anymore and thus /dev/md1-3 would not be started.

I strongly believe that mdadm should ignore any metadata - regardless of 
the version - that is at a location owned by any of the partitions. 
While I'm not 100% sure how to implement that, the following might also 
work: first scan the partitions for metadata, then ignore if the parent 
device has metadata with a UUID previously found.


I did the right thing and converted my RAID arrays to metadata 1.2, but 
I'd like to save other from the adrenaline shock.



Kind Regards,
   Sven

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-12 14:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 23:31 regression: drive was detected as raid member due to metadata on partition Sven Köhler
2024-04-10  1:56 ` Li Nan
2024-04-10 20:59   ` Sven Köhler
2024-04-11  2:25     ` Li Nan
2024-04-13 21:37       ` Sven Köhler
2024-04-18  7:31         ` Li Nan
2024-04-18 22:07           ` Sven Köhler
2024-04-18 22:11           ` Sven Köhler
2024-05-07  7:32 ` Mariusz Tkaczyk
2024-05-28 22:57   ` Sven Köhler
2024-06-12 14:36     ` Mariusz Tkaczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).