1

I've been trying to understand how disks are distributed in a mdadm RAID10, but i'm not completly sure. AFAIK, a native RAID10 is similar to RAID0+RAID1, i.e. data splitted in two chunks, each one write in different RAID1.

enter image description here

Questions are:

  1. Using mdadm, how can I tell which drive belongs to each RAID1, so I can know which combinations of 2 drives i can afford. In a typical RAID10 mdadm --detail /dev/mdX shows set-A and set-B. Is a set equivalent to a mirror? In that case, i can't lose a complete set, right?
  2. What does the number inside braces mean (sda[0])?. How is it related to "sets"? Example output:
    md0: active raid10 sdb[3] sda[2] sdc[0] sdd[1]
  3. Making some test, i noticed that if I remove any combination of two drives and reboot the machine it won't boot and end up in a grub> prompt beacuase RAID10 couldn't be built. Test was made on a virtual machine, with UEFI enabled, and a 4 disks RAID10 with everything (/) in a single partition, ESP replicated in every disk.
  4. Testing with layouts that have multiple partitions for different mount points, say /, /boot, /boot/efi, and swap, i noticed that breaking an reassembling RAID10 can end up with a healthy but messed up layout. Given the following case, I think that i can't lose more than one drive, because stripes are mixed up:
md0 : active raid10 sdb3[0] sdc3[2] sdd3[4] sda3[5]
md1 : active raid10 sdc4[0] sdd4[1] sdb4[2] sda4[3]
md2 : active raid10 sdb2[1] sdc2[3] sdd2[4] sda2[5]

Thank you

  • Use `mdadm --detail /dev/mdX`. It will tell you, amongst other useful information, to which mirror set each disk belongs. // Digits are just sequential digits. Also notice that actual block dispersion on the disks may be different, depending on whether ["far" or "near" layout](https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm#Near.2C_Far.2C_and_offset_layouts) is used. By reading the mentioned official documentation you also will know that RAID10 from *three* drives is possible :) – Nikita Kipriyanov Sep 30 '22 at 14:08
  • Nikita, thanks for your answer. `mdadm --detail /dev/mdX` shows me that i'm using near layout (default, https://www.ilsistemista.net/index.php/linux-a-unix/35-linux-software-raid-10-layouts-performance-near-far-and-offset-benchmark-analysis.html?start=1). Can you point me to the proper documentation where I can confirm that a set (set-X) is a group of mirror drives? It is intuitive and reasonable, but I would like to confirm that with code or official documentation. Last thing is, do you find any logical explanation to why I can't boot with only 2 drives (different sets) from a 4 disks RAID10? – Roberto Iglesias Sep 30 '22 at 14:57
  • The link I provided above *is* the link to the official Linux RAID documentation. Why you can't boot is very different topic and probably that's because your init scripts in the initramfs expect you to manually confirm loss of two disks by forcing an assembly of a degraded array. But to answer that properly with confidence I need to know *how exactly* it doesn't boot, which messages does it display and so on. I think if you want to address that specifically you better ask another question with all of the details. – Nikita Kipriyanov Oct 01 '22 at 17:19
  • https://www.mankier.com/8/mdadm – gapsf Oct 01 '22 at 17:21
  • https://www.tecmint.com/understanding-raid-setup-in-linux/ – gapsf Oct 01 '22 at 17:32
  • https://superuser.com/questions/567267/need-to-find-which-drives-are-mirrored-within-raid-10-array better check yourself - there is no reliable info in internet about set-a, set-b – gapsf Oct 01 '22 at 17:38

0 Answers0