single HDD LVM convert to RAID1 without LVM Problems
Posted: 2012/03/02 10:34:49
I hav to change a running single HDD LVM to a (software) RAID1:
I started following this howto: (which isn't exactly what I want, because it ends up in a RAID with LVM):
I successfully did the following so far:
on the additional HDD I created a raid array with the first drive missing:
[code]cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb3[1]
157291319 blocks super 1.2 [2/1] [_U]
md0 : active raid1 sdb1[1]
530101 blocks super 1.2 [2/1] [_U]
unused devices: <none>[/code]
I transfered the content of /boot to /dev/md0 and the content of / to /dev/md1 using rsync (because the lvm commands obviously won't work here).
I created the initrd image and edited /boot/grub/menu.lst to boot from the rai partitions and do a failback to the running system:
[quote]
default=0
fallback=1
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS RAID (2.6.32-220.4.2.el6.i686)
root (hd1,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/md1 rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys crashkernel=auto quiet
initrd /initramfs-2.6.32-220.4.2.el6.i686.img-raid
title CentOS (2.6.32-220.4.2.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root rd_NO_DM
initrd /initramfs-2.6.32-220.4.2.el6.i686.img
[/quote]
But grub complains it can't mount the selected file system.
My guess is the transfer via rsync is not the best way and the filesystem is deprected.
Can anyone hint me how to get the filesystem trasnferd corrctly or who to repair the filesystem on the raid partition?
Thanks
I started following this howto: (which isn't exactly what I want, because it ends up in a RAID with LVM):
I successfully did the following so far:
on the additional HDD I created a raid array with the first drive missing:
[code]cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb3[1]
157291319 blocks super 1.2 [2/1] [_U]
md0 : active raid1 sdb1[1]
530101 blocks super 1.2 [2/1] [_U]
unused devices: <none>[/code]
I transfered the content of /boot to /dev/md0 and the content of / to /dev/md1 using rsync (because the lvm commands obviously won't work here).
I created the initrd image and edited /boot/grub/menu.lst to boot from the rai partitions and do a failback to the running system:
[quote]
default=0
fallback=1
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS RAID (2.6.32-220.4.2.el6.i686)
root (hd1,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/md1 rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys crashkernel=auto quiet
initrd /initramfs-2.6.32-220.4.2.el6.i686.img-raid
title CentOS (2.6.32-220.4.2.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.4.2.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto quiet rd_LVM_LV=VolGroup/lv_root rd_NO_DM
initrd /initramfs-2.6.32-220.4.2.el6.i686.img
[/quote]
But grub complains it can't mount the selected file system.
My guess is the transfer via rsync is not the best way and the filesystem is deprected.
Can anyone hint me how to get the filesystem trasnferd corrctly or who to repair the filesystem on the raid partition?
Thanks