> Is there any chance of getting the software raid and/or root raid howto
> updated for whatever the current features of the MD device driver is?
> I'm thinking of using raid1 on a bootable drive (/, /usr, /var, /home
> partitions) and the documents mention some pitfalls, which may have been
> fixed in the MD driver but not documented in the HOWTO
Using latest raidpatch and raidtools, things got quite easy.
Feel free to verify what I wrote (I did that multiple times, but I wrote that
just out of my (volatile ;-) memory) and put it into a mini-howto:
Example with root-RAID5 on 3 SCSI disks, /boot manually mirrored:
ID 0 sda, ID 1 sdb, ID 2 sdc - this will get our future root-RAID array
ID 3 sdd - this will be used for install only and removed later
- get the raid stuff from ftp.kernel.org (or better from a mirror)
- /pub/linux/daemons/raid/alpha/ - you need a patch for your kernel and the
raidtools of same date
- install your system to sdd
- boot from sdd (set it as boot device in your scsi controller)
- read docs in raidtools subdirectory, read man pages of raidtools
- patch / compile / install RAID-Kernel, compile / install raidtools
- create partitions on sda, e.g.:
-- sda1 /boot 10 MB
-- sda2 swap 100 MB
-- sda3 / Rest (use id FD [raid autodetect])
- dd this partition table to the other raid disks:
-- dd if=/dev/sda of=/dev/sdb count=1
-- dd if=/dev/sda of=/dev/sdc count=1
- shutdown / reboot (with RAID kernel, still from sdd)
- create /etc/raidtab for sda3 sdb3 sdc3 (samples see docs in raidtools
subdirectory)
- mkraid /dev/md0
- check /proc/mdstat for ongoing resync
- read docs in raidtools subdirectory (search for description of mke2fs options)
- mke2fs ........... /dev/md0
- mke2fs /dev/sda1
- mkswap /dev/sda2 (same with sdb2 and sdc2)
- mount your future root partition (/dev/md0) to /mnt
- mount your future /boot partition (/dev/sda1) to /mnt/boot
- copy your whole system to /mnt
- adapt /mnt/etc/fstab to have /dev/md0 as root filesystem, make correct
entries for swap (sda2 sdb2 sdc2, all same pri=1) and for /boot (sda1)
- edit /mnt/etc/lilo.conf and adapt it to boot from 1st RAID disk (sda),
root device will be /dev/md0. Better make a raid kernel backup entry in LILO to
be sure to have a working RAID kernel in ANY case
- lilo -r /mnt
- check /proc/mdstat - wait until resync has completed
- shutdown / reboot - change boot device to boot from sda
- if it boots and all is OK, duplicate boot stuff to other disks:
dd if=/dev/sda of=/dev/sdb count=1
dd if=/dev/sda of=/dev/sdc count=1
dd if=/dev/sda1 of=/dev/sdb1
dd if=/dev/sda1 of=/dev/sdc1
(this is what you have to do if you install a new kernel or change LILO stuff)
Now you have:
- (manually) mirrored MBR with LILO on all 3 disks
- (manually) mirrored /boot on all 3 disks
- /dev/md0 as root RAID5 device
- swapping to all 3 disks
- if any single disk fails, you are able to boot from any other disk (getting
/dev/sda in that case)
You may need some special options for lilo for getting it boot correctly.
Hint: the bios will make the boot disk BIOS 0x80 - if this is not sda (or hda)
or will change later, you will have to tell lilo the correct bios ID for your
(future) boot disk. See the LILO docs for details ("bios=").
Unsolved problem: some distributions want to boot from disk or cdrom before
upgrading a whole system (e.g. SuSE does that). The problem is that they don' t
have a RAID kernel on their floppy/cdrom boot system, so you won' t be able to
access your installation on /dev/md0.
Workarounds:
- use a non-RAID device: copy all your stuff on it, upgrade and copy all back
to your raid device
- make your own boot/install disk with a RAID kernel
- don' t do this kind of update but update single packages
Thomas
--
Thomas Waldmann (com_ma, Computer nach Masz)
email: [EMAIL PROTECTED] www: www.com-ma.de
Please be patient if sending me email, response may be slow.
Bitte Geduld, wenn Sie mir email senden, Antwort kann dauern.