Describes the configuration of LILO and Grub in Linux.

Source: Internet
Author: User
Tags password protection

As an old Linux operating system user, you must know how the Linux operating system has gone through ten years of experience. Here we will introduce the knowledge of the Linux operating system, so that you can learn how to use the Linux operating system. Today I will talk about the configuration information of LILO and Grub in Linux. I hope you will remember the configuration information of LILO and Grub in Linux.

1. LILO configuration information

In LILO. conf, there are a maximum of 16 operating system options, which are more flexible than Grub. The LILO. conf configuration file consists of two parts: one is global configuration, and the other is Bootstrap configuration, and "#" indicates annotation.

◆ Global configuration of LILO

Global parameters are valid throughout the process. They can appear anywhere in the LILO. conf file.

Backup of boot operating system files:

Backup = backup-file
Force-backup = backup-file
Install = file

Back up the original boot area to backup-file before loading LILO. It can be backed up to a device. You can use dd if =/boot. bak of =/dev/hda bs = 446 count = 1 to restore the original MBR. Force-backup = backup-file is similar to "backup", but it overwrites the original file with the same name. Install = file: Use the specified file as the new boot sector. If the install option is not set, use boot/boot. B as the default value.

Specify a device used to install LILO:

Boot = boot-device

The above Code specifies 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, or/dev/hda0.

Root: Linux Root partition.

Floppy: LILO is installed on a Floppy disk, corresponding to/dev/fd0. LILO is installed on the Root partition superblock by default.

Specify LILO used to optimize compression:

Compact

This parameter is used to optimize the compression of LILO, so that LILO combines multiple read requests from adjacent sectors into one read request, so that the MAP file is smaller. Therefore, the compact option is recommended when reading data from a floppy disk.

Specify to force LILO to wait for the user's keyboard input:

Prompt
Delay = tsecs
Prompt forces

Prompt prompts "boot:", force LILO to wait for the user's keyboard input, press the Enter key to immediately guide the default Operating System, and press Tab to display the available operating system. In most cases, parameters should be used for multiple operating systems, leaving users with a choice. When the "prompt" parameter is not specified, LILO immediately directs the default Operating System. The "delay" parameter inserts a delay between the two. The unit is 1/10 seconds. If the delay option is not set or is set to 0, the boot loader will not wait. Prompt forces directly enters the start prompt mode without waiting for any key event. If the prompt option is set but the timeout option is not set, you cannot start it on your own.

Specific parameters of a non-standard hard disk:

Disk = device-name

The code above specifies specific parameters for non-standard hard disks. It has the following parameters: bios, device number; sectors, number of hard disk sectors; heads, number of Hard Disk magnetic heads; cylinders, number of Hard Disk cylinders; partition, used to physically locate partitions on special hard disks; start, the start sector of each partition.

Specify the disk's physical performance indicators:

Linear
Table = device
Fix-table
Ignore-table

Linear generates a linear slice address instead of a linear slice address of the "sector/head/cylinder" address. Therefore, the linear address does not depend on hard disk parameters during operation. Note that the "linear" parameter cannot be used when LILO is installed on a floppy disk. Table specifies the device that contains a partition table. If this parameter is not specified, the bootstrap loader does not transmit the partition information to the started operating system. If a partitioned table that has been located and referenced the table option is modified, you must run LILO again. The fix-table option allows LILO to adjust the sector, Head, and cylinder of the partition table and the linear address, create a partition table entry, a sector, a head, a cylinder, and a linear address that contains the first and last sectors of the partition. Ignore-table notifies LILO to ignore invalid hard disk partition tables.

Specify the map file:

Lock
Map = map-file

Specify the map file. If this item does not exist,/boot/map is used by default. Each time LILO is changed, a new map file is generated. Lock is to tell LILO to start the computer immediately following the prompt following the previous boot image. The command line can be automatically recorded as the default value for subsequent startup.

