LILO User Guide MBR root partition lilo. conf Error Analysis forgot password

Source: Internet
Author: User
LILO User Guide

LILO User Guide

Publisher: netbull read count: 252

Hubertzou

Hubertzou@linuxaid.com.cn

The Initial Startup of a computer is controlled by the BIOS. After initialization of some hardware (such as memory and keyboard), the computer tries to load the Master Boot Record (MBR) of the hard disk) or the Boot Sector of the floppy disk. MBR can be run in two ways. One is to locate the active partition and load the corresponding Boot Sector, and then load the basic components of the operating system in the partition by the Boot Sector; the second is to load information directly from a specified partition and load the information into the operating systems of any partition, such as LILO, gurb, boot loaders such as OS/2 boot loader and PartitionMagic can be configured in this way. The boot sector of a floppy disk is equivalent to the Boot Sector of the active partition of the hard disk. It is usually used to mount the operating system on the floppy disk.

You only need to install multiple boot devices such as LILO on the MBR, active partition, or boot floppy disk to take over the control of the computer, and then the multiple boot devices complete the subsequent boot process.

LILO creates a boot table address encoding so that its boot program can locate the Linux Kernel File. This address encoding can be performed in the cylindrical/head/sector (CHS) mode, LBA linear block numbers can also be used, so that even some SCSI control programs LILO can run well.

I. MBR is still the root partition of Linux.

When you first encounter LILO, it is estimated that you will be asked to select the LILO installation location, whether it is the MBR or the Linux Root partition when installing Linux. If you have other startup management programs such as Boot Magic or System Commander and want to use them, you should install LILO to the Linux Root partition. If you choose to use LILO as the startup manager, you can select MBR. If you want to pass parameters to the kernel at startup, you should also use MBR.

After lilo is used as the Startup Program, The lilo: prompt will be displayed after the machine starts. Press the tab key to view the list of available operating systems. Enter the operating system tag name to start the corresponding operating system, or press enter to start the default Operating System. Up to 16 images can be mentioned in Lilo. conf.

Ii. Lilo. conf usage

Let's take a look at the configuration file (/etc/Lilo. conf) started by lilo:

Boot =/dev/hda3
Map =/boot/Map
Install =/boot. B
Prompt
Timeout = 50
Message =/boot/message
Default = new

Image =/boot/vmlinuz-2.4.3
Label = new
Read-Only
Root =/dev/hda3

Image =/boot/vmlinuz-2.2.19
Label = Linux
Read-Only
Root =/dev/hda3

Other =/dev/hda2
Label = DoS

This configuration file specifies the Master Boot Record that lilo uses on the/dev/hda path. At startup, the boot loader will wait for 5 seconds.
Let's press SHIFT. If not pressed, the first core image (vmlinuz-2.4.3) mentioned above will be started. If you press the SHIFT key, the bootstrap loader will ask which image you want to start. If you forget which image to start, you can click [TAB] to select a menu. At this point you can choose or start this brand new kernel, or start an original Reliable Kernel (vmlinuz-2.2.19), or start a different operating system.

As can be seen from the above, a configuration file starts with a series of global options), followed by descriptions of different image options. Options in Image Description
The contents set by global options are overwritten.

Global Options

Boot = boot-device

Set the name of the device that contains the boot sector (such as a hard disk partition ). If this keyword is not specified, the boot sector will be read (or possibly written) from the device currently installed as the root file system ).

Compact

Attempts to merge multiple read requests from adjacent sectors into one read request. In this way, the read time is greatly reduced and the system description (MAP) is smaller. Use the compact option in particular when reading data from a soft drive.

Default = name

Use the specified image as the default startup image. If the defaul option is not set, the first image that appears in the configuration file is used as the startup image.

Disc = device-name

Defines non-standard parameters for a specific hard disk. It is particularly useful for defining BIOS = parameters. If the BIOS data on your hard disk is 0x80, 0x81 (hexadecimal), and so on, it is impossible to determine which Linux disk corresponds to Which BIOS disk (because it depends on BIOS settings ).
And BIOS ). Therefore, if you are using a non-General installation, You need to describe the relationship between the LINUX disk and the BIOS disk.
System. For example:

