Re: Kernel mistakenly "starts" resync on fully-degraded, newly-created raid10 array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/06/2025 19:03, Omari Stephens wrote:
On 6/22/25 09:30, Wol wrote:
On 22/06/2025 02:39, Omari Stephens wrote:

|At that point, /proc/mdstat showed the following, which makes no sense:|

Why doesn't it make any sense? to)

Don't forget a raid-10 in linux is NOT a two raid-0s in a raid-1, it's its own thing entirely.

Understood.  I've been using Linux MD raid10 for over a decade.  I've read through this (and other references) in depth:
https://en.wikipedia.org/wiki/Non-standard_RAID_levels#Linux_MD_RAID_10

My question is this: Suppose you create a 4-drive array.  2 drives are missing.  What data is there to synchronize?  What should get copied where, or what should get recomputed and written where?

Ah - I get that. But presumably raid *always* fires up a resync (unless told not to) when an array is created - and see below ...

To my understanding, in that situation, each block in the array only appears in one place on the physical media, and there is no redundancy or parity for any block that could be out of sync.

No. It's trying to resync a *broken* array. Unless you had explicitly asked for just one mirror (which I don't think you did). A raid-10 needs "no of mirrors plus one". I can see why you would think "why doesn't it just fire up as a plain raid-1?", but I guess it just doesn't. I've never tried to create an array in a broken state.

When you read from the array, yes, you're going to get interleaved bits of whatever happened to be on the physical media to start with, but that's basically the same as reading directly from any new physical media -- it's not initialized until it's initialized, and until it is, you don't know what you're going to read.

Yup. Read-before-write is going to return random junk - not particularly a good idea - but I don't think you can assume that --assume-clean will actually create a clean array. My fu isn't up to guessing what will happen when, in particular for higher raids even with zeroed data the parity will be one. (And I would never assume a new drive was zeroed. To me it has as much evidence behind it as an old wive's tale. Other people may have real evidence -I don't.)

What you did worked, and in hindsight you can see how, but with just two drives, I personally wouldn't even have tried. Anyways, all's well that ends well, as they say ...

Cheers,
Wol




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux