LILO

LILO (LInux LOader)是Linux一個啟動程式，早年是許多Linux發行版使用的啟動程式。LILO後來被GRUB和SYSLINUX取代。

## 總覽

LILO不依賴於一個特定的文件系統，可以啟動一個作業系統(例如，從軟碟和硬碟啟動Linux內核 內核鏡像)。在啟動時有十六種不同的鏡像可供選擇。各種參數，如根設備參數，可以為每種內核單獨設置。LILO可以放在主引導記錄(MBR)或一個分區的引導扇區中。在後者的情況下，MBR中必須包含加載LILO的代碼。

在開啟系統時，LILO只有通過BIOS驅動訪問硬碟。因此，一個很老的BIOS訪問範圍限定為柱0到1023的前兩個硬碟。對於後來的BIOS，LILO可以使用32位的"邏輯塊尋址"(LBA)來獲得訪問整塊硬碟的能力。

## LILO 文件

### lilo.conf

lilo

### /boot/

LILO放置了許多文件在 /boot/ – 具體請見 /boot/: LILO.

## 主引導記錄

LILO可以在設備上寫入主引導記錄：

```
/sbin/lilo -M
```

## 輸出

當LILO加載完單詞「LILO」時，每個字母出現在一些具體行動的之前或之後。如果LILO在某些行為上未能成功，可以通過到目前列印的字母來識別。

(nothing):LILO完全沒有顯示，LILO沒有安裝或它的引導扇區所在的分區不活躍。引導媒介不正確。

L:第一階段的引導加載程序已加載並且開始，但不能加載第二階段的引導加載程序。兩位數字代碼會顯示錯誤類型。這種情況通常是由於媒介錯誤或者BIOS位於硬碟壞道造成的。

LI:第一階段的引導加載程序可以加載第二階段的引導加載程序，但未能執行。這可能是由於BIOS位於磁碟壞道造成的。

LIL:第二階段的引導加載程序已經啟動，但不能從鏡像文件中加載描述符表。這通常是由於媒介錯誤或者BIOS位於硬碟壞道造成的。

LIL?:第二階段的引導加載程序在一個不正確的地址加載。這通常是通常是由於BIOS位於硬碟壞道造成的。

LIL-:描述符表已損壞。這可能是由於BIOS位於硬碟壞道造成的。

LILO:LILO所有部分都已成功加載。

## 錯誤代碼

例如: L 01 01 01, L 07 07 07 等..

錯誤代碼｜名字｜描述

0x00｜Internal Error｜This code is generated by the sector read routine of the LILO boot loader whenever an internal inconsistency is detected. This might be caused by corrupt files. Try re-building the map file. Another possible cause for this error are attempts to access cylinders beyond 1024 while using the LINEAR option.

0x01｜Illegal Command｜This shouldn't happen, but if it does, it may indicate an attempt to access a disk which is not supported by the BIOS. Definitely check to see if the disk is seen by the BIOS first (and that the BIOS detail is complete).

0x02｜Address mark not found｜This usually indicates a media problem. Try again several times.

0x03｜Write-protected disk｜This should only occur on write operations.

0x04｜Sector not found｜This typically indicates a geometry mismatch. If you're booting a raw-written disk image, verify whether it was created for disks with the same geometry as the one you're using. If you're booting from a SCSI disk or a large IDE disk, you should check, whether LILO has obtained correct geometry data from the kernel or whether the geometry definition corresponds to the real disk geometry. Removing COMPACT may help too. So may adding LBA32 or LINEAR.

0x06｜Change line active｜This should be a transient error. Try booting a second time.

0x07｜Invalid initialization｜The BIOS failed to properly initialize the disk controller. You should control the BIOS setup parameters. A warm boot might help too. (Boot a rescue disc and rerun LILO.)

0x08｜DMA overrun｜This shouldn't happen. Try booting again.

0x09｜DMA attempt across 64k boundary｜This shouldn't happen, but may indicate a disk geometry mis-match. Try omitting the COMPACT option. You may need to specify the disk geometry yourself.

0x0C｜Invalid media｜This shouldn't happen and might be caused by a media error. Try booting again.

0x10｜CRC error｜A media error has been detected. Try booting several times, running the map installer a second time (to put the map file at some other physical location or to write "good data" over the bad spot), mapping out the bad sectors/tracks and, if all else fails, replacing the media.

0x11｜ECC correction successful｜A read error occurred, but was corrected. LILO does not recognize this condition and aborts the load process anyway. A second load attempt should succeed.

0x20｜Controller error｜This shouldn't happen, then again, none of these errors should happen eh?

0x40｜Seek failure｜This might be a media problem. Try booting again.

0x80｜Disk timeout｜The disk or the drive isn't ready. Either the media is bad or the disk isn't spinning. If you're booting from a floppy, you might not have closed the drive door. Otherwise, trying to boot again might help.

0x99｜Invalid Second Stage｜Mismatch between drive and BIOS geometry, or a bad map file. Some evidence that LINEAR needs to be set on the disk (see LiloNotes)

0x9A｜Can't Find Second Stage｜Check to see if you have the correct device for boot, e.g. boot=/dev/hda1 when it should be in the MBR i.e. boot=/dev/.

0xBB｜BIOS error｜This shouldn't happen. Try booting again. If the problem persists, removing the COMPACT option or adding/removing LINEAR or LBA32 might help.

## 請參閱

- Comparison of boot loaders
- Linux
- Boot loader
- GNU GRUB
- SYSLINUX
- Windows Boot Manager
- NTLDR
- SILO
- PALO

## 注意

- LILO installation instructions
- LILO mini-HOWTO
- LILO error messages
- LILO and GRUB: Boot Loaders Made Simple by Judith Myerson
- From Lilo to Grub
- Lilo tips from the Linux Kernel Howto
- 8
- 5

## 外部連結

- Official homepage
- Project homepage on Alioth

## 基本資料

- 開發者：Werner Almesberger (1992–1998), John Coffman (1999–2007), Joachim Wiedorn (自2010年起)
- 軟體版本週期：24.2
- 類型：啟動程式
- 許可協議：BSD許可證
- 狀態：停止開發與維護
- 網站：https://www.joonet.de/lilo/