Map = map-file

Locate the disk description (MAP) file. If the map option is not specified, the/boot/map file will be used.

Message = message-file

Specifies a file that contains information displayed before the startup prompt. There will be no information in the time when the LILO button is displayed
Display. In the information, use the FF character ([Ctrl + L]) to clear the local display. The size of the information file must be within 65535 bytes. If the information file is changed or canceled, the disk description (Map) file must be rebuilt.

Prompt

Enter the start prompt mode without waiting for any key event. If the promp option is set but the imeout option is not set, you cannot start it on your own.

Timeout = tsecs

Set a time-out option for keyboard input (in the unit of 10 per second ). If no button is set during the specified time, the first image is automatically started. Similarly, if the user pauses for too long, the password is canceled. The default timeout value is unlimited.

In addition, the Kernel configuration parameters append, ramdisk, read-only, read-write, root, and vga can be set in Global Options. If it is not specified in the configuration column of the corresponding core image, the default value will be used.

Single Image

A single image or a line
Image = pathname
Start (to indicate a file or device that contains a Linux kernel startup image), or use a line
Other = pathname
To start other independent systems.

Label = name

The bootstrap loader identifies the image using the master file name (excluding the path) specified by each image. You can use different names by setting the label variable.

Alias = name

You can use the second name for the same directory by specifying an alias.

Password = password

Use a password to protect the image.

Restricted

If you specify parameters in the command line, you only need to enter the password when starting the image.

Kernel options

If the started image is a Linux kernel, You can transmit the command line parameters to the kernel.

Append = string

Add the specified options to the parameter lines transmitted to the kernel. It is typically used to specify hard disks that cannot be completely self-checked or thoroughly inspected and do harm to them.
. For example:

Append = "hd = 64,32, 202"

Ramdisk = size

This option specifies the size of any RAM disk. 0 indicates that no RAM disk should be created. If this parameter is not specified, the size of the RAM disk created in the root file system is used.

Read-only

When the read-only option is used, the system mounts the root partition as a read-only method. This option is recommended because the fsck program requires the file system to be read-only. But you don't have to worry that your root partition won't be writable. On the contrary, once started, the system will mount the root partition as a read/write method.

Read-write

The specified root file system should be loaded in read/write mode.

Root = root-device

This parameter specifies the device to be loaded as the root file system. If the name is specified, the root drive is located on the current device of the root file system. If the root device is modified by the-r parameter, the corresponding device is used. If the oot parameter is not specified, use the root device setting that contains the core image (this setting is set by using the ROOT_DEV variable in the kernel Makefile during kernel compilation, and rdev (8) will be available later) program modification)

Vga = mode

It specifies the VGA text mode to be selected when starting. The following values are recognizable (Case Insensitive ):

Normal: Select normal 80x25 text mode.

Extent (or ext): select 80x50 text mode.

Ask: Stop and require user input (at startup)

: Use the corresponding text mode. You can use the vga = ask option at startup or press [Enter] to obtain a list of available modes.

If this parameter is not specified, the VGA text environment obtained in the core image is used. (This setting is set by using the SVGA_MODE variable in the kernel makefile during kernel compilation)

LILO also allows you to manually pass these parameters at the LILO prompt. For example:

LILO: linux single

It is to tell Linux to start Linux to enter the single user mode. When the boot area is damaged, you can start from the floppy disk and specify the hard disk root to repair the hard disk Boot Sector.

LILO: linux root =/dev/hda3

LILO guides other types of operating systems to the same configuration as Linux boot, but it is simpler:

Other =/dev/hda3
Label = dos
Table =/dev/hda

Other indicates the partition where the operating system is located. Similarly, a label must be specified for the image in Linux. The table option points to the device that contains the partition table. This option is indispensable, because LILO will find the corresponding partition information from this partition table and then pass it to the operating system to be started.

