LILO

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page LILO and the translation is 62% complete.


LILO (LInux LOader) は、Linux やそのほかの OS をロードするための単純なブートローダです。

インストール

LILO のインストールは2段階あります。第1段階は、ソフトウェア自体のシステムへのインストールです(この段階では LILO は有効ではありません)。第2段階は、ディスクの MBR に LILO ブートローダを書き込むという意味でのインストール(有効化)です。

USE フラグ

USE flags for sys-boot/lilo LInux LOader, the original Linux bootloader

device-mapper Enable support for device-mapper from sys-fs/lvm2
minimal Do not install the dolilo helper script
pxeserial Avoid character echo on PXE serial console
static !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically

Emerge

ソフトウェア自体のインストールは単に、ファイルシステムへのソフトウェアの展開でしかありません。まだ MBR への LILO のインストールは、なされません。

root #emerge --ask sys-boot/lilo

MBR への LILO のインストール

MBR に LILO をインストールしたり更新したりするには、lilo を実行します。しかし、実行の前に /etc/lilo.conf ファイルを設定しなければなりません。この設定については、設定の項目で述べます。

root #lilo

設定

lilo.conf ファイルの例は、/etc/lilo.conf.example にあります。LILO の設定を始めるには、このサンプルファイルをコピーします。

root #cp /etc/lilo.conf.example /etc/lilo.conf

そして、/etc/lilo.conf ファイルを編集します。

一般的な設定

First configure LILO to be deployed on the system. The boot parameter tells LILO where to install the LILO bootloader in. Usually, this is the block device that represents the first disk (the disk that the system will boot), such as /dev/sda. Be aware that the lilo.conf.example file still uses /dev/hda so make sure that references to /dev/hda are changed to /dev/sda.

ファイル /etc/lilo.confLILO のインストール先を定義する
boot=/dev/sda
map=/boot/.map

Next, tell LILO what to boot as default (if the user does not select any other option at the boot menu). The name used here is the label value of the operating system blocks defined later in the file.

ファイル /etc/lilo.confBooting the block labeled as Gentoo by default
default=Gentoo

LILO will show the available options for a short while before continuing to boot the default selected operating system. How long it waits is defined by the timeout parameter and is measured in tenths of a second (so the value 10 is one second):

ファイル /etc/lilo.confSetting a 5 second timeout before continuing to boot the default OS
timeout=50

Gentoo OS 用のブロックの設定

An example configuration block for Gentoo is shown below. It is given the "Gentoo" label to match the default parameter declared earlier.

ファイル /etc/lilo.confExample Gentoo Linux configuration in lilo.conf
image=/boot/kernel-3.11.2-gentoo
	label=Gentoo
	read-only
	root=/dev/sda4

This will boot the Linux kernel /boot/kernel-3.11.2-gentoo with root file system /dev/sda4.

カーネルパラメータの追加

To add additional kernel parameters to the OS block, use the append parameter. For instance, to boot the Linux kernel silently (so it does not show any kernel messages unless critical):

ファイル /etc/lilo.confShowing the use of the append parameter with the quiet option
image=/boot/kernel-3.11.2-gentoo
	label=Gentoo
	read-only
	root=/dev/sda4
	append="quiet"

systemd users for instance would want to set init=/usr/lib/systemd/systemd so that the systemd init is used:

ファイル /etc/lilo.confUsing systemd with LILO
	append="quiet init=/usr/lib/systemd/systemd"

As can be seen, additional kernel parameters are just appended to the same append parameter.

複数ブロックの定義

It is a good idea to keep old definitions available in case the new kernel doesn't boot successfully. This is accomplished by creating another block:

ファイル /etc/lilo.confDefining a second OS block
image=/boot/kernel-3.9.2-gentoo
        root=/dev/sda4
        label=OldGentoo
        read-only

使い方

MBR の LILO を更新

As mentioned earlier, lilo has to be executed in order to install LILO in the MBR. This step has to be repeated every time /etc/lilo.conf is modified or when the Linux kernel(s) that the /etc/lilo.conf file points to are updated!

root #lilo

Running lilo too much doesn't hurt.

Gentoo と FreeBSD のデュアルブート

To dual boot Gentoo and FreeBSD, edit /etc/lilo.conf as follows:

ファイル /etc/lilo.confDual boot: Gentoo and FreeBSD
large-memory
lba32
boot=/dev/sda
install=menu
map=/boot/map
prompt
default=Gentoo
 
image=/boot/vmlinuz-2.6.26
	label="Gentoo"
	root=/dev/sda1
	append=""
	read-only
	optional
 
other=/dev/sda3
	label="FreeBSD"

Make sure to adapt the example configuration file to match the setup used.

削除

Unmerge

警告
lilo をアンインストールする前に、他のブートローダがインストールされ、適切に設定されていることを確認してください! これに失敗していると、おそらくシステムがブートに失敗することになるでしょう。

lilo をアンインストールするには単に:

root #emerge --ask --depclean --verbose sys-boot/lilo

関連項目