else remove the partitions on the second disk by hand pbefore starting this procedure
start fdisk and follow these commands
fdisk /dev/sdb n p 1 [enter] +100M n p 2 [enter] +2048M n p 3 [enter] [enter] t 2 82 t 3 fd w
mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1 mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/sdb3 echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9]' > /etc/mdadm.conf mdadm --detail --scan >> /etc/mdadm.conf
mkfs.ext3 /dev/md0
pvcreate /dev/md1 vgcreate vg1 /dev/md1 lvcreate --name root -L 4G vg1 lvcreate --name usrlocal -L 4G vg1 lvcreate --name var -L 4G vg1 lvcreate --name export -L <bigger than the disk>G vg1 lvcreate --name export -l <extens available reported by the previous command> vg1
mkfs.ext3 /dev/vg1/root mkfs.ext3 /dev/vg1/usr/local mkfs.ext3 /dev/vg1/var mkfs.ext3 /dev/vg1/export
mkdir /1 mount /dev/vg1/root /1 cd /1 mkdir -p boor usr/local var export proc sys dev mount /dev/md0 boot mount /dev/vg1/usrlocal usr/local mount /dev/vg1/var var mount /dev/vg1/export export
rsync -aH --exclude=/1 --exclude=/proc --exclude=/sys --exclude=/dev / /1/
vi /1/etc/fstab /dev/vg1/root / ext3 defaults 1 1 /dev/md0 /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/vg1/export /export ext3 defaults 1 2 /dev/vg1/var /var ext3 defaults 1 2 /dev/vg1/usrlocal /usr/local ext3 defaults 1 2 #LABEL=SWAP-sda2 swap swap defaults 0 0 LABEL=SWAP-sdb2 swap swap defaults 0 0
mkinitrd --preload raid1 --preload raid456 --preload sata_nv --fstab /1/etc/fstab /boot/initrd-$(uname -r)-raid.img $(uname -r)
title Fedora (2.6.23.15-80.fc7) RAID root (hd0,0) kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/vg1/root vga=791 selinux=0 noipv6 panic=30 initrd /initrd-2.6.23.15-80.fc7.img
title Fedora (2.6.23.15-80.fc7) RAID root (hd0,0) kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/vg1/root vga=791 selinux=0 noipv6 panic=30 initrd /initrd-2.6.23.15-80.fc7-2.img title Fedora (2.6.23.15-80.fc7) RAID root (hd1,0) kernel /vmlinuz-2.6.23.15-80.fc7 ro root=/dev/vg1/root vga=791 selinux=0 noipv6 panic=30 initrd /initrd-2.6.23.15-80.fc7-2-raid.img
grub root (hd1,0) [enter] setup (hd1) [enter] quit [enter]
* we need to copy the changes from the original disk to the new one
rsync -aH /boot/ /1/boot/
reboot
lvchange -a n vg0/root lvchange -a n vg0/usrlocal lvchange -a n vg0/var lvchange -a n vg0/export
lvremove vg0/root lvremove vg0/usrlocal lvremove vg0/var lvremove vg0/export
vgremove vg0 pvremove /dev/sda3
* now we can recreate the new partition table copying the partition of /dev/sdb to /dev/sda
sfdisk -d /dev/sdb | sfdisk /dev/sda
mdadm --manage /dev/md0 --add /dev/sda1 mdadm --manage /dev/md1 --add /dev/sda3
grub root (hd0,0) setup (hd0) quit
mkswap -L SWAP-sda2 /dev/sda2 swapon /dev/sda2
During Kernel upgrade the grub file must be manually modified in order to add the reference to the second disk