[CentOS] Turn an ext2 filesystem into a component of a mirrored RAID?

Les Mikesell lesmikesell at gmail.com
Mon Nov 27 22:14:48 UTC 2006

On Mon, 2006-11-27 at 12:13 -0800, Bart Schaefer wrote:
> We have a CentOS 3 server with about 300GB of data on an ext2
> filesystem that we need to mirror onto a new drive, which we're then
> going to pull out and put into a second server.  A straight
> disk-to-disk copy (with rsync, tar, or "cp -a" doesn't much matter)
> manages about 75MB per minute, which would take almost three days, and
> the system gets very sluggish while such a copy is going on, so we
> can't afford to just let it run.

If you can be down a few hours, you should be able to boot the
install CD in rescue mode and
dd bs=1M if=/dev/hda of=/dev/hdb (being very careful that those
are the correct devices for the source and target respectively).
I'd expect that to take about 3 hours to complete, depending on
your drives and controller.

> Is it possible, without loss of data, to convert the existing ext2
> filesystem into a mirrored software RAID, then add the new drive as a
> second device and let rebuilding the RAID take care of making the
> copy?  Even if this took more time, we've had good overall system
> performance with software RAIDs rebuilding in the background before,
> so it could run as long as necessary.  We'd then need to be able to
> remove the second device from the RAID and either convert it back into
> a plain ext2 or put it into a similar software RAID in the destination
> machine.
> Is this possible?  Is there another plan that would make more sense?

It's possible, but I wouldn't try it without a backup.  Another approach
would be to put the drive directly in the 2nd server and do the
rsync over the network.  This would probably complete over a weekend.
If the files are changing, you can do one run with the machine active,
then repeat it when no changes are happening.  The 2nd run should go
very quickly since it only has to copy the differences.

  Les Mikesell
   lesmikesell at gmail.com

More information about the CentOS mailing list