This seems like a GREAT thing to have written up as HOWTO...

David

On Sunday 06 February 2005 05:16 pm, Remy Blank wrote:
> Nick Smith wrote:
> > also, what about a mirrored raid? is it possible to create one
> > without having to start from scratch and reinstall? like just add the
> > drive to mirror to and mirror it? what would be the best solution for my
> > situation?
>
> The advantage of RAID is that you have an always-up-to-date copy of your
> disk. You can transfer your existing install to a RAID configuration,
> but it involves doing a full file-by-file copy. The procedure goes along
> the following:
>
> - Perform a backup of your important data. Just in case.
> - Do an orderly shutdown of your system.
> - Install your new hard drive. Put it on another channel than the first
> drive (for example, if your first hard drive is hda, install the new
> drive on the second channel, as either hdc or hdd). The following
> assumes it is hdc.
> - Boot from a liveCD (e.g. Knoppix).
> - Insert the raid1 module:
>    # insmod raid1
> - Partition your new disk to have approximately the same layout as the
> old one. Set the partition type to fd (Raid autodetect):
>    # fdisk /dev/hdc
> - Create new (degraded) md devices for every partition, with two
> devices, one being a partition of your new disk, and the other one
> marked as missing:
>    # mdadm --create /dev/md0 -l 1 -n 2 /dev/hdc1 missing
>    # mdadm --create /dev/md1 -l 1 -n 2 /dev/hdc2 missing
>    ...
> - Create filesystems on the new md devices, for example ext3 or swap:
>    # mke2fs -j /dev/md0
>    # mkswap /dev/md1
>    ...
> - Mount both the old disk and the new md devices, and copy the content
> of all partitions from the old disk to the new one:
>    # rsync -avH /mnt/hda1/ /mnt/md0
>    ...
> - Edit a few strategic files (fstab, lilo.conf or grub.conf, etc) on the
> md devices to reflect that your new root filesystem is on /dev/md?
> instead of /dev/hda?
> - Do a poweroff.
> - Swap both hard drives. From now on, your old disk is /dev/hdc and your
> new disk is /dev/hda.
> - Re-boot into the liveCD, re-insert the raid1 module, re-mount your md
> devices.
> - If you use lilo, re-run it on the md device:
>    # lilo -r /dev/md0
> - Reboot, but without the liveCD, this time. You should boot into the
> same system as before you started, except it is now running from a
> degraded RAID1.
> - Check that *everything* works as expected. Do a real *thorough* test,
> because the next steps will wipe all the data on your old disk.
> - Partition the *old* disk to have the same layout as your new disk. If
> the partition sizes don't match exactly, create them slightly bigger
> than on your new disk. Also set the partition type to fd.
> - Hot-add the partitions from your old disk to the degraded RAID devices:
>    # mdadm /dev/md0 -a /dev/hdc
> - Re-run lilo if that's your bootloader.
> - You can watch the reconstruction process with:
>    # watch -n 10 cat /proc/mdstat
> - Et voil�! Your existing install has been tranfered to a RAID1 system.
>
> I have performed this operation several times, and it works like a
> charm. Note that this is all from memory, so I might have missed a few
> points. I would suggest you only embark on such a procedure if you fully
> understand what happens at every step, and are prepared to improvise in
> case I have missed something.
>
> HTH.
> -- Remy
>
>
> Remove underscore and suffix in reply address for a timely response.
>
>
> --
> [email protected] mailing list

--
[email protected] mailing list

Reply via email to