Wednesday, May 24, 2006

linux software raid root /

For my own reference, raid is good.

Create degraded raid1 first,
mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/sdb2
mke2fs -j /dev/md0

mount /dev/md0 /mnt

Clone the / filesystem.
cd /mnt
tar -C / -clspf - . | tar -xlspvf -
change /mnt/etc/fstab

change /boot/grub/menu.lst
root=/dev/md0
mkinitrd --with=raid1 ...
(at least for CentOS 4.2, raid1 is not included in default initrd)

Following command to see the status,
cat /proc/mdstat

after reboot, add the other mirror,
mdadm /dev/md0 -a /dev/sda2


This page is powered by Blogger. Isn't yours?