[CentOS] Migrating to RAID

Thomas Harold thomas-lists at nybeta.com
Thu Dec 10 23:20:24 UTC 2009

On 12/10/2009 10:39 AM, Matt wrote:
> I have CentOS 4.x installed on a single 500GB SATA drive.  Drive is
> about 10 percent used.  I would like to migrate to software RAID 5
> without reinstalling the OS.  Was thinking 3 500GB drives.  Is that
> possible or must I reinstall?

Moving to RAID-1 is going to be fairly easy.  Moving to RAID-5 or RAID-6 
will be a good bit trickier.

You're going to want a good bare-metal backup (maybe Mondo Rescue 
http://www.mondorescue.org/) before you get started.

Then your basic process is going to be:

- make sure that mdadm is loading
- partition the new 500GB disks similar to the old disk
- build mdadm raid1 arrays on the new 500GB disk (with 1 drive missing)
- copy your files over (cp -a)
- make sure grub is on the new disk
- change your fstab on the new disk to mount the arrays (/dev/mdX) 
instead of the partitions (/dev/sdaX)
- remove the old disk and see if you can boot up on the new one

I'm sure I'm forgetting something, just remember that you'll want to 
make lots and lots of backups (on a 3rd and 4th disk).  And be ready to 
rebuild or restore from the bare-metal backup if you screw up.

More information about the CentOS mailing list