Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 10

Lilo mini-Howto

Cameron Spitzer (cls@truffula.sj.ca.us), Alessandro Rubini


(rubini@linux.it).
v2.1, 9 1998

LILO. "
LILO".
.
.
Lilo ,
/usr/doc/lilo*
______________________________________________________________________
Table of Contents
1.
2.
2.1
2.2
2.3
2.4

Lilo;
IDE ;
;
Lilo;

3.
4.
5. Lilo BIOS Root partition
6. BIOS
7. (Rescue Floppy)
8.

______________________________________________________________________
1.

Lilo ( /usr/doc/lilo )
, Linux

/etc/lilo.conf. ,

:
To ``To Linux
''.
Lilo
/dev/hdc /dev/hda.
Linux

.

Linux
root partition BIOS.
-

,
BIOS DOS ( ).

(
).

Cameron Spitzer,
cls@truffula.sj.ca.us, .
Linux, '
.

2.
Lilo , data sectors
bios. pathname
/etc/lilo.conf resolved
( lilo).
sectors
. , partition
BIOS. ,
loader (.., lilo)
.
image,
Lilo).
2.1. Lilo;
boot = /etc/lilo.conf Lilo
primary boot loader. ,
master boot sector (/dev/hda) root partition
Linux ( /dev/hda1
/dev/hda2).
,
Lilo root partition.
, partition "bootable"
( "a" fdisk "b" cfdisk.
master boot sector,
Linux Lilo .
2.2. IDE ;
LBA LARGE BIOS (
Linux).
PC.
1024 ,
partition root (
).

,
BIOS,
. Lilo
LBA LARGE .

Linux,
, BIOS
. Linux
.
,
BIOS.
2.3. ;
Lilo prompt, <Tab>
. Lilo
interactive, <Alt>
<Shift> ``LILO'' .
Linux,

. ,
.
, :
root=: Linux mount
root partition
lilo.conf. , partition
Linux ,
root
partition .
init=: 1.3.4 Linux
-
/sbin/init.
,
init=/bin/sh ( shell
prompt mount :
``/sbin/mount -w -n -o remount /; mount -a'',
``/sbin/umount -a''
).
:
init run-level
( default 3). init
, /etc/inittab /etc/rc.d .
2.4. Lilo;
Lilo boot sector,
/boot/boot.xxyy, xxyy
, .
partition
``ls -l /dev/device''. , sector
/dev/hda ( 3, 0) /boot/boot.0300,

Lilo /dev/fd0 /boot/boot.0200


/dev/sdb3 ( 8, 19)
/boot/boot.0813. Lilo
.
Lilo ( ,
).
Lilo ( ,
Linux),
boot sector. Lilo
/dev/hda, ``dd if=/boot/boot.0300
of=/dev/hda bs=446 count=1'' ( ``cat /boot/boot.0300 >
/dev/hda'', ,
partition table ,
).
``fdisk /mbr'' DOS:
Linux disk
. Lilo, fdisk
Linux , Linux partition ( fdisk
DOS non-dos partitions).
Lilo root partition (..,
/dev/hda2),
Lilo. fdisk Linux
Linux partitions partition table. ,
DOS partition bootable.
3.
Lilo
:
boot = /dev/hda
delay = 0
vga = 0

# or your root partition


# or specify a delay in tenth of a second
# optional. Use "vga=1" to get 80x50

image = /boot/vmlinux
root = /dev/hda1
label = Linux
read-only

#
#
#
#

your zImage file


your root partition
or any fancy name
mount root read-only

other = /dev/hda4 # your dos partition, if any


table = /dev/hda # the current partition table
label = dos
# or any non-fancy name

, , ``image''
``other''. kernel images
lilo.conf,
.
4. hdc hda
Lilo map image
BIOS .
, Linux

hdc (master
controller) standalong primary IDE
controller .
partition, chroot
virtual hdc
.
lilo.conf Lilo
:
# This file must
boot = /dev/hdc
disk = /dev/hdc
bios = 0x80
delay = 0
vga = 0

be
#
#
#

used from a system running from /dev/hdc


overwrite MBR of hdc
tell how hdc will look like:
the bios will see it as first drive

image = /boot/vmlinux # root partition is /dev/hdc1


root = /dev/hda1
# hdc1 at boot will be hda1
label = Linux
read-only
Lilo
/dev/hdc1. Lilo boot sector
(/dev/hdc) vmlinux
/boot/boot.b ,
.., hdc.
/mnt/etc/lilo.conf.hdc
Lilo ``cd /mnt; chroot . sbin/lilo -C
/etc/lilo.conf.hdc'' /dev/hdc1 mount
/mnt.
5. Lilo BIOS Root
partition
IDE, SCSI. BIOS
SCSI . Linux Loader, Lilo,
BIOS BIOS .
AMI BIOS "A:" "C:". root
partition SCSI .
,
(map file), chain loader Linux partition IDE.
root
parition .
parition IDE (/dev/hda2, Linux
parition ) mounted
/u2. /etc/lilo.conf .

# Install LILO on the Master Boot Record


# on the first IDE.
#
boot = /dev/hda
# /sbin/lilo (the installer) copies the LILO boot record
# from the following file to the MBR location.
install = /u2/etc/lilo/boot.b
#
# I wrote a verbose boot menu. LILO finds it here.
message = /u2/etc/lilo/message
# The installer will build the following file. It tells
# the boot-loader where the blocks of the kernels are.
map = /u2/etc/lilo/map
compact
prompt
# Wait 10 seconds, then boot the 1.2.1 kernel by default.
timeout = 100
# The kernel is stored where BIOS can see it by doing this:
#
cp -p /usr/src/linux/arch/i386/boot/zImage /u2/z1.2.1
image = /u2/z1.2.1
label = 1.2.1
# LILO tells the kernel to mount the first SCSI partition
# as root. BIOS does not have to be able to see it.
root = /dev/sda1
# This partition will be checked and remounted by /etc/rc.d/rc.S
read-only
# I kept an old Slackware kernel lying around in case I built a
# kernel that doesn't work. I actually needed this once.
image = /u2/z1.0.9
label = 1.0.9

root = /dev/sda1
read-only
# My DR-DOS 6 partition.
other = /dev/hda1
loader=/u2/etc/lilo/chain.b
label = dos
alias = m

6.
BIOS
IDE 1GB.
BIOS '' 504 MB IDE. ( MB
2**10 bytes, 10**6 bytes). MS-DOS partition
350 MB /dev/hda1 Linux root partition 120 MB
/dev/hda2.
MS-DOS
. Novell DOS 7 .
, IBM "OnTrack"
.
"OnTrack Disk Manager." MSDOS,
.
' partition table fdisk Linux.
MSDOS-6.2 /dev/hda1.
`` MS-DOS .
MS-DOS
.''
, .
! fdisk Linux partition 1
table. MS-DOS 6.2
partition 1
. MS-DOS 6.2
Master Boot Record ,
.
Slackware (
Slackware "setup")
Linux LILO MBR MS-DOS.
. /etc/lilo.conf :
boot = /dev/hda
map = /lilo-map
delay = 100
ramdisk = 0
# Turns off ramdisk in Slackware kernel
timeout = 100
prompt
disk = /dev/hda
# BIOS only sees first 500 MB.
bios = 0x80
# specifies the first IDE.
sectors = 63
# get the numbers from your drive's docs.
heads = 16
cylinders = 2100
image = /vmlinuz
append = "hd=2100,16,63"

root = /dev/hda2
label = linux
read-only
vga = extended
other = /dev/hda1
label = msdos
table = /dev/hda
loader = /boot/chain.b

, partition
zImage, boot.b, map, chain.b
msdos,
"stacker"
"doublespace". DOS partition /dev/hda1
500 MB.
, "OnTrack"
partition table bytes
, ,
"" Linux IDE
.
Slackware. , IBM
"OnTrack". OnTrack.
Linux BIOS.
!
7. (Rescue Floppy)
, Windows-95 .
LILO MBR , Linux partitions
. ,
LILO ,
IDE.
LILO :

fdformat /dev/fd0H1440
mkfs -t minix /dev/fd0 1440
mount /dev/fd0 /mnt
cp -p /boot/chain.b /mnt
lilo -C /etc/lilo.flop
umount /mnt

#
#
#
#
#

lay tracks on virgin diskette


make file system of type minix
mount in the standard tmp mount point
copy the chain loader over
install LILO and the map on the diskette.

mounted
installer Lilo map
.
/etc/lilo.flop. :
# Makes a floppy that can boot kernels from HD.
boot = /dev/fd0

map = /mnt/lilo-map
delay = 100
ramdisk = 0
timeout = 100
prompt
disk = /dev/hda
# 1 GB IDE, BIOS only sees first 500 MB.
bios=0x80
sectors = 63
heads = 16
cylinders = 2100
image = /vmlinuz
append = "hd=2100,16,63"
root = /dev/hda2
label = linux
read-only
vga = extended
other = /dev/hda1
label = msdos
table = /dev/hda
loader = /mnt/chain.b

, MS-DOS 6.2 ,
. SCSI controller
, msdos
Linux mkdosfs, Windows-95 "D:".
MSDOS D:.
LILO. lilo.conf
2.
other = /dev/sda1
label = d6.2
table = /dev/sda
loader = /boot/any_d.b
, MSDOS-6.2
C: Windows-95 D:.
8.
, , ,
HOWTO, email :
voulariba@hellug.gr : evris@hellug.gr
: ep@rocketmail.com

You might also like