Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lilo for secondary IDE

0 views
Skip to first unread message

Hung P. Tran

unread,
Jan 8, 2001, 4:37:53 PM1/8/01
to
I am trying to make a boot hard drive to boot from a
secondary IDE. My lilo.conf is as followed:

#boot=/dev/fd0
boot=/dev/hdc
map=/mnt/floppy/map
install=/mnt/floppy/boot.b
prompt
timeout=50
default=linux

image=/mnt/floppy/vmlinuz
label=linux
root=/dev/hda5


Note that the same lilo.conf works for a floppy (just by replacing
the boot line to /dev/fd0). However, when I mount my secondary
harddrive to the same place (to minimize lilo.conf change) using:

mount /dev/hdc1 /mnt/floppy

The same lilo.conf will not work. All I get is an "L" and then
a bunch of 01 dump onto the screen. I also try to use "linear"
to no avail. Any advice.

Thank you for any help,

hung

HomerWelch

unread,
Jan 8, 2001, 6:32:23 PM1/8/01
to

Did you rerun lilo after changing that parameter? You have
to install lilo in the MBR of hdc. Also, lilo creates the
map file and install it.

You may have to change your parameters in your bios to get
it to detect the hdc as a bootable disk. At least on my
system, it will only look at fd0 and hda for boot
information.

good luck,


--

Homer J. Welch hjw...@home.com
Troy, Michigan

John in SD

unread,
Jan 8, 2001, 6:38:37 PM1/8/01
to

When you boot, the floppy will be read first (device 0x00), then device
(0x80). I don't know how to get your bios to first read device (0x82), even
if it installs that device. Older BIOSes will only install 0x80 and 0x81.

--John


>
>hung


LILO version 21.6 (04-Oct-2000) source at
http://www.ibiblio.org/pub/Linux/system/boot/lilo
patches at ftp://brun.dyndns.org/pub/linux/lilo

Dave Platt

unread,
Jan 8, 2001, 6:57:44 PM1/8/01
to
>> I am trying to make a boot hard drive to boot from a
>> secondary IDE. My lilo.conf is as followed:
>>
>> #boot=/dev/fd0
>> boot=/dev/hdc

#snip

>> The same lilo.conf will not work. All I get is an "L" and then
>> a bunch of 01 dump onto the screen. I also try to use "linear"
>> to no avail. Any advice.
>>
>
>Did you rerun lilo after changing that parameter? You have
>to install lilo in the MBR of hdc. Also, lilo creates the
>map file and install it.

A normal PC BIOS will boot only from the MBR of the primary hard
drive. It won't even "look" for the secondary hard drive MBR. The
normal way to boot a Linux system from a secondary hard drive is to
put LILO in the MBR of the primary hard drive (or put the standard MBR
there, and put LILO in the boot block of the active partition on the
primary hard drive). You can have the kernel itself, and the root
filesystem on the secondary hard drive, but the MBR and active active
partition normally need to be on the primary drive.

There are some BIOSes which can be configured to boot from the
secondary hard drive. There's a gotcha to enabling this feature,
though. Most disk-resident MBR and bootloader code isn't written to
be booted from a secondary drive (it "assumes" that the system is on
the primary drive). In order to cope with this lacking, the BIOS
doesn't just load the MBR etc. from the secondary drive - it actually
*swaps* the two drives at the BIOS level.

In a standard system, the first bootable disk (typically the master on
the IDE primary controller) is referred to as device 0x80 in the I/O
calls to the BIOS. The second drive is 0x81, and so forth.

If you tell your BIOS to swap controllers, it actually assigns device
ID 0x80 to the master drive on the secondary controller. Thus, when a
standard MBR is loaded from this drive and executed, it "thinks" that
it's really on the primary drive, and has no difficulty reading the
partition table and the O/S boot blocks. A similar thing occurs if
you have a SCSI controller, and tell your BIOS to "boot SCSI" - the
0x80 drive ID is assigned to the first disk device on the first SCSI
controller, rather than to the IDE primary master.

When /sbin/lilo is run to install LILO, it has to write information
into the MBR-resident portion of LILO, and into its own boot catalog,
which tells the boot code where to find each portion of the code being
booted. It must figure out which BIOS disk identifier is used for
each drive, and identify the location of each bootable bit of code by
(drive ID, location, size).

The /sbin/lilo installer normally honors the standard BIOS
conventions... IDE primary master, IDE primary slave, IDE secondary,
SCSI, in that order. This works just fine for a standard setup. It
will NOT work if you've told your BIOS to swap drives or controllers
around, because the BIOS ordering will disagree with the ordering that
the LILO installer assumed.

The net result will be the sort of thing you're observing... the first
(MBR-resident) portion of LILO will load, but the subsequent sections
won't load properly, because the MBR-resident portions of LILO will be
using the wrong device IDs.

The way around this problem is to use _explicit_ device IDs in your
/etc/lilo.conf file. Figure out what device IDs your BIOS is going to
assign at boot time, and then tell LILO to use precisely these IDs.

As an example: I have a system with two IDE hard drives, and one IDE
hard drive. In a standard setup, the IDE drive would be 0x80, and the
two SCSI drives would be 0x81 and 0x82. However, I've told my BIOS
that I want to boot from SCSI (the IDE drive is strictly for bulk
storage), and so it reorganizes the drive IDs (SCSI first, IDE
second). In my lilo.conf file, I say:

#
# LILO is installed in the boot sector of the extended partition at
# /dev/sda2. The disk's MBR is standard.
#
disk = /dev/sda
bios = 0x80
disk = /dev/sdb
bios = 0x81
disk = /dev/hda
bios = 0x82
boot = /dev/sda2
install = /boot/boot.b
delay = 50

and so forth. This gives LILO the information it needs to build the
boot-map files with the correct drive IDs, and the system boots up from
the SCSI drives just fine.

I suspect that you may need to do something similar. If you're
telling your BIOS to boot from the secondary controller, you'll need to
say something like:

disk = /dev/hda
bios = 0x81
disk = /dev/hdc
bios = 0x80

to swap around the BIOS drive IDs for the drives on these two
controllers.

--
Dave Platt dpl...@radagast.org
Visit the Jade Warrior home page: http://www.radagast.org/jade-warrior/
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!

Hung P. Tran

unread,
Jan 9, 2001, 2:15:05 PM1/9/01
to
Thank you to all those response especially Dave for all the
helpful info. For everyone info, I did run lilo after modify lilo.conf
(please note that I got an "L" upon attemping reboot). I did
also verify that my BIOS can boot from a secondary IDE drive (with
DOS). However, I have to add:

disk = /dev/hdc
bios = 0x80

as Dave recommended to get my secondary IDE to boot linux.

Thanks again to all who response,


hung

0 new messages