[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Lilo revisited



I have recently recieved a question about Lilo in a private email
(perhaps caused by my postings to this list). I belive the answer may 
be of value to others, so I will repost it here. This will also give
experts a chance to flame me for spreading misinformation if I have
gotten everything wrong :)

Question:

> A while back I  was having trouble with lilo not recognizing my
> drive properly.  I overcame this by using the "linear" option in the
> lilo.conf.  would this do the same thing to overcome the need for
> requiring the kernel to reside in the first 1024 cylinders?

Answer:

I believe the answer is no. Lilo depends on the BIOS to load the
kernel (and other files in /boot). If the BIOS cannot acces the
location on the drive there is nothing Lilo can do about it, and no
linear option can change that.  

The linear option is used for a slightly different purpose. Lilo needs 
to know the exact physical location of the files in a format
understandable by the BIOS, i.e. as sector/head/cylinder. It obtains
this information by recording the linear adress of the files and then
quering the kernel for the disk geometry parameters in order to  
translate the linear location into the sector/head/cylinder
format. 

This may fail occasionally on large disks because the disk
parameters obtained from the kernel query may be wrong. The kernel
retrives these parameters directly from the device. However, the BIOS
may use some implicit translation of sector/head/cylinder adresses in
order to overcome the large disk problem. This implicit translation is 
invisible to the kernel, as the kernel never queries the BIOS. Thus
the disk geometry reported by the kernel is incompatible with the disk 
geometry reported (and used) by the BIOS.

A solution to this problem is to use the linear option. This causes
Lilo not to query the kernel for the disk parameters. Instead Lilo
records the linear physical location of the files, and performs the
translation at boot-time by quering the BIOS for the disk parameters
during boot. 

The situation is therefore this:

- Some BIOSes cannot acces the upper part of a large disk if the disk
reports geometry parameters with more than 1024 sectors. In this case
the solution is to partition the disk carefully and place boot files
on a partition below the 1024 sectors.

- Some BIOSes can handle disks that report a disk geometry above 1024
sectors. These BIOSes uses translation to fool everyone into thinking
the disk has less than 1024 sectors. In this case the boot files can
be placed anywhere on the disk, but it is necessary to use the linear
option to make Lilo aware of this translation. 

- Some newer large disks perform this implicit translation themselves, 
and thus reports a geometry to the BIOS and the kernel with less than
1024 sectors. In this case the BIOS can access the entire disk and 
Lilo operates perfectly with or without the linear option. Drives with 
this capability are usually referred to as LBA drives (logical block
addressing).

Conclusion: Always use the linear option. If it works everything is
fine. If it doesn't work you must resort to the partitioning trick.  
Note however, that the linear option should not be used on floppies
or together with the compact option (which is only useful on
floppies). 

- Sten Anderson


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: