[NTLUG:Discuss] fundas gone for a toss!!

Jim Williams jimw at linux-class.com
Thu Aug 1 11:06:56 CDT 2002


Vaidya, Harshal (Cognizant) wrote:

>Hi All,
>    While recompiling the linux kernel yesterday i came across a fundamental
>problem.
>    The way LILO knows which partition to mount as root is by reading the
>lilo.conf.
>     When we specify the kernel to be booted the, first thing lilo does is
>mounts the root partition. 
>     This is specified as root = /dev/hdb10 (for example). 
>     What i am wondering is.. to locate /dev/hdb10 file itself... / needs to
>be mounted.. i.e. the root partition needs to be mounted before kernel can
>start reading any file on that disk.
>
>    How come then lilo can locate /dev/hdb10 before / is mounted.
>
>Harshal.
>
This is the sequence with LILO.

During install or anytime you run the lilo "mapper" application from the 
command line, the /etc/lilo.conf file is read to determine what images 
you wish to load. The kernels for these images are "mapped" or the 
physical sectors are determined and placed into your "map file", usually 
/boot/map, along with any and all options for these kernels. One of 
those options is what partition to mount as root. The physical locations 
for the map file itself and your second stage loader are then determined 
and this data is placed into your MBR.

At boot time, the BIOS passes control to the MBR which contains the LILO 
boot loader. This then loads the second stage boot loader ( /boot/boot.b 
) which in turn loads your map file. All of this is done by physical 
sector so no mounting is necessary. At this point you have the "LILO 
boot:" prompt and you can decide which of your available images you wish 
to load. Either by selecting an image or letting it time out and load 
the default, your kernel is loaded into memory, again by physical 
sector, and the kernel begins execution. LILO passes the kernel the 
option of what disk partition should be used as it's "root filesystem" 
and once the kernel is operating it loads that partition and attempts to 
execute "/sbin/init".

All of this is assuming that you have a basic LILO config, booted from 
the MBR, and you are loading a standard Linux kernel.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Williams
RHCE, CCNA, MCSE+I
Contract Systems Administrator &
Certified Technical Instructor
S.Florida: 954.558.2807
Dallas/Ft.Worth: 214.557.3626 
Break Out of the Windows Box!
Explore the possibilities of Open Source Software.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







More information about the Discuss mailing list