Article Title: LILO configuration overview. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
LILO (Linux Loader) is an excellent Boot manager provided by Linux. It can be used to conveniently guide multiple operating systems on one machine. Compared with other common Boot Loader programs, LILO guidance is more artistic and has a deep understanding of it, it will help us easily deal with many difficult problems, such as multiple operating systems, network boot, large hard disks, and large memory.
We usually talk about LILO, which involves two aspects: the LILO boot program and the LILO installation command/sbin/lilo. To avoid obfuscation of these two concepts, we will use LILO to represent the LILO Bootstrap program, while lilo to represent/sbin/lilo.
Generally, LILO uses a text file/etc/lilo. conf as its configuration file. Lilo reads lilo. conf and writes specific LILO to the system boot Zone according to the parameters. When/etc/lilo. conf is modified, you must re-run the lilo command to ensure that LILO runs properly. Lilo. conf uses many configuration parameters, and the configuration is quite complex. Next we will take RedHat Linux as an example to make a preliminary discussion. RedHat's lilo package version is 0.20. Other Linux releases may be different, but not too large.
The configuration parameters in the lilo. conf file are divided into two parts: Global parameters and boot image parameters. Like other configuration files in Linux, a line of text after "#" indicates a comment.
1. Global parameters of LILO Global parameters are valid throughout the process. They can appear anywhere in the lilo. conf file. The following are specific parameters:
1. backup = backup-file
Back up the original boot area to backup-file before loading LILO, instead of the default/boot. NNNN of RedHat. You can also back up data to a device, such as/dev/null. Note: If a file with the same name already exists, this parameter will be ignored. We can use this backup to restore the original boot sector:
Dd if =/boot. NNNN 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
Specify a device used to install LILO. Generally, LILO can be installed in the following places:
MBR: The primary boot area of the first hard disk, corresponding to/dev/hda,/dev/sda, etc.
Root: Super block of 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.
If this parameter is not specified, lilo is installed on the Root partition superblock by default.
3. compact
This parameter is used to optimize LILO and generate a smaller "map" file. This parameter is strongly recommended if LILO is installed on a floppy disk.
4. default = name
Specifies the default Operating System. For example, default = dos indicates that the OS with the label as DOS is used as the default 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 the "prompt" parameter is not specified, LILO immediately directs the default Operating System. The "delay" parameter inserts a delay between the two, in 1/10 seconds.
6. disk = device-name
Defines parameters for some non-standard hard disks. It also includes several optional sub-parameters.
Bios = <bios_device_code>: Device number. Hexadecimal 0x80 indicates the first hard disk; 0x81 indicates the second hard disk, and so on.
Sectors = <sectors>: Number of hard disk sectors.
Heads = Cylinders = <cylinders>: Number of Hard Disk cylinders. Due to system BIOS restrictions, the number of cylinders must be less than 1024.
Partition = <partition_device>: Used to physically locate the partition on a special hard disk, with the sub-parameter start.
Start = <partition_offset>: start sector of each partition.
For example:
Disk =/dev/sda
Bios = 0x80
# Specify the SCSI hard disk as the first hard disk
Sectors = 32
Heads = 64
Cylinders = 632
# Hard Disk parameter: 632/64/32
Partition =/dev/sda1
Start = 2048
# The starting sector of the first partition is 2048.
Partition =/dev/sda2
Start = 204800
# The starting sector of the second partition is 204800.
Partition =/dev/sda3
Start = 500000
Partition =/dev/sda4
Start = 900000
When there are two hard disks on the machine, one is a SCSI hard disk and the other is an IDE hard disk, LILO may not automatically identify their master and slave orders. In this case, you can perform the following settings:
Disk =/dev/sda
Bios = 0x80
Disk =/dev/hda
Bios = 0x81
# The SCSI hard disk is the primary hard disk, and the IDE hard disk is the secondary hard disk.
This parameter is prepared for hard disks that cannot be identified by Linux. Generally, Linux can correctly identify and use most hard disks. Unless the worst case occurs, you do not need to set this parameter.
7. force-backup = backup-file
Similar to the "backup" parameter, but will overwrite the original file with the same name.
8. ignore-table
Inform lilo to ignore invalid hard disk partition tables.
9. install = boot-sector
LILO actually contains several parts, which are stored in the/boot. B file. If the "install" parameter is ignored, lilo considers install =/boot. B.
10. linear
Generate the linear sector address used to replace the hard disk sector/head/cylinder address (Hard Disk geometric parameter. The linear address is generated at runtime and does not depend on the hard disk geometric parameters. This parameter may be required for some SCSI hard disks and some IDE hard disks used in LBA mode. Note that the "linear" parameter cannot be used when LILO is installed on a floppy disk.
11. lock
Start the computer immediately following the last boot image after the LILO prompt appears. That is to say, when we are in lilo. this parameter is added to the conf file, run lilo to install LILO, and restart the computer. Then LILO will prompt you which operating system to boot, which will be recorded by LILO, that is, "locked". The next time you start the computer, LILO will ignore "delay", "prompt" and other parameters and keyboard input and directly jump to its "locked" operating system.
12. map = map-file
Specify the map file. If this item does not exist,/boot/map is used by default. Each time you run the lilo command, a new map file is generated.
13. message = message-file
This command is used to specify a file containing the annotation information, which will be displayed before the system prints the string "LILO. If you want to obtain more information when starting LILO, You can edit a file and use this command. If the file contains characters with ASCII code 0xFF (Ctrl + L), the screen is cleared. Note that the file size cannot exceed 65535 bytes. After each file change, you must re-run the lilo command to recreate the map file to ensure its normal display.
14. optional
This parameter causes lilo to ignore the boot image when it does not exist. This is useful for testing a Linux core that does not exist for a long time.
15. password = password
Set password protection for LILO. Every time you restart the computer, you are prompted to enter the password. After the password is set, we recommend that you change the file attribute of lilo. conf to 600 to prevent non-root users from seeing the password.
16. prompt
The "boot:" prompt is displayed. Force LILO to wait for the user's keyboard input. Press the Enter key to guide the default Operating System immediately, and press the Tab key to print the available operating system. When "prompt" is set but "timeout" is not set, the system will remain in the waiting state without guiding any operating system. If this parameter is not set, LILO directly directs the default Operating System without the "boot:" prompt, unless you press Shift, Ctrl, or Alt. In most cases, if you have multiple operating systems on your hard disk, we recommend that you use parameters, which leaves you with a choice.
17. restricted
When used with "password", "password" only applies when LILO prompts a command line input.
18. serial = parameters
Use the serial port control. This will initialize the specified serial port and enable the Boot manager to accept input from the serial port. Sending an interrupt signal from the serial port is equivalent to pressing the Shift key on the console keyboard, which will also be captured by LILO. If the access from the serial port is not as secure as the console, for example, if a modem is connected to the serial port, we recommend that you add password protection for each boot image ). The parameter string syntax is as follows:
<Port> [, <bps> [<parity> [<bits>]
<Port>: serial port number represented by a number, 0 indicates COM1, and so on. All four serial ports can be used.
<Bps>: serial port speed, which can be 110, 150, 300, 600, 1200, 2400, or 4800 bps. The default value is 2400bps.
<Parity>: sets serial port verification. In general, LILO ignores the parity check. N indicates no verification, e Indicates even verification, and o indicates odd verification.
<Bits>: the number of characters. The value can only be 7 or 8. The default value is 8. Only 7 is allowed for parity check.
If "serial" is set, the system automatically increases the value of "delay" by 20 even if "delay" is not set.
19. timeout = tsecs
Set the length of time to wait for the keyboard input, in the unit of 0.1 seconds. If no input exceeds this period, the system times out and the default Operating System is automatically guided. If this parameter is not set, the default timeout length is infinite.
Ii. Boot Image Parameters The Boot Image Parameters apply to each Boot Image zone. If a boot image parameter (for example, password) conflicts with the global Parameter definition, the definition of this boot image parameter prevails, but is limited to this boot image zone. The following are specific parameters:
Image = pathname
Sets the file or device that contains the Linux core boot image.
Other = pathname
Sets a file or device that contains a non-Linux operating system, such as DOS, sco unix, and Windows 95.
Range = start-end
If the "image" parameter is set as a device, the storage range of the Linux core boot image must be set.
Image =/dev/fd0
Range = 1-512
# First to 512 sectors of the Linux core boot image stored on a floppy disk
Label = name
This parameter is used to identify the current operating system, that is, the operating system name. You can enter an "identifier" after the LILO prompt to determine which operating system to boot.
Alias = name
Alias the current operating system.
Lock
Similar to global parameters with the same name.
Optional
Similar to global parameters with the same name.
Password = password
Similar to global parameters with the same name.
Restricted
Similar to global parameters with the same name.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.