I wanted to give few extra years to our old griffin.linux.hr server (which was replaced with new SMP Celeron box), so I decided to turn it into WiFi AP. However, it came with two disks, one of 4.3Gb (QUANTUM FIREBALL CR4.3A) and one with 6.4Gb (SAMSUNG SV0644A). Since those disks used to be ftp site, I don't trust them much, and hence I decided to put software RAID 1 on them.
For this project I used:
1. pentium server (SMP with P5/200)Procedure involves many steps, and some of them must be performed in this order. However, that is not the only possible order. Helpful hints are marked specially.
Debian Woody (3.0r0 and latest unstable)
linux kernel 2.4.18
Hint: You will have to have correct boot cd for that floppies. In time of writing, floppies are for boot CD 2.4.18-bf2.4 on same location. Don't try with wrong boot disk, it won't work!
Hint: Have floppy in drive before you press enter on extdisk!
Hint: Switch units to sectors in fdisk to make partitions exact size. You can partition rest of bigger disk normally (as 83 - Linux).
Hint: You really want to have /boot partition on both disks which are in mirror below 1024th cylinder (I will repeat this again later).
Hint: You can write template for this file (/tmp/rt) and then multiply it by number of partitions that you have with cat /tmp/rt /tmp/rt > /etc/raidtab.
Also, it makes sense to call md* devices the same as partitions.
raiddev /dev/md1 raid-level 1 nr-raid-disks 2 nr-spare-disks 0 chunk-size 64 persistent-superblock 1 device /dev/hda1 raid-disk 0 device /dev/hdc2 failed-disk 1
Hint: It makes good sense to put disks on separate IDE channels. Just take a look at speed comparison at the end.
Hint: If you get error whey you try to run mkraid like this:
# cd /tmp/lvmext/bin
# ./mkraid /dev/md*
Hint: mke2fs -j /dev/md1 to make it ext3, of course :-)
Hint: Alternative is to recompile a new kernel with raid support built in. However, on slower machines it would take much more time.
Hint: You might want to add do_initrd = Yes to /etc/kernel-img.conf to avoid warnings...
Hint: If you installed kernel which is not 2.4.18-586tsc, change that in mkinitrd line.
Hint: You should see someting like:Boot image: /vmlinuz -> boot/vmlinuz-2.4.18-586tsc Mapping RAM disk /initrd.img -> /boot/initrd.img-2.4.18-586tsc Added Linux *If there isn't 'Mapping RAM disk' part, you might want to change initrd line in lilo.conf
Hint: /boot partition (with your kernel) and lilo boot= option must point to same partition (/dev/md1) for this to work!
/boot partition must be below 1024 cylinder on both disks in mirror for raid-extra-boot to work correctly!
Hint: You will probably want to do apt-get install hdparm and hdparm -d 1 /dev/hda; hdparm -d 1 /dev/hdc before adding disk to mirror. Speed comparison will show you why.
Hint: I had various problems with lilo during usage. At one moment, I swapped disks on first and second IDE channel, so Quantum end up on second IDE channel while Samsung moved to first one. I haven't been able to write correct boot block on /dev/md1 device because I didn't have /boot partition below 1024 cylinder on both disks (because they had different geometry). You have been warned -- take extra care about 1024 cylinder limit, even with modern lilo.
So, use DMA modes with hard drives, especially larger ones.
partition description time (real) time with dma /dev/md1 mirror raid1 from /dev/hda1 (Samsung 6.4Gb) and /dev/hdc1 (Qunatum 4.3Gb) 8.930s 3.825s /dev/hda3 non-mirror on rest of Samsung 6.4Gb (also used for mirror) 8.905s 4.516s /dev/hdf1 non-mirror on IBM-DJNA-371350 13Gb (on separate CMD649 controller) 13.450s 4.558s