📄 readme.raid1
字号:
Notes for use of LILO on RAID installations.(lilo 21.8 and later -- 17-Apr-2001)RESTRICTIONS============Only RAID1 is supported. LILO may be used to boot a systemcontaining other RAID level partitions, but it may not be installedon any RAID partition other than RAID 1.GOAL====The goal of a RAID1 installation of LILO is redundancy. Redundancy tothe point that a failure of one disk in an array will not render thesystem difficult to boot.A secondary goal of LILO on a RAID installation is to maintain arraycoherency when the LILO command line is written back to the map file. This writeback occurs when the '-R' switch command line is cleared,when the user has specified the 'lock' option, or if a 'fallback'command line is in use.INSTALLATION ON A RAID SET==========================A RAID installation of the LILO boot loader is initiated byspecifying that the boot record is to be placed in the boot area ofa RAID partition. This is accomplished by the 'boot=' line in theLILO configuration file, '/etc/lilo.conf'. For instance, a systemrunning with '/dev/md1' mounted as root ('/'), would use the line: boot = /dev/md1to initiate a RAID installation. As directed, the boot record iswritten to the RAID partition. Unfortunately, in the event offailure of the RAID set disk from which booting occurs, the boot recordon the surviving disk(s) will only be usable if the disks are entirely"parallel" to the disk that originally booted the system.But first some terminology for talking about RAID 1.TERMINOLOGY===========RAID 1 writes the same data to the corresponding disk blocks of thepartitions which make up the RAID set. Two partitions are said to be"parallel" if they start at exactly the same sector address on theirrespective drives. This means that files on the two disks have theirdata written at exactly the same absolute sector addresses on bothdrives. Two partitions are said to be "skewed" if they do not start at thesame sector address on their respective drives. Data within eachpartition will be at the same offset from the beginning of eachpartition, but not at the same absolute sector address.PARALLEL CASE============="Parallel" RAID sets are the easiest for LILO to handle. One bootrecord written to the boot area of the RAID partition, references thesame sectors, no matter which disk is operational at boot time. For"parallel" RAID installations, LILO has no need to write boot recordsoutside of the RAID partition, if primary. This is in contrast toprevious versions of LILO based upon the "lilo.raid1" patch file tovanilla version 21, which wrote the LILO boot record to the Master BootRecords of all of the drives in the array, and not to the RAIDpartition.With the boot record written to the RAID partition on "parallel" RAIDsets, every drive has a boot record which will boot the system. There is now only one map file, and this file may be referenced byany of the boot records, since it is at exactly the same sectoraddress on every drive. To insure that it is possible to boot fromthis simplest LILO installation to "parallel" RAID set partitions,one must insure that they are primary partitions; i.e., partitionnumbers 1-4 on their respective disks, and that each disk has writtento it a boot loader which boots the partition marked "active". Andon each disk, mark the RAID set partition active. Booting normallyoccurs from the drive with the lowest BIOS device code (0x80). Inthe event this drive fails, another drive assumes the role of BIOSdevice code 0x80, and in the case of a "parallel" RAID installation,will be perfectly bootable.The unusual event of RAID set partitions which are parallel, but notprimary partitions will be described later.MORE TERMINOLOGY================A boot record is "accessible", if it exists on a primary parition,which may be marked "active"; or it is a Master Boot Record (MBR),written to sector 0 of a drive.Non-RAID LILO installations write accessible boot records when theywrite to primary partitions, such as: boot = /dev/hda1or, boot = /dev/sdb3Boot records are written to the MBR by specifying the drive; viz., boot = /dev/hdbwrites to the MBR of the slave drive on the primary IDE controller.Similarly, a boot record is "inaccessible" if it is written to alogical (or secondary) partition; i.e., partition numbers 5 andabove. These partitions are not booted by any of the usual MBR bootloaders which search the partition table for a partition marked"active". They may be booted from a boot manager, such as the LILOboot menu, and are booted as 'other=' entries in the configurationfile, '/etc/lilo.conf'.SKEWED CASE==========="Skewed" installations are not quite as simple. Here the partitionsare not likely to be primary, and their distinguishing characteristicis that files on the filsystem within the partition lie at differentabsolute sector addresses: kernel files, initrd files, and the LILOmap file, in particular. Thus any boot record written to '/dev/mdX',the RAID partition, will have sector addresses which cannot beguaranteed accurate for all drives. Worst case is that they areaccurate for only one drive. Hence, this boot will work for onedrive, but it is not universal. It will fail for some drive ordrives in the array.In this case, LILO needs to place boot records in "accessible" placesso that all drives will be bootable in a recovery situation.Here the need for the user to specify alternative actions becomesnecessary. There is a new keyword now recoginzed in theconfiguration file, and a new command line switch corresponding tothe keyword: 'raid-extra-boot=' and the '-x' switch. The followingdescription will be for the configuration file option, but is equallyapplicable to the command line switch.For the simplest of "skewed" installations, it may be undesirable tohave LILO automatically write boot records outside of the RAIDpartition. In this case, 'raid-extra-boot=' should be specified,literally, as "none"; viz., boot = /dev/md1 raid-extra-boot = noneWith this specification, LILO will write the boot record to'/dev/md0' only. If the RAID disk on the lowest BIOS device codefails, the array may not be bootable, except from a floppy disk.Without the specification "none", the default LILO action in the caseof a skewed installation is: boot = /dev/md1 raid-extra-boot = autoThis requests LILO to place recovery boot records on the MBRs of anydrives for which the the '/dev/md1' boot record is not valid, becauseof partition skew. Even with "auto" specified, or implied by havingno 'raid-extra-boot=' line, LILO will never write a boot record tothe MBR of BIOS device 0x80. This MBR is considered so critical,that it will never be written, unless you specifically specify it.It is stongly suggested that before any LILO installation on a RAIDset, that LILO be run with the 'test' flag: '-t'. LILO will gothrough all the motions of mapping the kernel(s) to be booted, but itwill tell you where it wants to write any additional boot records. lilo -tIs strongly recommended, especially if you are not sure whether youhave a "skewed" (extra boot records needed) or "parallel" RAIDinstallation.The keyword 'raid-extra-boot=' may also be used to specify exactlywhere you want LILO to write the auxiliary boot records. Considerthe following RAID installation: disk 0: /dev/hdc6; disk 1: /dev/sda1. The installation is "skewed". Disks /dev/hda and/dev/hdb exist, and occupy BIOS device codes 0x80 and 0x81,respectively. /dev/hdc is BIOS device code 0x82, and /dev/sda isBIOS device code 0x83. If the configuration file looks somethinglike: boot = /dev/md1 # the following line is not needed, but may be used to # force the device code which the RAID set will boot as #disk=/dev/md1 bios=0x82 # disks hda and hdb are on the expected bios codes 80 & 81 disk=/dev/hdc bios=0x82 disk=/dev/sda bios=0x83 image = /boot/vmlinuz label = linux root = /dev/md1 read-only other = /dev/hda label = MBRthen LILO will write the boot record to boot from 0x82, the lowestdevice code of any disk in the RAID set. An additional boot recordwill be written to the MBR of '/dev/hdc'. Disk '/dev/sda' isbootable should '/dev/hdc' fail under the following circumstance: '/dev/hdc' is removed, freeing BIOS device code 0x82. '/dev/sda' nowinstalls on the lowest code, 0x82, and will boot as long as partition1 is marked active.The same effect could be achieved with the configuration file havingthe extra line: raid-extra-boot = /dev/hdcFurther, the use of extra boot records could be extended as follows: raid-extra-boot = "/dev/hdc,/dev/sda"Now both disks in the RAID set have usable boot records on the MBRs. There is no need to worry about "active" partitions in a recoverysituation.BACKWARD COMPATIBLITY=====================Backward compatibility with earlier versions of LILO raid is providedby: raid-extra-boot = mbr-onlyUse of "mbr-only" defeats writing the boot record to the RAIDpartition, '/dev/md1' in the examples above, defeats the protectionagainst writing to the MBR of BIOS device 0x80 (which is usually'/dev/hda' or '/dev/sda'), and writes to all MBRs of the drives inthe RAID set. Use of this option is, in general, not recommended.On XFS filesystems, writing a boot record to the RAID partition itselfwould be catastrophic. Hence, on XFS filesystems, use of this optionis MANDATORY.REMINDERS=========Unstated, but required by an installation of LILO to a RAIDpartition, all of the files used in booting must reside on the RAIDset. This means: initrd, kernel, and message files; plus the LILOinternal files: map, boot.b, and chain.b, if used. Normally, theinternal files are kept in the '/boot' directory. Many distributionsof Linux also place the kernel and initrd files in this samedirectory. Others place them in the root, '/', directory. Eitherlocation is acceptable, as long as they are within the same RAIDpartition which you are making bootable. If the map file is not on the RAID partition, the FLAG_RAID_NOWRITE will be asserted with theconsequences indicated below.When making an installation of LILO to a RAID set, remember that LILOwill only make the disk with the lowest device code bootable. Forvery many RAID installations, this will be BIOS device code 0x80. The second and succeeding disks in the RAID set are not bootable inthe running RAID configuration; they only become bootable if the diskon device code 0x80 is removed, so that one of them becomes BIOSdrive 0x80.If for some reason you want to write the MBR of BIOS device 0x80, youwill have to specify it explicitly. Since LILO tells you where allother auxiliary boot records have been written, if any, you will haveto mention these in addition to the MBR on drive 0x80.ERROR MESSAGES==============If LILO is unable to write all of the auxiliary boot records it wouldlike, or your map file is not on the RAID partition, you will get the error message: "Warning: FLAG_RAID_NOWRITE has been set"This warning has two consequences. First, the clearing the '-R'stored command line will not take place; 'lock' will not workproperly; and 'fallback' will not work properly. All of these LILOoptions require LILO to re-write the stored boot command line beforethe kernel is booted. Because RAID set consistency cannot bemaintained, the boot loader will fall back to a read-only mode ofoperation. For many installations this is acceptable. The commandline switch, '-R' will still work from a running system, since thekernel RAID codes will maintain set coherency.The second consequence of this message, is a warning that not allboot records needed for booting in a disk failure scenario werewritten. The system may boot fine with the lowest BIOS code diskrunning, but be prepared to use a boot floppy in the event this diskfails. This may or may not be acceptable.This message will most often appear when 'raid-extra-boot=' wasspecified as "none"; or, if specified as (or defaulted to), "auto",the extra boot record it could not write was to the MBR of BIOSdevice 0x80, usually '/dev/hda' or '/dev/sda'. This could happenwith a skewed installation, where the RAID set partition on BIOSdevice code 0x80 is not a primary partition. If it were a primarypartition, then the RAID partition boot record written to '/dev/md?'would be used, an there would be no necessity to write to the MBR ofBIOS disk 0x80.REMEMBER========With a RAID installation, always run: lilo -tfirst -- just to let LILO tell you what it is about to do. Use the'-v' flag, too, for more verbose output.REFERENCES==========The 'man' pages for "lilo" and "lilo.conf" have been updated, and arethe main reference material for using the new switches and configoptions.The 'README' file in the LILO source directory, generated from thedoc materials, is still the best tutorial on booting, as well as a goodreference for many of the more obscure lilo options. The 'man' pagesnow contain most of this reference material, but in a condensed form.CREDITS=======Thanks to Piete Brooks <lilo+pb@cl.cam.ac.uk> for prodding meinto attacking the RAID1 issues, for his incisive criticism of theresulting work as it emerged, and for testing the early codes.(end)written 04/19/01 -- John Coffman <johninsd@san.rr.com>updated 05/10/01 -- John Coffmanupdated 08/08/01 -- John Coffman
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -