Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 59 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here



Current HOWTO: Boot + Root + Raid + Lilo : Software Raid mini-HOWTO

Boot + Root + Raid + Lilo : Software Raid mini-HOWTO: Bootable Raid Next Previous Contents

3. Bootable Raid

I'm not going to cover the fundamentals of setting up raid0/1/5 on Linux, that is covered in detail elsewhere. The problem I will address is setting up raid on root and making it bootable with standard LILO. The documentation that comes with the LILO sources (not the man pages) and with the raidtools-0.90, covers the details of booting and boot parameters as well as general raid setup - respectively.

There are two scenarios which are covered here. Set up of bootable root raid and the conversion of an existing non-raid system to bootable root raid without data loss.

3.1 Booting RAID 1 with standard LILO

To make the boot information redundant and easy to maintain, set up a small RAID1 and mount it on the /boot directory of your system disk. LILO does not know about device 0x9?? and can not find the information at boot time because the raid sub system is not active then. As a simple work around, you can pass LILO the geometry information of the drive(s) and from that, LILO can determine the position of the information needed to load the kernel even though it is on the RAID1 partition. This is because the RAID1 partition is the same as a standard partition but with a raid super-block written at the end. The boot raid set should fall with the first 1024 mbytes of the disk drive. In theory the start of the raid partition could fall anywhere in the 1024 megs, but in practice I was unable to get it to work unless the boot-raid started at the first block of the set. This is probably because of something dumb that I did, but it was not worth following up at the time. Since then I've simply set up all my systems with the boot-raid set as the first partition. I have root raid system configurations with bootable RAID1 mounted on /boot with root raid sets as follows: RAID1, RAID5, RAID10 & RAID1-10 ( 1 mirror + 1 raid0 set). The last has a very peculiar lilo file pair since none of the disk geometries are the same, however, the principals are the same for the initial boot process. The RAID10 and RAID1-10 root mounts require the use of initrd to mount root after the boot process has taken place. See the appendices for the configuration files for all of these example systems.

A conventional LILO config file stripped down looks like this:

# lilo.conf - assumes drive less than 1024
        boot = /dev/hda
        delay = 40               # extra, but nice
        vga = normal             # not normally needed
        image = /bzImage
        root = /dev/hda1
        label = Linux

A raid LILO config file pair would look like this:

# lilo.conf.hda - primary ide master

# ---------------------

# lilo.conf.hdc - secondary ide master
        bios=0x80                # see note below
        boot=/dev/hdc            # this is the other disk

# BIOS=line -- if your bios is smart enough (most are not) to detect that that the first disk is missing or failed and will automatically boot from the second disk, then bios=81 would be the appropriate entry here. This is more common with SCSI bios than IDE bios. I simply plan on relocating the drive so it will replace the dead drive C: in the event of failure of the primary boot drive.

The geometry information for the drive can be obtained from fdisk with the command:

fdisk -ul (little L)
fdisk -ul /dev/hda

Disk /dev/hda: 16 heads, 63 sectors, 39770 cylinders
Units = sectors of 1 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1            63     33263     16600+  fd  Linux raid autodetect
/dev/hda2         33264    443519    205128   82  Linux swap
/dev/hda3        443520  40088159  19822320   fd  Linux raid autodetect

* note the listing of the START of each partition

3.2 Detailed explaination of lilo.conf for raid boot

The raid lilo.conf file above, commented in detail for each entry.

# lilo.conf.hda - primary ide master
#       the location of the /boot directory that will be
#       designated below as containing the kernel, map, etc...
#       note that this is NOT the actual partition containing
#       the boot image and info, but rather the device
#       that logically contains this directory.
#       in this example, /dev/md1 is mounted on /dev/md0/boot

#       tell LILO which bios device to use for boot, i.e. C: drive

#       tell LILO the geometry of the device
#       this is usually but not always the "logical" 
#       geometry. Check the /proc file system or watch
#       the boot messages when the kernel probes for the drive

#       this is a dummy entry to make LILO happy so it
#       will recognize the raid set 0x9?? and then find
#       the START of the boot sector. To really see
#       what this was for, read the documentation 
#       that comes with the LILO source distribution.
#       This parameter "must" be different than the
#       disk=  entry above. It can be any other mdx
#       device, used or unused and need not be the one 
#       that contains the /boot information

#       the first sector of the partition containing /boot information

#       the real device that LILO will write the boot information to

#       logically where LILO will put the boot information

#       logically where lilo will find the kernel image

#       standard stuff after this
#       root may be a raid1/4/5 device

Next Previous Contents

The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.




Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.48 Seconds