https://wiki.archlinux.org/index.php/RAID
http://linux-101.org/howto/arch-linux-software-raid-installation-guide
http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU%20GRUB%20simplified.html
Install to sda
grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)
Install to sdb
grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
fdisk, create sda1/sda2 split for /boot and /
sfdisk pipe to duplicate sfdisk /dev/sda | sfdisk - # --force if need be.
mdadm --create /dev/md0 --level=1 --raid-devices=2 --metadata=0.90 /dev/sda1 /dev/sdb1
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --create /dev/md1 --level=linear --force --raid-devices=1 /dev/md1
Add a device:
mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mdadm --grow /dev/md1 -a /dev/md3
mount -o remount,resize /
mdadm --examine --scan > /etc/mdadm.conf
mkinitcpio -p linux
Modify /tmp/pacman.conf with extra mirrors and proxy/cache options.
Do install.
Add mdadm to HOOKS immediately before filesystems, linear to MODULES in mkinitcpio.conf.
oot@packrat ~# cat /lib/initcpio/install/supermdadm
# vim: set ft=sh:
# Custom written for packrat by Teran.
build()
{
MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") "
BINARIES=""
FILES=""
SCRIPT="supermdadm"
add_file "/etc/mdadm.conf"
add_binary "/sbin/mdadm"
}
help ()
{
cat< This hook loads the necessary modules for any raid root device,
and assembles the raid device when run.
HELPEOF
}
oot@packrat ~# cat /lib/initcpio/hooks/supermdadm
# vim: set ft=sh:
# Custom written for packrat by Teran.
run_hook ()
{
modprobe md_mod 2>/dev/null
mdadm --assemble /dev/md0
mdadm --assemble /dev/md2
mdadm --assemble /dev/md1
}
Linux 3.0? ZOMG
CMOS battery.
Live drive swap test. pull sda, put into sdb on other server. pull sdc, put into sdc.
sfdisk -d /dev/sdb | sfdisk /dev/sda # --force if need be
grub copy:
check which one really has grub
dd if=/dev/sda bs=512 count=1 | hexdump -C # Look for GRUB Geom Hard Disk Read, etc.
dd if=/dev/sda bs=512 count=1 of=/dev/sdb
dd if=/dev/sda count=2048 bs=512 of=/dev/sdb # Check for partition start with fdisk
partprobe or reboot to reload partition table. no need to sfdisk if dding 2048 512byte secotrs, as part of the 512 byte MBR is the partition table.
mdadm --manage /dev/md0 --add /dev/sda1
cat /proc/mdstat to check
mdadm --manage /dev/md2 --add /dev/sda2
mdadm --manage /dev/md3 --add /dev/sdc