Any change to lilo. conf requires re-running/sbin/lilo to ensure that the latest change can be written into the partition.
In addition, if you upgrade the kernel or reconstruct the initrd image, you need to re-run/sbin/lilo.

After running/sbin/lilo, you can see the following information:

Added linux *
Added dos
It indicates that all kinds of images have been written into partitions, And the partitions with * are the current default boot partitions.
You can use the-D parameter to change the default boot partition:

/Sbin/lilo-D dos
Added linux
Added windows *
You can see that the default partition has become windows.

Install = boot-file

Install the specified file as a new boot sector. If the install option is not set, use boot/boot. B as the default value.

Linear

Generate a linear sector address instead of a "sector/head/cylinder" address. The linear address is not dependent on the partition structure of the disk and is translated at runtime. Note that if the linear option is enabled, the boot disk may not be transplanted because the service used in the BIOS to determine the disk partition structure is not stable for the floppy disk. When using the linear option for a large hard disk, because the 3D sector address is unknown before startup,/sbin/lilo may generate a reference for inaccessible disk areas.

Lock

The command line can be automatically recorded as the default value for subsequent startup. In this way, lilo will lock an option before manual cancellation.

Loader = chain-loader

This parameter specifies the chain loader used. Use default/boot/chain. B. If it is started from another device rather than the first hard disk or floppy disk, you must specify a chain loader.

Iii. lilo Problems

<1> when Windows is installed and Linux is installed, LILO cannot be installed. This is a problem for most new Linux users;

Some BIOS cannot recognize hard disks larger than 1024 GB, and the old LILO cannot identify the system kernel (kenerl) with a position greater than cylinders ). Therefore, the possible problem is that LILO is loaded into MBR, while the hard disk partition prepared for Linux is far away from the 1024 cylinder, so Linux cannot boot; LILO is loaded into the Linux root partition (root partition ), it happened to be out of 8.4G and went down again!

Solution:

Maybe you have installed Linux. Do not delete it. You can change it to another version! Okay. Now start:

1. Use PartitionMagic5.0 to split a 10 m ext2 partition at the beginning of the first hard disk and format it. It is best to prepare the partitions for Linux together, saving the trouble in the future.

