LILO configuration Raiders 2000 Blue Forest http://www.lslnet.com at 20:57 on September 21 Author: Zhou Di LILO (Linux Loader) is a Linux comes with an excellent boot manager with which you can easily Guide multiple operating systems on a machine. Compared to other commonly used guidance loading programs, LILO boot mode is more artistic, in-depth understanding, will help us to easily handle multi-operating systems, network boot, large hard drives, and large memory. Usually we talk about LILO, it will involve two aspects - LILO boot procedures and LILO installation commands / sbin / lilo. In order not to confuse these two concepts, this article will use LILO to represent the LILO boot program, while LILO represents / sbin / lilo. Generally, LILO uses a text file /etc/lilo.conf as its configuration file. LILO reads lilo.conf, writing a specific LILO to the system boot area according to the parameters. At any time, /etc/lilo.conf must be modified, and the LILO command must be re-run to ensure that LILO is running normally. Lilo.conf uses a lot of configuration parameters, and it is quite complicated. The following is a preliminary discussion as a preliminary discussion with Redhat Linux. The Redhat's Lilo package version is 0.20, and other Linux distributions may have, but it will not be too big. The configuration parameters in the lilo.conf file are divided into two parts, part of the global parameters, and the other part is the boot image parameter. Like other configuration files in the Linux system, a line of words after the "#" is comment. 1. LILO's global parameter global parameters are valid, which can appear anywhere in file lilo.conf. The following is a specific parameter item: 1.Backup = backup-file The original boot area backs up to Backup-file before loading LILO, not redhat default /boot/boot.nnnn. You can also back up to a device, such as: / dev / null. Note: This parameter will be ignored if there is an original file originally. We can restore the original guiding sector through this backup: DD if = / boot / boot.nnnnn OF = / dev / hda bs = 446 count = 1 Restore the original MBR. (Note: Although Boot.nnnn has 512 bytes, only the first 446 bytes can be restored to MBR.) 2.Boot = boot-device Specifies a device for installing LILO. Usually LILO can be installed in the following places: MBR: The main guiding area of the first hard disk, corresponding to / dev / hda, / dev / sda, etc. Root: Super block in the Linux root partition, corresponding to / DEV / HDA1, / DEV / HDA2, / DEV / HDA5, / DEV / SDA1, / DEV / SDA5, etc. FLOPPY: LILO is installed on a floppy disk, corresponding to / dev / fd0. When not specified, LILO is installed on the root partition in the super block. 3.Compact This parameter is used to optimize LILO to generate a smaller "MAP" file. This parameter is highly recommended if LILO is installed on the floppy disk. 4. DEFAULT = Name Specifies the default boot operating system. Such as default = dos indicates that the system is a system of DOS as the default boot operating system. If this parameter is not specified, the first operating system in lilo.conf will be used as the default operating system.
5.Delay = tsecs When there is no "prompt" parameter, LILO will immediately boot the default operating system, "DELAY" parameter is inserted between this delay, and the unit is 1/10 seconds. 6.Disk = device-name defines the parameters for some non-standard hard drives. The interior also includes several optional sub-parameters. BIOS =
That is, when we add this parameter in lilo.conf, then run the LILO to install LILO, restart your computer, then Lilo prompts us to choose which operating system boot, this choice will be recorded by lilo, That is, "Lock", when starting the computer next time, LILO will ignore parameters such as "delay", "prompt" and keyboard input and directly jump to its "lock" operating system. 12.Map = map-file Specifies the MAP file. Without this time, the default usage / boot / map, each executing the lilo command will generate a new MAP file. 13.Message = message-file This command is used to specify a file containing comment information, which will be displayed before the system prints "LILO". If you want to get more information at LILO, you can edit a file, and you can use this command. If the character (Ctrl L) containing an ASCII code is 0xFF is included in the file. Note that the size of the file cannot exceed 65535 bytes. After each file changes, you must re-run the LILO command to rebuild the MAP file to ensure that it is displayed normally. 14.Optional When the boot image used to start, this parameter is ignored by LILO. This is useful for testing a Linux core that does not have long-term existing. 15. Password = password is LILO setting password protection, each restarting the computer prompts the user to enter the password. After setting the password, it is recommended to change the file attribute of lilo.conf to 600 to avoid the non-root user to see the password. 16.Prompt gives "BOOT:" prompts, forced LILO waiting for the user's keyboard input, press Enter to guide the default operating system immediately, and press the Tab key to print an alternative operating system. When "Prompt" is set and "timeout" is not set, the system will always be waiting state without booting any operating system. When this parameter is not set, LILO does not give "Boot:" prompt and direct the default operating system, unless the user presses any of the SHIFT, CTRL, Alt three key. In most cases, if there are multiple operating systems on your hard disk, it is recommended to use the parameters, which leaves the user a selection room. 17.Restricted and "Password" are used to make "password" only when there is a command line when the LILO prompt is entered. 18. Serial = Parameters uses serial port control. This will initialize the specified serial port and will enable the boot manager to accept input from the serial port. Sending an interrupt signal from the serial port equivalent to pressing the Shift key from the console keyboard, which will also be captured by LILO. If the access from the serial port is not guaranteed is as safe as the console, one modem is connected to the serial port, it is recommended to add password protection for each boot image. The parameters are syntax:
19.Timeout = TSECS Set the time for the time to wait for the keyboard, and the unit is 0.1 seconds. If there is no input exceeding this time, it is timeout, the system will automatically boot the default operating system. If this parameter is not set, the default timeout length is infinite. Second, the boot image parameter boot image parameters act on each boot image area. If a boot image parameter (for example: password) is in contact with the definition of global parameters, the definition of the boot image parameter is defined, but is limited to the boot image area. The following is a specific parameter item: Image = pathname Sets a file or device that contains Linux core boot image. Other = pathname Sets files or devices that contain non-Linux operating systems such as DOS, SCO UNIX, Windows 95, and so on. Range = start-end If the "image" parameter is set to a device, the storage range of the Linux core boot image must be set. Image = / dev / fd0 = 1-512 # Linux core boot image Store the first to 512 sector Label = Name on the floppy disk to identify the current operating system, that is, the operating system name. The user can determine which operating system boot by entering "Identification" after the LILO prompt. Alias = Name gives a alias for the current operating system. LOCK is similar to the same name global parameter. Optional is similar to the same name global parameter. Password = password Similar to the same name global parameter. Restricted is similar to the same name global parameter. The following two parameter items are used for non-Linux operating systems: loader = chain-loader If the non-Linux operating system on the second block is to be booted, this parameter is required to install the LILO to the floppy disk. When not specified, the default is /boot/chain.b. If the MS-DOS or Windows 95 on the second hard disk is launched, logader = / boot / any_d.b can be defined; for OS / 2, it is loader = / boot / OS2_D.b. As a special functional module, any_d.b is no longer, and it is no longer included in the LILO package after version 0.20, and its function is integrated into chain.b, and OS2_D.B has changed. Their functions can be replaced by the following statements. Example: Other = / dev / hdb1 loader = /boot/Any_d.b Replace with: Other = / dev / hdb1 map-drive = 0x80 to = 0x81 map-drive = 0x81 to = 0x80 for OS2_D.B: Other = / Dev / hdb1 loader = / /BOOT/OS2_D.B Replacement to: Other = / dev / hdb1 loader = / /BOOT/OS2_D.B Map-Drive = 0x80 to = 0x81 map-drive = 0x81 to = 0x80 map-driving =
In fact, "Map-Drive" has played "soft" exchange two floppy drives or hard drives, from the order, avoiding the trouble of hand-wiring. Example: Exchange flop drive Map-drive = 0 to = 1 Map-drive = 1 to = 0 Exchange Hard Drive (see Loader Parameter) Table = Device Specifies the master device that contains a non-Linux system partition. For example, if Windows 95 is on the first basic partition of the first IDE hard disk, that is, / dev / hda1, it must define Table = / DEV / HDA. Third, the core parameters If LILO boots the Linux system, we can pass some parameters to Linux core with the following command. In addition to "Literal", they can also be used in the global parameter area. Append = string appended Parameter string String to the Linux system. It is often used to configure hardware devices that Linux cannot correctly test. For example: append = "HD = 64, 32, 202" notifies the Linux core, the hard disk parameter is 64 cylinders, 32 heads, 202 sectors. Specific parameter string settings can be referred to / usr / doc / howto / bootprompt-howto file. Literal = String is similar to "append", but it will undo all other core parameters (such as setting the root device). Because "Literal" will undo some essential, important parameters, so they cannot be set in the global parameter area. Ramdisk = size specifies the size of the RAM disk. Size does not establish a RAM disk at a time. When this parameter is ignored, the RAM disk size is determined by the Linux core boot image. Read-Only Notification LILO loads the root file system in a read-only mode. Usually we need to load root file systems in read-only mode when checking root file systems. The Linux system will also load the root file system in a read-only mode, and then reload it into a read and write mode after each startup. The READ-WRITE notifies LILO to load the root file system in a read and write mode. Root = root-device Specifies the installed root file system hard disk partitioning device. VGA = MODE Specifies the VGA mode when booting the Linux system. With the following: Normal: Regular 80 × 25 Text Mode Extended (OR EXT): 80 × 50 Text Mode ASK: When the user is booted which VGA mode is used, the knock button will display an allocated VGA. Mode table. If you do not specify a VGA mode, the system uses the VGA mode value contained in the system core by default. 4. Lilo.conf configuration instance has these basic knowledge, we can easily configure LILO in your own intent. See an example of a lilo.conf file: boot = / dev / hda # Installilo installed in MBR.
LILO as the main boot manager message = / boot / message # Note to / boot / message compact # Generate a smaller "map" file map = / boot / map # Specify "map" file for / boot / map install = / Boot / boot.b password = zhoudi # Set the password vga = Normal # 80x25 text mode linear # Using "linear" address Prompt # prompt user keyboard input timeout = 50 # timeout time 5 second default = dos # default boot Label for DOS Operating system # setting Linux image = / boot / vmlinuz-2.0.34-1 # Setting Linux core boot image label = linux # identified as Linux root = / dev / hda1 # Set the root file system read-only #LILO Reading mode load root file system # Set MS-DOS or Windows 95 other = / dev / hda2 #dos partition as the first IDE hard disk second partition label = DOS # ID DOS TABLE = / dev / hda # The device is the first IDE hard disk # setting SCO UNIX Note: The SCO partition must be set to an active partition and install LILO on the MBR. Other = / dev / hda3 label = SCO TABLE = / dev / hda This example, LILO is the main boot manager to manage all operating systems on the machine. LILO can also be used as a secondary boot manager, which is only necessary to change the "boot" parameter to the root partition. For example: boot = / dev / hda1 When using LILO in this way, the Linux root partition must be set to active partition with DOS or Linux, and this way is only for hard disk primary partitions (not extended or logical partitions) effective. LILO can also initiate a second operating system. There are two Seagate hard disks on my machine, a hard disk is 8.4GB, and the other is 1.2GB, all in the main IDE port in LBA mode. 8.4GB jumper is the main disk, 1.2GB jumper is from the disk, Linux core easy to identify them and can be used normally, and the 1.2GB hard disk is installed on the ms-dos 6.22. The author sets lilo.conf: disk = / dev / hda bios = 0x80 # Due to the dual hard disk problem in the IDE hard disk, "no system disk or system is wrong!", You need to modify the program as follows.
Disk = / dev / hdb bios = 0x81 boot = / dev / hda map = / boot / map install = / boot / boot.b linear prompt timeout = 50 Default = dos image = / boot / vmlinuz-2.2.11-1 label = Linux root = / dev / hda1 read-only other = / dev / hdb1 label = DOS map-drive = 0x80 to = 0x81 map-drive = 0x81 to = 0x80 # 交 两 two hard drive main, from the order table = / dev / hdb After configuring the lilo.conf file, execute the lilo command under the root account, the new LILO is loaded into the system. The first example of the above execution is as follows: #LILO Added Linux Added DOS * Added SCO (Note: It is a default operating system) 5. LILO prompt information LILO will give some prompt information when running. Its meaning is helpful to our correct configuration lilo.conf or find hardware errors. When LILO is loaded with its own, the word "lilo" is displayed: A letter is displayed for each one-specific process. If LILO has failed in some place, there are several letters on the screen to indicate where the error occurred. Note that if the disk is instantaneous malfunction, some hexadecimal numbers may be inserted after the first letter "L" (disk error). Unless LILO stops there, there is no serious problem. No prompt: LILO is not installed or installing the partition of LILO is not activated. L