Lilo usage guide MBR root partition lilo.conf error analysis forget password

Source: Internet
Author: User
Tags compact
Lilo Usage Guide



Lilo Usage Guide
2001-05-01 10:30

Published by: Netbull read times: 252


Hubertzou

hubertzou@linuxaid.com.cn

The initial boot of the computer is controlled by the BIOS, and after initialization of some hardware (such as memory, keyboard, etc.), it attempts to load the primary boot record (MBR) of the hard disk or the boot sector of the floppy disk. The MBR can run in two ways, one is to navigate to the active partition and load the appropriate boot sector, and then the boot sector completes loading the basic components of the operating system within the partition, and the second is to load the information directly from a specified partition and install it into any partition's operating system, such as LILO, GURB,OS/2 Boot loaders such as boot loader and PartitionMagic can be configured this way. The boot sector of a floppy disk is equivalent to the boot sector of the hard disk active partition, which is typically used to mount the operating system on a floppy disk.


You can take control of a computer by installing a multiple-boot such as Lilo on the MBR, active partition, or boot floppy disk, and then perform the subsequent boot process by the multiple bootstrapper.


Lilo is built with a boot table address code, its bootstrapper allows you to navigate to Linux kernel files, which can be used in both cylinder/head/sector (CHS) mode and LBA linear block mode, so even if Lilo is working well for some SCSI control programs.

One, MBR or Linux root partition

First encounter Lilo, it is estimated that when you install Linux, you will be asked to choose the installation of Lilo, MBR or Linux root partition. If you have other startup management programs such as boot Magic or System commander, and want to use them, then you should install Lilo to the Linux root partition. If you choose to use Lilo as your startup management program, you can choose the MBR. If you want to pass parameters to the kernel at startup, you should also use the MBR.

When you use Lilo as your startup program, the machine starts with Lilo: the prompt to press the TAB key to see the list of operating systems you can select. Enter the operating system label name to boot to the corresponding operating system, or enter the default operating system directly by entering a carriage return. In LILO. The mappings mentioned in Conf can be as many as 16.


Two, lilo.conf usage detailed explanation

Let's take a look at a LILO-initiated profile (/etc/lilo.conf) instance:

Boot=/dev/hda3
Map=/boot/map
install=/boot/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 that Lilo uses the master boot record on the/dev/hda path. Boot loader waits for 5 seconds at boot time
Let you press the SHIFT key. If not pressed, then the first core image mentioned above (vmlinuz-2.4.3), will be started. If the SHIFT key is pressed, the boot loader asks which image you want to start. In case you forget which image to start, press [TAB] and there will be a menu for you to choose from. You can select or start this new kernel at this point, or start a previously reliable kernel (vmlinuz-2.2.19) or start a different operating system.

Visible from above, a configuration file starts with a series of global options, followed by descriptions of different image options. The options in the image description
The contents of the global option will be overwritten.

Global Options section


Boot=boot-device

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

Compact

An attempt was made to merge multiple read requests from adjacent sectors into a single read request. This drastically reduces the read time and makes the system description (MAP) smaller. The compact option is especially used when reading from the floppy drive.

Default=name

Use a specially 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 a startup image.


Disc=device-name

Defines non-standard parameters for a particular hard disk. It is especially useful for defining bios= parameters. If your hard disk's BIOS data is 0x80, 0x81 (hexadecimal), and so on, you will not be able to determine which Linux disk corresponds to which BIOS disk (because it depends on the BIOS settings
And the type of BIOS). So if you're using a generic installation, you need to explain the connection between the LINUX disk and the BIOS disk.
System. Like what:


Map=map-file

Locate the disk description (MAP) file. If you do not specify a map option, the/boot/map file is used.

Message=message-file

Specifies a file that contains information that is displayed before the startup prompt is run. There is no information in the time when the button is displayed after the LILO
Show. In the information, empty the local monitor with the FF character ([Ctrl + L]). The size of the information file is limited to 65535 bytes. If the information file is changed or canceled, the disk description (MAP) file must be rebuilt.


Prompt

Go directly to boot prompt mode without waiting for any key event to occur. If you set the PROMP option without setting the Imeout option, you cannot start it yourself.


Timeout=tsecs

Set a timeout option for keyboard input (in 10 per second). The first image is automatically activated if there is no key at the specified time. Similarly, if the user pauses too long, the password input is canceled. The default timeout value is infinite.



In addition, kernel configuration parameters Append,ramdisk,read-only,read-write,root and VGA can be set in the global option. If it is not specified in the configuration bar of the corresponding core image, the set value is used as the default value.

Single Image part

