create a bootable raid ###################### see: http://www.linuxdoc.org/HOWTO/Boot+Root+Raid+LILO.html#toc4 ###################### - have 2 (may be identical) disks (hda and hdc) - install normally on hda - make same partitions on hdc as on hda - change partition type to "fd" for those partitions that will be in a raid set (on both disks!) # /etc/raidtab to create bootable root device # on software raid >> # md0 is the root array raiddev /dev/md0 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc2 raid-disk 0 # this is our old disk, mark as failed for now device /dev/hda2 failed-disk 1 # md1 is the /boot array raiddev /dev/md1 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc1 raid-disk 0 # boot is marked failed as well device /dev/hda1 failed-disk 1 # md2 is the swap array #raiddev /dev/md2 #raid-level 1 #nr-raid-disks 2 #chunk-size 32 ## Spare disks for hot reconstruction #nr-spare-disks 0 #persistent-superblock 1 #device /dev/hdc3 #raid-disk 0 ## boot is marked failed as well #device /dev/hda3 #failed-disk 1 # md3 is the /usr array raiddev /dev/md3 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc5 raid-disk 0 # boot is marked failed as well device /dev/hda5 failed-disk 1 # md4 is the /opt array raiddev /dev/md4 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc6 raid-disk 0 # boot is marked failed as well device /dev/hda6 failed-disk 1 # md5 is the /var array raiddev /dev/md5 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc7 raid-disk 0 # boot is marked failed as well device /dev/hda7 failed-disk 1 # md6 is the /tmp array raiddev /dev/md6 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc8 raid-disk 0 # boot is marked failed as well device /dev/hda8 failed-disk 1 # md7 is the /home array raiddev /dev/md7 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc9 raid-disk 0 # boot is marked failed as well device /dev/hda9 failed-disk 1 # md8 is the /data array raiddev /dev/md8 raid-level 1 nr-raid-disks 2 chunk-size 32 # Spare disks for hot reconstruction nr-spare-disks 0 persistent-superblock 1 device /dev/hdc10 raid-disk 0 # boot is marked failed as well device /dev/hda10 failed-disk 1 << ##################################### power:~ # mkraid /dev/md0 handling MD device /dev/md0 analyzing super-block disk 0: /dev/hdc2, 1052257kB, raid superblock at 1052160kB disk 1: /dev/hda2, failed power:~ # mkraid /dev/md1 handling MD device /dev/md1 analyzing super-block disk 0: /dev/hdc1, 24066kB, raid superblock at 24000kB disk 1: /dev/hda1, failed power:~ # mkraid /dev/md3 handling MD device /dev/md3 analyzing super-block disk 0: /dev/hdc5, 4200966kB, raid superblock at 4200896kB disk 1: /dev/hda5, failed power:~ # mknod -m 660 /dev/md4 b 9 4 power:~ # chown root:disk /dev/md4 power:~ # mkraid /dev/md4 handling MD device /dev/md4 analyzing super-block disk 0: /dev/hdc6, 3148708kB, raid superblock at 3148608kB disk 1: /dev/hda6, failed power:~ # mknod -m 660 /dev/md5 b 9 5 power:~ # mknod -m 660 /dev/md6 b 9 6 power:~ # mknod -m 660 /dev/md7 b 9 7 power:~ # mknod -m 660 /dev/md8 b 9 8 power:~ # mknod -m 660 /dev/md9 b 9 9 power:~ # mknod -m 660 /dev/md10 b 9 10 (since in a default installation, there are only /dev/md0-3) power:~ # chown root:disk /dev/md* power:~ # mkraid /dev/md5 handling MD device /dev/md5 analyzing super-block disk 0: /dev/hdc7, 530113kB, raid superblock at 530048kB disk 1: /dev/hda7, failed power:~ # mkraid /dev/md6 handling MD device /dev/md6 analyzing super-block disk 0: /dev/hdc8, 530113kB, raid superblock at 530048kB disk 1: /dev/hda8, failed power:~ # mkraid /dev/md7 handling MD device /dev/md7 analyzing super-block disk 0: /dev/hdc9, 10490413kB, raid superblock at 10490304kB disk 1: /dev/hda9, failed power:~ # mkraid /dev/md8 handling MD device /dev/md8 analyzing super-block disk 0: /dev/hdc10, 9004401kB, raid superblock at 9004288kB disk 1: /dev/hda10, failed mkreiserfs -h tea /dev/md ... [0,3-8] mke2fs /dev/md1 (/boot is too small for reiserfs) mount /dev/md0 /mnt mount /dev/md1 /mnt/boot mount /dev/md3 /mnt/usr mount /dev/md4 /mnt/opt mount /dev/md5 /mnt/var mount /dev/md6 /mnt/tmp mount /dev/md7 /mnt/home mount /dev/md8 /mnt/data cd / umount [all that is not on hda: /old, /archive] cp -a `ls | grep -v mnt | grep -v proc` /mnt mkdir /mnt/proc mkdir /mnt/mnt reboot (still from hda) ######################################## testing with boot floppy fdformat /dev/fd0u1440 (fd0u1440 for suse, else fd0U1440) mkfs.ext2 /dev/fd0 mount -t ext2 /dev/fd0 /mnt cp -dp /boot/vmlinuz /mnt cp -dp /boot/map /mnt cp -dp /boot/boot.b /mnt edit /mnt/lilo.conf: >> boot=/dev/fd0 map=/mnt/map install=/mnt/boot.b prompt timeout=50 image=/mnt/vmlinuz label=linux-raid root=/dev/md0 read-only << end lilo.conf rdev /mnt/vmlinuz /dev/md0 lilo -C /mnt/lilo.conf reboot (from floppy) ############################################## change "failed-disk" to "raid-disk" in /etc/raidtab raidhotadd /dev/mdX /dev/hdaX (hours!) set partition type to fd on ALL disk partitions (all disks, that is ;-) the system still boots from hda2 when booted from hda2, linux cannot add hda2 to softraid. for adding the second partition (hda2) to the root partition: make boot floppy as above in /mnt/lilo.conf add the lines image=/mnt/vmlinuz root=/dev/hdc2 boot system from floppy, wait for the softraid to be updated (hours!) final /etc/lilo.conf: >> # LILO configuration file # Start LILO global Section password=bootpasswd restricted append="vga=0x0303" disk=/dev/md0 bios=0x80 sectors=63 heads=255 cylinders=3739 partition=/dev/md1 start=63 boot=/dev/hda map=/boot/map install=/boot/boot.b compact # faster, but won't work on all systems. linear vga = normal # force sane state message=/boot/message menu-scheme=Wg:kw:Wg:Wg read-only prompt timeout=100 # End LILO global Section # image = /boot/vmlinuz label = power initrd = /boot/initrd # image = /boot/memtest.bin label = memtest86 optional <<