วันอังคารที่ 8 ธันวาคม พ.ศ. 2552

How to : Software Raid migration

Now use sfdisk to duplicate partitions from old drive to new drive:

#sfdisk -d /dev/sda | sfdisk /dev/sdb

Now use mdadm to create the raid arrays. We mark the first drive (sda) as "missing" so it doesn't wipe out our existing data:

#mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/sdb1

Now copy the remaining partitions. Be careful to match your md devices with your filesystem layout. This example is for my particular setup

mount /dev/md1 /mnt/var
cp -dpRx /var /mnt
... repeat for remaining folder.

Setting fstab, grub to boot from mdX

Reboot

At this point, you have all of your original data on the new drive, so we can safely add the original drive to the raid volume.

mdadm --add /dev/md0 /dev/sda1
mdadm --add /dev/md1 /dev/sda2
... repeat for remaining partitions.

Thanks to :
http://www.debian-administration.org/articles/238

ไม่มีความคิดเห็น:

แสดงความคิดเห็น