A single image or a line
Image=pathname
Start (to prompt for a file or device that contains a startup image of a Linux kernel), or a row
Other=pathname
Start with a hint to start another standalone system.


Label=name

The boot loader uses the primary file name (not including the path) of each image description to identify the image. You can use a different name by setting the variable label.

Alias=name

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

Password=password

Protects the image with a password.

Restricted

If the parameters are specified at the command line, the password is only required to be entered in the boot image.

Kernel Options section

If the image being started is a Linux kernel, you can pass command-line arguments to the kernel.

Append=string

Adds the specified options to the parameter rows that are passed to the kernel. It is typically used to specify that a hard drive that is not fully self checked or thoroughly compromised
The parameters. Like what:

Append= "hd=64,32,202"


Ramdisk=size

This option specifies the size of the optional RAM disk. 0 means that no RAM disk should be created. If you do not specify this parameter, the RAM disk size established in the root file system is used.

Read-only

When the read-only option is used, the system will hook the root partition to read-only and this option is recommended because the FSCK program requires that the file system be read-only. But do not worry that your root partition will not be writable, on the contrary, the root partition will be hooked up to read and write once the system is started.

Read-write

The specified root file system should be loaded in a read-write manner.

Root=root-device

This parameter specifies the device that should be loaded as the root file system. If the specified name is currently in use, the root drive is located on the device on which the root file system is currently located. If the root device is modified by the-r parameter, the appropriate device is used. If the oot parameter is not specified, the root device setting containing the core image is used, which is set by the Root_dev variable in the kernel's Makefile file when the kernel is compiled, and can be modified later by Rdev (8) program)

Vga=mode

that specifies the VGA text mode that should be selected at startup. The following values can be recognized (ignore case):

Normal: Select normal 80x25 text mode.

Extent (or EXT): Select 80x50 text mode.

Ask: Stop and require user input (at startup)

: Use the appropriate text pattern. Use the Vga=ask option at startup or press [Enter] to get a list of available patterns.

