Creating a RAID 1 from existing drive
Tom H
tomh0665 at gmail.com
Thu Jun 24 05:55:22 UTC 2010
On Wed, Jun 23, 2010 at 10:38 PM, Eric Dannewitz <ericdano at gmail.com> wrote:
> I have a Ubuntu server that has one HD in it right now. I just obtained
> another drive that is exactly the same (manufactor/size/model). Is it
> possible to mirror the existing drive with this one? If so, how? Do I need
> to reformat anything?
A non-detailed guide (I hope that I won't forget anything!):
(To be adjusted if you want a non-mdadm'd /boot or don't have just one
partition)
Assume that sda1 is swap, sda2 is /, and sdb is the new disk.
Duplicate sda's partitions onto sdb with
sfdisk -d /dev/sda | sfdisk /dev/sdb
Set sdb2 as auto raid with fdisk or parted
Create md0 and md1 with "--raid-devices=1"
Run mkswap and mkfs
Mount md1 and rsync sda1 onto it, excluding directories like /dev,
/lost+found, ...
Create the excluded directories on md1 and chroot into it
Edit fstab to use md0 and md1
Install grub
Exit the chroot and reboot from md1
Grow md0 and md1 and add sda1 and sda2 to them
More information about the ubuntu-users
mailing list