[CentOS] Convert "bare partition" to RAID1 / mdadm?

Lists

lists at benjamindsmith.com
Fri Jul 25 00:11:00 UTC 2014


I have a large disk full of data that I'd like to upgrade to SW RAID 1 
with a minimum of downtime. Taking it offline for a day or more to rsync 
all the files over is a non-starter. Since I've mounted SW RAID1 drives 
directly with "mount -t ext3 /dev/sdX" it would seem possible to flip 
the process around, perhaps change the partition type with fdisk or 
parted, and remount as SW RAID1?

I'm not trying to move over the O/S, just a data paritition with LOTS of 
data. So far, Google pounding has resulted in howtos like this one 
that's otherwise quite useful, but has a big "copy all your data over" 
step I'd like to skip:

http://sysadmin.compxtreme.ro/how-to-migrate-a-single-disk-linux-system-to-software-raid1/

But it would seem to me that a sequence roughly like this should work 
without having to recopy all the files.

1) umount /var/data;
2) parted /dev/sdX
     (change type to fd - Linux RAID auto)
3) Set some volume parameters so it's seen as a RAID1 partition 
"Degraded". (parted?)
4) ??? Insert mdadm magic here ???
5) Profit! `mount /dev/md1 /var/data`

Wondering if anybody has done anything like this before...

-Ben



More information about the CentOS mailing list