Skip to contentSkip to conversation

raid-5 initiated as raid-4?

DISCUSSION Roy Sigurd Karlsbakk 2 participants 4 messages Feb 7, 2013 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi all

I have a test vm on which I do some testing of md raid. Just tried

root@raidtest:~# mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/vd{b..d}
(wait a bit)
root@raidtest:~# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid5 vdf[5](S) vde[4](S) vdd[3] vdc[1] vdb[0]
      4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

ok, raid's up, but checking the data actually stored on disk on the host system shows:

root@smilla:/raid/libvirt/images# ls -l raidtest-{1..3}.qcow2
-rw-r--r-- 1 libvirt-qemu kvm     393216 Feb  7 18:06 raidtest-1.qcow2
-rw-r--r-- 1 libvirt-qemu kvm     393216 Feb  7 18:06 raidtest-2.qcow2
-rw-r--r-- 1 libvirt-qemu kvm 2146500608 Feb  7 18:06 raidtest-3.qcow2

Does this mean the raid-5 is actually initiated as a raid-4?

Vennlige hilsener / Best regards

roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
[email protected]
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et elementært imperativ for alle pedagoger å unngå eksessiv anvendelse av idiomer med xenotyp etymologi. I de fleste tilfeller eksisterer adekvate og relevante synonymer på norsk. --
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 11 lines · Roy Sigurd Karlsbakk

Hi all

I have a test vm on which I do some testing of md raid. Just tried

root@raidtest:~# mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/vd{b..d}
(wait a bit)
root@raidtest:~# cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid5 vdf[5](S) vde[4](S) vdd[3] vdc[1] vdb[0]
      4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

Where did vde & vdf spring from? They weren't in your create command - did you add those as spares later?

Quoted 9 lines

ok, raid's up, but checking the data actually stored on disk on the host system shows:

root@smilla:/raid/libvirt/images# ls -l raidtest-{1..3}.qcow2
(quoted diff) +0 -3
-rw-r--r-- 1 libvirt-qemu kvm     393216 Feb  7 18:06 raidtest-1.qcow2
-rw-r--r-- 1 libvirt-qemu kvm     393216 Feb  7 18:06 raidtest-2.qcow2
-rw-r--r-- 1 libvirt-qemu kvm 2146500608 Feb  7 18:06 raidtest-3.qcow2

Does this mean the raid-5 is actually initiated as a raid-4?

RAID-5 is always created with n-1 disks, with the final disk being recovered afterwards. It's quicker to do a linear read from the other disks and a linear write onto the final disk (creating parity or rebuilding the data as needed) than it is to intersperse reads & writes on all disks and just create the parity data (for RAID5 anyway - reconstructing the data on a RAID6 from P & Q parity is far more expensive, so it's quicker to just generate the parity there).

HTH,
Robin

Signature · 4 lines
     ___        
    ( ' }     |       Robin Hill        <[email protected]> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |
#2 lore raw
Quoted 9 lines
Quoted 6 lines
root@raidtest:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5]
[raid4] [raid10]
md0 : active raid5 vdf[5](S) vde[4](S) vdd[3] vdc[1] vdb[0]
      4191232 blocks super 1.2 level 5, 512k chunk, algorithm 2
      [3/3] [UUU]

Where did vde & vdf spring from? They weren't in your create command - did you add those as spares later?

Yes

Quoted 11 lines
Quoted 3 lines

Does this mean the raid-5 is actually initiated as a raid-4?

RAID-5 is always created with n-1 disks, with the final disk being recovered afterwards. It's quicker to do a linear read from the other disks and a linear write onto the final disk (creating parity or rebuilding the data as needed) than it is to intersperse reads & writes
on all disks and just create the parity data (for RAID5 anyway - reconstructing the data on a RAID6 from P & Q parity is far more expensive, so it's quicker to just generate the parity there).

ok, so do I understand correctly that the initial raid-5 build only writes data/parity to a single drive (the 'replacement')? Doing some more testing now to see what I can find…

Vennlige hilsener / Best regards

roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
[email protected]
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et elementært imperativ for alle pedagoger å unngå eksessiv anvendelse av idiomer med xenotyp etymologi. I de fleste tilfeller eksisterer adekvate og relevante synonymer på norsk. --
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 3 lines

ok, so do I understand correctly that the initial raid-5 build only writes data/parity to a single drive (the 'replacement')? Doing some more testing now to see what I can find…

Now, this is interesting. Initiating a raid-5 will create parity blocks (and perhaps data blocks) for the other drives, growing it will recreate parity for them all, which is normal. now, creating an empty raid-6 takes merely second, on the same (virtual) drive size (only more drives). What does the raid-6 code do that the raid-5 code could (or should?) have done?

Vennlige hilsener / Best regards

roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
[email protected]
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et elementært imperativ for alle pedagoger å unngå eksessiv anvendelse av idiomer med xenotyp etymologi. I de fleste tilfeller eksisterer adekvate og relevante synonymer på norsk. --
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html