0

I created a software raid 5 disk using: mdadm -C /dev/md2 -l5 -n4 /dev/sd[i-l]

at the same time I'm using dstat to see io-activity: dstat -c -d -D total,sda1,md2,sdi,sdj,sdk,sdl -l -m -n

and notice that disks sd[i-k] are all read from and sdl is written to. Now, I do understand that raid5 has to be configured, but it takes a really long time and all disks are clean & formatted (using xfs) so I figure there might be some kind of shortcut to skip (unnecessary? ) checking.. Is it?

The creation is part of a time-critical nightly batch-process (run on amazon ec2) so it's not a one-time thing.

Thanks, Geert-Jan

Gbrits
  • 683
  • 1
  • 7
  • 9

2 Answers2

2

No way around this AFAIK - it's normal and expected. The way RAID 5 initialization works is to basically run a rebuild - under the hood mdadm creates a degraded RAID and then runs a rebuild on it.

Why are you using RAID 5 if this is an nightly (throw away?) batch process?

For RAID 1 you can use --assume-clean which skips the initial mirror.

James
  • 7,643
  • 2
  • 24
  • 33
  • ok thanks I thought that much. Raid5 is created over so called EBS-volumes. As you may already know, these can be attached / detached from a server and added to another later on. The batchprocess creates fresh content on the EBS-raid, the EBS is detached from this process when done, and later attached to the frontend, swapping out the EBS-raid from the day before. So although, its nightly, it's not throw-away. – Gbrits Apr 20 '10 at 21:08
  • You can use --assume-clean with RAID5 as well, but it is dangerous. md uses an optimization on some writes that relies on the parity block being correct. – kbyrd Apr 21 '10 at 01:56
0

For RAID5 to work each bit on each drive has to be set properly so parity can be calculated. If writes are occurring as well then your assumption that the drives are clean isn't right (although, to be fair, for a virtual machine it doesn't seem like a bad assumption to make).

If you're using a virtual machine anyways why don't you just create an image with that drive already set up? When you need the fresh drive just spin up your new instance with the preconfigured raid.