[[!tag linux mdadm]]
I've just more than doubled my desktop's disk I/O speed. Neat, eh?
My desktop machine has four identical hard disks. I keep backups of anything I care about, and I run some disk-intensive things from time to time. Thus, I want the disk subsystem to be as fast as possible, and I don't care about using RAID to recover from disk problems.
When I initially installed the system, however, I couldn't coax the Ubuntu installer to create a RAID0 for me, so it used plain LVM only. Yesterday I spent a day to re-install the system, and got it done. Not entirely straightforward, though.
The alternate installer lets you create RAID systems. However, it fails to install a boot loader if you do that on the entire disks. The final partitioning scheme I ended up with uses LVM for the root and swap partitions, and then RAID0 for a big scratch partition. I also have /boot on a separate partition, to get the boot loader (GRUB or LILO) to work.
In other words, every disk has three partitions:
- a 10 GiB LVM physical volume
- a 500 MiB volume
- the rest as a RAID0 physical volume
The 500 MiB volume on the first disk is used for /boot, and is unused on the three other disks, wasting 1.5 GiB, but that's small enough that I don't care.
Was this worth it? I think so. Russell Coker's bonnie++ gives me the following results for the non-striped LVM volume, i.e., essentially for one disk:
------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
16G 54932 78 58243 14 28037 6 58412 67 61662 6 261.2 0
In comparison, the RAID0 gets the following results:
------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
16G 68732 95 143030 29 65331 14 76887 97 152345 17 394.6 1
That's a speedup of about 2.5 times. I'm sure it could be better: in theory, a speedup of 4 times would be possible, but that's the theory. I'm going to be satisified with this, for now.