Software Raid's
Building a RAID1 (boot) / RAID5 (root) with ASUS P5GDC-V Deluxe
For the fast and furious:
tools:
Most important steps for /dev/md0
- Install Lilo 22.6
- mknod /dev/md0 b 9 0
- mdadm -Cv /dev/md0 -l1 -n4 -c128 missing /dev/sdb1 /dev/sdc1 /dev/sdd1
- mkfs.jfs /dev/md0
- umount /boot
- mdadm -a /dev/md0 /dev/sda1 -> (4 disks=[UUUU], only possible if /boot not mounted)
- mkdir /mnt/newroot
- mknod /dev/md1 b 9 1
- mount /dev/md1 /mnt/newroot (do not yet hot-add the 4th disk!)
- mkdir /mnt/newroot/boot
- mount /dev/md0 /mnt/newroot/boot
- find . -xdev | cpio -pm /mnt/newroot (do not use: cp -ax / /mnt/newroot!!)
- fdisk /dev/sda and make /dev/sda1 and /dev/sda3 "fd"
- mount -o bind /dev /mnt/newroot/dev/
- mount -o bind /proc /mnt/newroot/proc/
- chroot /mnt/newroot /bin/bash/
- Edit lilo.conf so boot = /dev/md0
- Lilo -x mbr (Thanks John!!)
- Edit /etc/fstab
- The End: Do not forget to 'fd' /dev/sda1 and /dev/sda3
- If you can not mount /dev/md0 redo mkfs.jfs.
- Do not forget: To mdadm -a you must boot on md1.
- And: Do not forget to create the initial console when you are chrooted in /mnt/newroot:
To see which devices nodes are present before the /dev filesystem is mounted, run the following commands:
- mkdir test
- mount --bind / test
- cd test/dev
- ls
The devices needed for a successful boot are /dev/null and /dev/console. If they didn't show up in the previous test, you have to create them manually. Issue the following commands in the test/dev/ directory:
- mknod -m 660 console c 5 1
- mknod -m 660 null c 1 3
When you're finished, don't forget to unmount the test/ directory:
- cd ../..
- umount test
- rmdir test
Speed Settings for Syncing
- /proc/sys/dev/raid/speed_limit_min
- echo 50000 >/proc/sys/dev/raid/speed_limit_min
When having Lilo problems
- boot from CD
- mknod /dev/md0 b 9 0
- mknod /dev/md1 b 9 1
- mdadm --assemble --run /dev/md0 /dev/hda1
- mdadm -a /dev/md0 /dev/hdc1
- mount /dev/md1 /mnt/gentoo
- mount /dev/md0 /mnt/gentoo/boot
- mount -o bind /dev /mnt/gentoo/dev
- mount -o bind /proc /mnt/gentoo/proc
- lilo -x mbr
Growing a Software Raid1
- mdadm --grow /dev/md1 --size=max - also see http://www.silfreed.net/content/argo-hard-drive-upgrade-growing-raid1-array
- Resizing with JFS: # mount -o remount,resize /mount/point - also see http://www.linux.com/articles/32002