|
|
Bootable-RAID on SuSE 7.3 Step by Step |
IntroductionThis document describes the setup of a bootable RAID configuration using SuSE Linux 7.3 using the provided standard kernel 2.4.10, initrd (which is used by default), lilo Version V22 and the provided raidtools 0.90.
There are several documents covering Bootable RAID configurations, but either I did not like the concept, the information was outdated, or the information provided was either too general or too specific to convince me to adopt it to my box.
Other documents covering the theme can be found on:
I finally decided to create my own concept which was finally a "best of breed" based the informations I found all over the web and on:
Disclaimer and License:Der Autor sowie die EvoTegra GmbH übernimmt keinerlei Gewähr
für die Aktualität, Korrektheit, Vollständigkeit oder
Qualität der bereitgestellten Informationen. Haftungsansprüche
gegen den Autor sowie die EvoTegra GmbH, welche sich auf Schäden
materieller oder ideeller Art beziehen, die durch die Nutzung oder Nichtnutzung
der dargebotenen Informationen bzw. durch die Nutzung fehlerhafter und
unvollständiger Informationen verursacht wurden, sind grundsätzlich
ausgeschlossen, sofern seitens des Autors kein nachweislich vorsätzliches
oder grob fahrlässiges Verschulden vorliegt.
This document is copyright(c) 2002 for EvoTegra GmbH and it is a FREE document. You may redistribute it under the terms of the GNU General Public License. Neither the author nor EvoTegra GmbH is responsible for any contents linked or referred to from his pages - unless he has full knowledge of illegal contents and would be able to prevent the visitors of his site from viewing those pages. If any damage occurs by the use of information presented there, only the author of the respective pages might be liable, not the one who has linked to these pages. Furthermore the author and EvoTegra GmbH is not liable for any postings or messages published by users of diskussion boards, guestbook's or mailinglists provided on his page. While the given information in this document is believed to be correct,
no liability for the contents of these documents can be accepted. No
person, group, or other body is responsible for any damage on your computer(s)
and any other losses by using the information on this document. i.e.
Target audienceThe target audience are experienced Linux administrators *only*. Try this only when you really know what you are doing.
IMPORTANT *BEFORE* YOUR STARTPlease note that dealing with RAID in this specific context means dealing with partitions, initrd and lilo. This can quickly result in complete unrecoverable loss of data. MAKE SURE YOU HAVE COMPLETE AND READABLE BACK UP OF ALL YOUR DATA!
The MaintainerTobias Manthey. You can reach me at howto@evotegra.com . Step 1. Install lilo v22.2SuSE 7.3. uses a patched version of lilo version 21.7. There is no
specific SuSE package, but I just grabbed and installed an rpm package
from http://rpmfind.net, which installed
without any problems. To make sure everything is working run lilo from
the command line after installation. The first time I now got a message like: "Fatal: Message to must be <64k". Checking my lilo.conf revealed the entry: message = /boot/message The size of /boot/message was about 100kB. Some enquiry revealed that this message came up due to the patched lilo version used by SuSE. SuSE has by default a nice graphical lilo menu. I simply commented the line out and lilo updated my box without complaints. The penalty is the loss of your graphical lilo menu, you will be presented the old lilo text style instead. Despite this loss I did not suffer any loss of functionality.
Step 2. Relocate the /boot/ directoryBooting from an md (multiple disks) volume requires the /boot/ directory and its contents on the same RAID volume as the root volume. On many SuSE installations however, it is likely that the /boot/ directory is located in a small partition at the beginning of the disk. I therefore tar'd the directory and its contents to my root volume and removed the original /boot directory from my /etc/fstab so it would no longer be mounted on reboot. There may occur boot problems if the root volume is not located within the first 1024 blocks of the disk. Step 3. Partition /dev/hdbI now portioned the second disk /dev/hdb exactly like the first one: linux:/etc # fdisk -ul Disk /dev/hda: 255 heads, 63 sectors, 7476 cylinders Device Boot Start End Blocks Id System Disk /dev/hdb: 255 heads, 63 sectors, 7476 cylinders Device Boot Start End Blocks Id System Step 4. Create the RAID control file /etc/raidtabTo create the RAID-Volumes I used the following configuration: raiddev /dev/md0
raiddev /dev/md1
Then I copied the very same file on a floppy disk, because we need it later. Please note that failed-disk parameter. I had a complete and fully functional installation on my first disk and without the failed-disk parameter all my partitions on /dev/hda would have been deleted during creation of the RAID volume. Step 5. Create the RAID-VolumeNow I rebooted the box and started the rescue system from the SuSE cdrom. By default, no raid modules are loaded in the rescue system, so we
load them first: modprobe raid1
Once the module is loaded, copy the raidtab configuration file from the floppy disk to /etc/ and run: mkraid /dev/md0 If there was already an existing RAID configuration on the disk your may want to use mkraid's -force parameter. To make the RAID available we have to start it first: raidstart /dev/md0 To check the status of your RAID volumes type Step 6. Create the filesystemsAfter mkraid has successfully created our RAID Volume in degraded mode
on the second disk /dev/hdb, you can start creating the filesystems.
You can use whatever filesystem you want. Personally I experienced once
heavy file system corruption on my root volume when I used reiserfs.
mkefs /dev/md0 Step 7. Copy your dataNow I mounted my former root volume /dev/hda5 and the new created /dev/md0 and tar'ed all my data to the raid volume. Do the same for all other volumes. Step 8. Repartition first disk /dev/hdaNow it is getting serious: Going any further may leave your system in an unusable state!! I deleted my former partitions on the first disk /dev/hda and recreated
them, but this time I changed the partition type to fd (Linux raid autodetect): fdisk -ul now shows: Disk /dev/hda: 255 heads, 63 sectors, 7476 cylinders Device Boot Start End Blocks Id System Disk /dev/hdb: 255 heads, 63 sectors, 7476 cylinders Device Boot Start End Blocks Id System Step 9. Add the first disk to the RAIDNow edit the /etc/raidtab and change all "failed-disk" entries to "raid-disk".
raidhotadd /dev/md0 /dev/hda5 Now "cat /proc/mdstat" and you should see your RAID rebuilding.
Step 10. Adopt your lilo.confAfter your RAID-Rebuild completed successfully mount the root RAID volume and copy the raidtab control file to disk: mount /dev/md0 /mnt cp /etc/raidtab /mnt/etc cd /mnt/etc edit and DO NOT EXECUTE lilo the lilo-conf appropriate to your needs.
Here is the example: linux:~ # cat /mnt/etc/lilo.conf
image = /boot/vmlinuz image = /boot/vmlinuz.suse This will put the mbr record on both disks as well as on your root RAID-volume: Step 11. Create your initial ram diskTo create our initial ram disk properly your have to edit your rc.config file. Find the section INITRD_MODULES and MAKE SURE IT CONTAINS ALL MODULES YOU NEED DURING STARTUP! If your root RAID volume is on reiserfs make sure reiserfs module is in the configuration. Here is my example: INITRD_MODULES="usbcore raid0 raid1 raid5 reiserfs" Now you can create your initial ram disk: cd /mnt/sbin ./mk_initrd -d /dev/md0 /mnt Step 12. Lilo and the RAID-VolumeNow we have to start lilo. CAUTION: On the rescue system there is still
our old lilo installed. You must use our newly installed version: Step 13. Don't forget your fstabNow edit your fstab to make sure every file system is mounted properly after reboot cd /mnt/etc Here is the example: /dev/md0 / ext2 defaults 1 1 Step 14. Prepare to rebootNow unmount your RAID partition and reboot: umount /mnt Congrats! Youre finished.
Step XX. Some errormessage occured. What can I do? I experienced many oddities during my experiments with raid:
I highly recommend during all work in your rescue system that you treat your filesystems with mucho care. If you have to reboot
If something is going wrong here is a little hint how to still get access to your data. If for example rebuilding the RAID fails for some reason, or the command raidstart fails, you can still mount the disk partitions containing your original data by typing: mount -o ro /dev/hda5 Though this partition is part of a RAID volume you can get access to
the underlying data. I highly recommend mounting it read-only otherwise the RAID Information may not be consistent any more and you have to recreate that volume. I experienced most problems during the RAID-Rebuild in the rescue-system. Many times the rebuild came to 99.9 percent with just 2 Bytes left and then synced forever. Especially on my large reiserfs volume this turned out to be very troublesome. I could not find the reason for this. If you have a hint please let me know. |
| Version 1.0.3 Last updated on 05 May 2002 |