2. boot and rescue disks of Loadlin or Linux are used to boot the system. Mount the 10 m partition --/dev/hda1. Suppose I use the boot and rescue disks and mount them to/mnt/tmp. Copy the/boot/* and kernel image files to the directory of/dev/hda1 and edit/etc/lilo. conf, add the mount path of/dev/hda1 to all directories, and install LILO to/dev/hda1.

In lilo. conf
Boot =/dev/hda
Install =/boot. B
Message =/boot/bootmsg
Map =/boot/map
Image =/boot/vmlinuz-2.2.13

Change
Boot =/dev/hda1
Install =/mnt/tmp/boot. B
Message =/mnt/tmp/boot/bootmsg
Map =/mnt/tmp/boot/map
Image =/mnt/tmp/boot/vmlinuz-2.2.13

Call the Lilo command to reinstall Lilo. Restart the system.
Remember, to Uninstall Linux, you can use fdisk/MBR in DOS to clear lilo in MBR.

<2> Linux + nt-loader-mini-howto provides a detailed description of the Multi-boot nt, 9x, and Linux interfaces and provides better interfaces than Lilo;

The main problem is how to write boot records from Linux to bootsect .??? File. Assume that you have successfully installed Windows 9x and NT.

(Assume that Linux is installed in the first logical partition,/dev/hda5 in Linux, Windows9x is installed in the first primary partition, And/dev/hda1 in Linux, windowsNT is installed in the Second Primary partition, which is/dev/hda2 in Linux .)

Solution:

Use loadlin or Linux boot and rescue disks (the boot option of the bluepoint disc, which does not seem to exist in RedHat) to boot the Linux system. (Loadlin is better, there may be no mtools on the rescue disk, and only CP umount can be mounted.) run the following commands to create the file:
Dd If =/dev/hda5 of =/root/bootsect. lix BS = 512 COUNT = 1
Insert a floppy disk,
Mcopy/root/bootsect. lix:
Reboot the system and enter DOS to quickly see your results. Go to the root directory of the hard disk partition where ntldr is located, or the root directory of the hard disk partition that can be guided before WindowsNT is installed (Windows9x ). Copy the bootsect. lix file on the floppy disk. Remove the read-only and hidden attributes of boot. ini. Add c: ootsect. lix = "Go to Linux" at the end ". Save the disk and exit. Add the read-only and hidden attributes of boot. ini. Reboot the system and try again! Note that after any modifications to the Linux kernel, you must repeat the preceding steps to correctly guide the Linux system.

<3> install an additional Linux system;
The main problem is that if multiple Linux LILO or root partitions cannot be found by BIOS, the system will be suspended! Here we assume that BluePoint Linux is installed in the first logical partition,/dev/hda5 in Linux, RedHat Linux is installed in the second logical partition, And/dev/hda6 in Linux .)

Solution:

We will create a 10 m partition. Copy two Linux boot files to this partition, usually in the/boot directory. There may also be/vmlinuz-kernel files, which vary with the Linux release version. We recommend that you package it into two directories. Assume/bootBlurPoint and/bootRedHat.
Edit the lilo. conf file:

Original
Boot =/dev/hda
Install =/boot. B
Message =/boot/bootmsg
Map =/boot/map

Image =/boot/vmlinuz-2.2.13
Label = linux
Root =/dev/hda1

Change
Boot =/dev/hda1
Install =/mnt/tmp/bootBluePoint/boot. B
Message =/mnt/tmp/bootmsg
Map =/mnt/tmp/bootBluePoint/map

Image =/mnt/tmp/bootBluePoint/vmlinuz-2.2.13
Label = BluePoint
Root =/dev/hda5

Image =/mnt/tmp/bootRedHat/vmlinuz
Label = RedHat
Root =/dev/hda6

<4> remove LILO from the Master Boot Record and re-store the original windows MBR

1. c:> fdisk/mbr
2. #/sbin/lilo-u/dev/hda
3. # dd if =/boot/boot1_300 of =/dev/hda bs = 446 count = 1
4. # cat/boot/boot0000300>/dev/hda

Note: When you install windows 95 and then install Linux, the/boot/boot0000300 is your original windows 95 MBR.

<5> re-store LILO to MBR

1. Start to boot with a floppy disk or CD:

Boot: vmlinuz root =/dev/hdXY (for example, hda1)
Run after startup #/sbin/lilo

2. After starting with two floppy disks:
# Mount-t ext2/dev/hda1/mnt
# Ln-s/mnt/boot
# Ln-s/mnt/etc/lilo. conf/etc/lilo. conf
#/Mnt/sbin/lilo

<6> copy LILO to a floppy disk

1./sbin/lilo-B/dev/fd0
2. boot the disk to boot with Redhat:
Boot: vmlinuz root =/dev/hdXY (hdXY is your root partition)
Update/etc/lilo. conf
Root =/dev/fd0
Boot =/dev/fd0
Run: #/sbin/lilo-v

<7> Create a Redhat Linux boot disk

# Mkbootdisk -- device/dev/fd0 2.2.19

<8> copy the kernel to a floppy disk, and enable the floppy disk to boot Linux separately and mount the root file system on the hard disk.

# Fdformat/dev/fd0H1440
# Dd if =/boot/vmlinuz of =/dev/fd0
# Rdev/dev/fd0/dev/hda1

Iv. Analysis on startup error display of lilo

<1> when LILO loads itself, the word "LILO" is displayed. Each time a specific process is completed, a letter is displayed. If LILO fails somewhere, there are several letters on the screen to indicate where the error occurred. More detailed descriptions are provided in the technical documentation. (Note: LILO is not a program, but a group of programs.) Note that if the disk fails instantly, some hexadecimal numbers may be inserted after the first letter "L. Unless LILO stops there and keeps generating error code streams, it does not indicate a serious problem.

<2> (<nothing displayed after startup>) LILO is not loaded at all. LILO may not be installed, or the partition is not activated.

<3> L <error code>... the first part of LILO has been loaded and run, but it cannot mount the second part of the boot program. two-digit error codes indicate the type of the problem (see "disk error codes "). In this case, media access fails or the hard disk geometric parameters (CHS, chs) do not match.
The second part of LILO has been mounted in the first phase of li lilo, but it fails to be executed because the hard disk geometric parameters do not match or
After/boot. B is moved, the ing (map) Installer is not re-run.

The second stage of LIL has been started, but it cannot read the descriptor table from the map file. The typical reason is that the media
An error occurs or the hard disk geometric parameters do not match.

LIL? The second part of LILO is mounted to the wrong address. The typical cause is that the hardware geometric parameters are not matched or/boot. B is
Move without running the ing installer.

The LIL-Descriptor Table is corrupted. This may be because the/boot/map does not run the ing installer or the geometric parameters do not match after it is moved.

All parts of LILO are successfully loaded.

1010101010 the partition status has changed, but LILO has not been re-installed. It is said that the overclocking will also happen.

Disk error code:

0x00 "internal error ". It is generated by the reading subroutine of The LILO sector. It may be because of the corrupted file. try rebuilding the map file. Another original
This may be because when the linear parameter is used, more than 1024 of the cylinder is accessed.

0x01 "invalid command ". It shouldn't happen. If it appears, it means LILO can access hard disks not supported by BIOS. When sorting this document
A friend of mine encountered the L010101. .. error because he installed Linux on the second IDE port (/dev/hdc) and added the Disk parameter.

0x02 "no address Mark found ". It is usually a medium problem. Try again several times.

0x03 "Write protection error ". It only appears during write operations.

0x04 "sector not found ". The typical cause is that the hard disk parameters do not match.

0x06 "activation sequence change ". This should be a short error. Try again.

0x07 "invalid initialization ". The BIOS does not properly initialize the hard disk. A hot boot may be helpful.

0x08 "DMA exceeds the limit ". This should not happen. Restart.

0x09 "DMA attempts to cross 64 K boundary ". This should not happen. We recommend that you ignore the COMPACT parameter.

0x0C "invalid media ". This should not happen. Restart and check.

0x10 "CRC error ". Media error detected. We recommend that you run the map installer several times and write the map file from Bad blocks to normal
Quality.
0x11 "ECC corrected successfully ". The read error occurs and is corrected, but LILO does not know the situation and terminates the startup process.

0x20 "Controller error ". It should not happen.

Ox40 "locating failed ". This may be a media issue. Restart and try again.

0x80 "disk timeout ". The disk or drive is not ready. The media is broken or the disk is not switched. If the disk is started from a floppy disk, it may not be closed.

0xBB "BIOS error ". This should not happen. If this happens repeatedly, consider removing the COMPACT parameter or adding/canceling the LINEAR parameter. If an error occurs during the write operation, the error code is prefixed with "w ". Although write errors do not affect the startup process, they indicate some errors because they indicate errors in the system. A good suggestion is to reconfigure LILO to read-only ).

5. Forgot the password?

After the system is started, you will see a console-based logon screen or XDM-based logon screen. Log On As root and use the password you set during installation. If you forget this password,

You can use the single or emergency boot option. In LILO boot: Enter linux single at the prompt to boot to enter single-user mode. In single-user mode, your local file system will be installed and the network service will not be activated. In the emergency transaction mode, the system does almost no setup, only the root file system is installed, and it is read-only.

After entering the single-user mode, you can use passwd to change the root password.

6. How do I enable the system urgently if lilo is damaged or cannot be started?

You can use a CD or install a floppy disk to start the instance. After the boot prompt is displayed, type:

Vmlinuz root =/dev/linuxrootpartition noinitrd

Enter the Partition Number of your linux root partition after "root =", for example:

Vmlinuz root =/dev/hda3 noinitrd

Press enter to enter your linux system. You can edit/etc/lilo. conf and run/sbin/lilo.

Reading: 410 times

Source: linuxaid

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.