If the boot image does not exist, use the optional parameter to make LILO ignore it. This is useful for testing a Linux kernel that does not exist for a long time.

Specify LILO to set password protection:

Password = password
Restricted

The above code sets password protection for LILO, and prompts the user to enter the password every time the computer restarts. Because the password is in plain text, we recommend that you change the file attribute of LILO. conf to 000 after setting the password so that non-root users can see the password. Restricted is used with password, so that "password" only applies when there is a parameter input after LILO prompts.

Specify the parameters of the serial port controller:

Serial = parameters port, bps, parity, bits)

This will initialize the specified serial port and enable the Boot manager to receive input from the serial port.

The parameters are as follows:

<Port> indicates the serial port number.
<Bps> serial port speed.
<Parity> set serial port verification. In general, LILO ignores the parity check. N indicates no verification, e Indicates even verification, and o indicates odd verification.
<Bits> Number of characters, which can only be 7 or 8. The default value is 8. Only 7 is allowed for parity check.

Run the following command to open the process report:

Verbose = level
Append = string

The larger the number, the more lengthy output. If the parameter-v is added to the LILO command line, the maximum length is 5.

Append transmits a special hardware parameter string to the Linux kernel. It is often used to configure hardware devices that cannot be correctly tested in Linux. For example, append = "hda = 200, 64, 128" indicates that the hard disk is a 200-inch cylindrical disk, a 64-bit head, and a-inch sector.

Specify the ramdisk size:

Ramdisk = size

When the size is zero, no ramdisk is created. When this parameter is ignored, the size of the ramdisk is determined by the Linux kernel boot program.

Specify the read/write mode to load the root file system:

Read-only
Read-write

Literally, LILO is notified to load the root file system in read-only mode and read/write mode to the root file system.

Specify the VGA mode when LILO directs the Linux system:

Vga = mode

Specify the VGA mode when LILO is guiding the Linux system. The following parameter values are available:

Normal 80x25 text mode.
Extended 80 × 50 text mode.
Ask

Ask the user which VGA mode to use during the boot, and then press the Enter key to display an allocable VGA mode table. If the VGA mode is not specified, the system uses the VGA mode value included in the system kernel by default.

◆ Boot Configuration

The Boot Image Parameters apply to each boot area.

Set the file or device that contains the Linux kernel boot image:

Image = pathname

Set to include non-Linux operating systems:

Other = pathname

Such as DOS, Windows 95, and other system boot files or devices, to prompt to start other independent systems.

Range = start-end
Alias = name
Loader = chain-loader

If the "image" parameter is set as a device, the storage range of the Linux kernel boot program must be set by range = start-end. Alias to the current operating system. Loader = chain-loader specifies the specific boot program required by LILO. The default value is/boot/chain. B.

Some prompts will be provided when LILO is running. This information is helpful for a deep understanding of Bootloader. Table 2 lists some error messages for reference.

Table 2 LILO error information

Significance of LILO error information
LILO prompt message null lilo is not installed or the partition where lILO is installed is not activated
L The First Part of LILO has been loaded and run, but it cannot mount the second part of the boot program. This usually happens when media access fails or hard disk parameters are incorrect.
The first part of li lilo is correct, but an error occurs when the second part is executed. Generally, the hard disk parameter is incorrect or/boot. B does not match the map program.
The second part of lil lilo starts execution, but the Descriptor Table cannot be read from the "map" file ). The disk media is incorrect or the disk parameters are incorrect.
LIL? LILO is loaded in the wrong place.
The LIL-Descriptor Table is incorrect. The hard disk parameters do not match or/boot. B does not match the map program.
The disk error code 0x00 is generated by the LILO sector reading subroutine. The map file is damaged, or when the "linear" parameter is used, more than 1024 of the cylinders are accessed.
0x01 LILO accesses hard disks not supported by BIOS.
0x02 disk media problems.
0x03 disk media write protection error.
0x04 disk sector not found, hard disk parameter error.
0x05 disk activation sequence changes.
0x06 disk error media.
0x07 is invalid. The BIOS does not properly initialize the hard disk.
0x08 DMA exceeds the limit.
0x09 DMA attempts to cross the 64 kB boundary. This is caused by the "compact" parameter.
0x0C is invalid.
0x010 "CRC error", media error detected. We recommend that you start the installation program several times, run the map installer, and write the map file from the bad block to the normal media.
0x11 ECC is successfully corrected. The read error occurs and is corrected, but LILO does not know the situation and terminates the startup process.
0x20 disk controller error.
0x40 disk location failure, disk media problems.
0x80 disk timeout. The disk or drive is not ready, the media is broken or there is no disk.
0xBB BIOS error. The disk does not match the BIOS configuration.