If this parameter is not specified, the VGA text environment obtained in the core image is used. (This setting is set with the Svga_mode variable in the kernel's makefile file when compiling the kernel)

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

Lilo:linux Single

is to tell Linux to start Linux into Single-user mode. When the boot zone is damaged, you can boot from a floppy disk and then specify the root of the hard disk to repair the boot sector.

Lilo:linux Root=/dev/hda3


LILO directs other types of operating systems to be configured as boot Linux, but simpler:

other =/dev/hda3
Label = DOS
Table =/dev/hda

Other indicates the partition where the operating system is located, the same as the image under Linux needs to give a label (label), the table option to the device containing the partition table, this option is necessary, because Lilo will be from this partition table to find the corresponding partition information, Then pass him to the operating system to be started.

Any changes to lilo.conf require that the/sbin/lilo be rerun to ensure that the latest changes are written to partitions.
Also, if you upgrade the kernel or refactor the INITRD image, you will need to rerun the/sbin/lilo.

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

Added Linux *
Added dos
Indicates that various images have been written to the partition, and the partition with * is the current default boot partition.
The default boot partition can be changed with the-D parameter:

/sbin/lilo-d dos
Added Linux
Added Windows *
You can see that the default partition is already Windows.

Install=boot-file

Installs the specified file as the new boot sector. If the install option is not set, the boot/boot.b is used as the default defaults.

Linear

Generates a linear sector address rather than a sector/head/cylinder address. The linear address is not dependent on the partition structure of the disk and is translated at run time. Note If the linear option is enabled, the boot disk may not be ported because the service used in the BIOS to determine the partition structure of the disk does not stabilize the floppy disk. When using the linear option for a large hard drive,/sbin/lilo may produce a reference to inaccessible disk regions because the 3D sector address is unknown before it is started.

Lock

Allows you to automatically record the boot command line as the default defaults for later startup. This way, Lilo locks an option before the manual cancellation.


Loader=chain-loader


This parameter specifies the chained loader that will be used. The default default/boot/chain.b is used. If you are starting from another device other than the first hard disk or floppy disk, you must specify a chain loader.

Three, the problem about Lilo


< a >, first installed Windows, and then installed Linux, can not install Lilo. This is a problem for most Linux novices;


Some BIOS does not recognize a hard drive larger than 8.4G, and the old Lilo does not recognize the system kernel (Kenerl) with a position greater than 1024 cylinders. The possible problem is that Lilo is loaded into the MBR, and the hard disk partition that is prepared for Linux is far beyond the 1024 cylinder, so Linux cannot boot, and Lilo is mounted on the Linux root partition (the root partition), which happens to be outside the 8.4G and hangs again.

Solution:

Perhaps you have installed Linux, do not delete it, change can also be used. Okay, here we go:

1. Use PartitionMagic5.0 to separate 10M ext2 partitions at the beginning of the first hard drive and format them. It is best to prepare the partition for Linux together, so as to save the trouble later.

2. Boot the system with Loadlin or Linux boot and rescue disk. Mount that 10M partition--/dev/hda1, assuming I use the boot and rescue disks and mount to/mnt/tmp. Copy/boot/* and kernel image files to the same directory as/dev/hda1, edit/etc/lilo.conf, add/dev/hda1 mount path to all directories, and install Lilo to/DEV/HDA1.

Put the lilo.conf in the
Boot =/dev/hda
Install=/boot/boot.b
message =/boot/bootmsg
map=/boot/map
Image =/boot/vmlinuz-2.2.13

Amended to
Boot =/dev/hda1
Install=/mnt/tmp/boot/boot.b
message =/mnt/tmp/boot/bootmsg
Map =/mnt/tmp/boot/map
Image =/mnt/tmp/boot/vmlinuz-2.2.13

Invoke the LILO command to reinstall Lilo. Reboot the system and it's over.
Remember, to uninstall Linux, you can remove Lilo from the MBR with DOS FDISK/MBR.


< two >, multiple boot NT, 9x and Linux, and want to have a better interface than Lilo, LINUX+NT-LOADER-MINI-HOWTO has a detailed description;


The main question is how to write the boot record of Linux to Bootsect.??? Files, here assume that you have successfully installed Windows9x and NT.

(This assumes that Linux is installed on the first logical partition, installed on Linux for/dev/hda5,windows9x in the first primary partition, installed on the second primary partition for/dev/hda1,windowsnt under Linux, and/dev/under Linux) Hda2. )

Solution:

Boot Linux systems with Loadlin or Linux boot and rescue disks (refer to the Bluepoint CD startup option, as if not in Redhat). (Loadlin is better, rescue disk may not have mtools, can only mount CP Umount) use a few 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 A:
Reboot the system and go to dos a little bit faster to see your results, into the root directory of the hard disk partition where NTLDR is located, or the root directory of the hard disk partitions (here is windows9x) that can be booted before installing WindowsNT. Copy the Bootsect.lix file on the floppy disk. Removes the read-only, hidden properties of the boot.ini. At the end add c:ootsect.lix= "go to Linux". Save to exit, add Boot.ini read-only, hidden properties. Reboot the system and try again. Note that when you make any changes to the Linux kernel, you must redo these steps to properly boot the Linux system.

< three > installation of redundant Linux systems;
The main problem is that if multiple Linux lilo or root partitions cannot be found by the BIOS, the system hangs. This assumes that Bluepoint Linux is installed in the first logical partition, under Linux for/dev/hda5,redhat Linux installed in the second logical partition, under Linux for/dev/hda6. )

Solution:

We build a 10M partition for the same. Copy more than two Linux boot files to this partition, usually everything under/boot, and possibly/vmlinuz--kernel files, depending on the Linux release version. It is recommended that they be loaded into two directories. Assumed to be/bootblurpoint and/bootredhat.
Edit lilo.conf File:

Original
Boot =/dev/hda
Install=/boot/boot.b
message =/boot/bootmsg
Map =/boot/map

Image =/boot/vmlinuz-2.2.13
label = Linux
root =/dev/hda1



Amended to
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

< Four, remove the Lilo from the master boot Record and save the original Windows MBR

1. C:> fdisk/mbr
2. #/sbin/lilo-u/dev/hda
3. #dd if=/boot/boot.0300 Of=/dev/hda bs=446 count=1
4. #cat/boot/boot.0300 >/dev/hda

Note:/boot/boot.0300 is your original Windows MBR when you install Linux only when you originally installed Windows 95.

< Five, re-save Lilo to MBR

1. Boot to boot with installation floppy or CD:

Boot:vmlinuz ROOT=/DEV/HDXY (eg: hda1)
Run #/sbin/lilo after startup completes

2. After starting with two floppy disks:
#mount-T Ext2/dev/hda1/mnt
#ln-S/mnt/boot boot
#ln-S/mnt/etc/lilo.conf/etc/lilo.conf
#/mnt/sbin/lilo

< Six, copy Lilo to floppy disk

1./sbin/lilo-b/dev/fd0
2. Boot to boot with Redhat installation disk:
Boot:vmlinuz ROOT=/DEV/HDXY (HDXY for your root partition)
Update/etc/lilo.conf
Root=/dev/fd0
Boot=/dev/fd0
Re-run: #/sbin/lilo-v

< Seven, make a redhat Linux boot disk

#mkbootdisk--device/dev/fd0 2.2.19

< Eight, copy the kernel to the floppy disk, and let the floppy disk boot Linux separately and hang up the root file system on the hard disk.

#fdformat/dev/fd0h1440
#dd If=/boot/vmlinuz of=/dev/fd0
#rdev/dev/fd0/dev/hda1

Four, Lilo's startup error display analysis

<1> when Lilo loads itself, displays the word "LILO": Displays a letter each time a specific process is completed. If Lilo fails somewhere, there are a few letters on the screen to indicate where the error occurred. A more detailed description is available in the technical documentation. (Note: Lilo is not a program, but a set of programs) Note that if a disk fails instantaneously, some hexadecimal digits may be inserted after the first letter "L". Unless Lilo stops there and generates an error stream, it does not indicate a serious problem.

<2> (do not show 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 running, but it cannot load the second part of the bootstrapper. A two-digit error code indicates the type of problem (see "Disk error Code" later). This is usually the case when media access fails or hard disk geometry (CHS, CHS) does not match.
The first phase of the LI Lilo has been loaded into the second part of Lilo, but failed to execute it. The reason for the error is that the hard disk geometry parameters do not match or
The mapping (map) installer was not rerun after the/boot/boot.b was moved.

LIL The second stage has been started, but it is not possible to read out the Descriptor Table (descriptor) from the mapping (map) file because the media
An error occurred or the hard disk geometry parameter did not match.

LIL? The second part of Lilo is loaded into the wrong address. A typical cause is a subtle mismatch of the hard disk geometric parameters or/boot/boot.b being
Move without running the mapping installer.

The lil-descriptor is corrupted. This may be when the/boot/map is moved without running the mapping installer or the geometry parameter mismatch.

All parts of Lilo Lilo have been successfully loaded.

The 1010101010 partition situation has changed without reinstalling Lilo, which is said to be the case with overclocking.

Disk error code:

0x00 "Internal Error". Generated by the LILO sector Read subroutine. May be due to corrupted files, try rebuilding the map file. Another original
It may be that when using the linear parameter, you are accessing a cylinder exceeding 1024.

0x01 "Illegal Command". It should not have happened if it had appeared, meaning Lilo went to visit the hard drive that the BIOS does not support. When you organize this document,
Hou, a friend of mine met L010101 ... Error because he installed Linux on the second IDE port (/DEV/HDC), plus disk parameters.

0x02 "No address tag found". Usually the media problem, try it a few more times to see.

0x03 "Write protection Error". Occurs only during a write operation.

0x04 "Sector not found." The typical reason is that the hard drive parameters do not match.

0X06 "Activation Order Change". This should be a short mistake and try again.

0X07 "Invalid initialization". The BIOS does not properly initialize the hard drive, and a hot boot may be helpful.

0X08 "DMA exceeded limit". This should not happen, reboot.

0X09 "DMA attempted to cross 64k boundary". This should not happen, it is recommended that the compact parameter be ignored.

0x0C "Invalid Media". This should not happen, reboot to see.

0x10 "CRC error". A media error was detected. It is recommended to start several times, run map installer, write map file from bad block to normal medium
The quality.
0x11 "ECC Corrective success". The read error occurs and is corrected, but Lilo does not know this and terminates the startup process.

0x20 "Controller Error". Should not have happened.

ox40 "Locate failed." This may be a media issue and try restarting.

0x80 "Disk Timeout". The disk or drive is not ready. The media is broken or the disk does not turn, and if you boot from a floppy disk it may not be closed.

0xBB "BIOS error". This should not happen, and if repeated occurrences, consider removing the compact parameter or adding/canceling the linear parameter. If an error occurs during a write operation, there is a prefix "w" in front of the error code. Although write errors do not affect the startup process, they indicate some errors because they imply errors in the system, and a good suggestion is to reconfigure Lilo to read-only (read-only).


Five, forget the password?

At the end of the system startup you will see a login screen based on the console or a XDM login screen. Log in as root, using the password you set when you installed. If you forget this password,

You can use the single or emergency boot options. Type Linux single to boot into Single-user mode at the Lilo boot: prompt. In Single-user mode, your local file system will be installed and network services will not be activated. In emergency mode, the system does almost nothing to setup, only the root file system is installed and read-only.

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


If the Lilo is damaged or cannot be started, how can I start the system in an emergency?


You can start with a CD-ROM or an installation floppy disk, and the boot: prompt and then type:

Vmlinuz root=/dev/linuxrootpartition NOINITRD

Where, root=, fill in the partition number of your Linux root partition, for example:

Vmlinuz Root=/dev/hda3 NOINITRD

Enter your Linux system after entering, you can edit/etc/lilo.conf edit, run/sbin/lilo to complete.



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.