corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image

Ubuntu RAID

My hard drive on the old server were almost full. The postgres database grew to be almost 100GBytes, and I had to do something otherwise an anticipated server crash is on the way. The solution I had in mind is to use the old server, which already has two 150GB hard drives. Making one volume using the two drives can be accomplished in several ways, the easiest way is to create a logical volume out of the two. The other way is to make a software RAID 0 array. In RAID 0, the kernel stripes the data across the hard drives, so a sector gets stored half on each drive. This in theory should lead to twice the throughput, however SATA and IDE are serial devices so the bottle neck will be how fast is your SATA or IDE device.

So it took me a while to set up the RAID 0 array on the box using UBUNTU and the reason is that we have to use the server installation CD. The GUI desktop CD does not have the RAID option - or at least I wasn’t able to figure out where to find it. On the server CD, the easiest way is first to create two identical partitions on the two hard drives, and select the partition types as RAID. An option will then appear that says something like “Create a software RAID device”. You can use that to include both partitions in the RAID device. Remember that you must have a small /boot ext3 may be 100MB, and swap partitions.

There was an obvious increase in performance over a single drive, although I did not measure before and after but from what I see the intensive hard disk operations that used to saturate the drives when monitored by atop no longer does that. My interpretation is because the peak bandwidth of the SATA controller is larger than any hard disk by itself plus we have buffers in every hard disk, so effectively we’re using twice as much buffers.

Moving the database and websites took almost all the night, I started pg_dump on one machine over ssh, piping on the other side in a psql process. I stayed two hours after I started it, then I gave up and went to sleep. In the same time I had processes running to sync the files and my subversion repository.

Technorati Tags: , ,

Tags: , ,

corner image corner image

corner image corner image

Leave a Reply

corner image corner image
1,372 spam comments
blocked by
Akismet