2. Grub configuration information

Grub is more interactive than LILO. The following uses its command to understand this bootloader.

In the menu, press "e" to edit the startup command, and press "c" to use the command line. Press the "e" key to edit the selected startup command. With this function, you can temporarily change the system startup parameters.

To start an operating system, first specify the system on which to boot. For example, to boot the operating system of the first partition on the first hard disk, first key:

Grub> root (hd0, 0)

If you want to start Windows, type:

Grub> chainloader (hd0, 0) + 1

Note that (hd0, 0) changes with the hard disk and partition.

To Boot Linux or other systems, type:

Grub> kernel hd0, 6)/boot/vmlinuz root =/dev/hda7

Note that the disk parameters also need to change with the differences between the hard disk and the partition. For example, if hdb1 is used for booting from the first partition of the second hard disk, the system can be started after you press boot.

When the command or command parameters cannot be determined, you can press "Tab" for help. You can use the up or down key to obtain the command history, these are as simple as using bash in Linux. You can also type the startup command and then boot the system.

Generate boot disks under Grub:

Grub> root (fd0)
Grub> setup (fd0)
Grub> quit

It is also easy to install Grub on the hard disk. If you install MBR, you can specify the entire disk instead of the partition, as shown in the following for hda ):

Grub> setup (hd0)

If you want to install Grub in the boot records of/dev/hda7, enter:

Grub> setup (hd0, 6)

To sum up, LILO requires users to understand every parameter well, while Grub is more interested in user interaction, and the two are irrelevant in bootloader.

Instance

The following uses my lilo. conf as an example to translate it into the menu. lst file of Grub.

Lilo. conf:
# The lilo. conf of the writer
Boot =/dev/hda
Map =/boot/map
Install =/boot. B
Message =/boot/cosixmsg // specifies the path and file name of the file on the boot screen.
Prompt
Password = wudi // The password is wudi
Timeout = 50 // boot the default Operating System after 5 seconds
Default = dos // default start Option dos
Image =/boot/vmlinuz-2.2.16-3 // specifies the path to the Linux Kernel
Label = linux // specify the name of the operating system Linux
Vga = 0x301
Read-only
Root =/dev/hda7
Other =/dev/hda1 // specify the OS Name DOS
Label = dos

The translated menu. lst file:

Timeout 5 // boot the default Operating System after 5 seconds
Default 1 // default start Option dos
# → Linux kernel // specify the name of the operating system LINUX
Title linux root (hd0, 6) kernel/boot/vmlinuz-2.2.16 root =/dev/hda7 ro
Initrd/boot/initrd-2.2.16.gz
# → Linux END users
# → Dos manage // specify the operating system name DOS
Title dos root (hd0, 0) chainloader + 1
# → Dos END users

Through the above explanations on Grub and LILO, the readers may have a deep understanding of the two bootloaders, but they still need to go through a lot of repeated exercises before they can grasp them well. The above describes the configuration information of LILO and Grub in Linux.

  1. Command Introduction: Basic Linux commands for file and directory management
  2. Operation notes: Linux Desktop GNOME Operation Skills
  3. Linux File Installation and uninstallation
  4. 2010the Linux operating system is about to bloom
  5. Practical Operation Log: Install JDK in Linux

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.