Mailing List Archive

Support open source code!


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

Re: tlug: Booting from SCSI and IDE drives



Dennis McMurchy wrote:-
>   Hi,
> 
>   Some of you with SCSI disks may find this tip useful.  I was
> booting my main Lignux installation from a floppy for almost a year
> because even with SCSI selected as the bootdisk in the BIOS setup (of
> this ASUS P2B motherboard), 'lilo' didn't seem to be able write
> anything bootable to the MBR on the SCSI disk.  It wouldn't interfere
> with an existing IDE hard drive MBR, but would just fill the screen
> with zeroes when I tried to boot it.  Hey, and I kind of like the idea
> of booting a state-of-the-art system from a legacy floppy anyway, so I
> didn't pursue the issue.   
> 
>   This spring I was building a similar machine in my cabin back in 
> Canada (ASUS P2BDual/U2WSCSI motherboard), and didn't bother attaching
> any IDE devices at first.  So I discovered by chance that as long as
> no hard disk is on the IDE bus (it's not enough just to disable IDE in
> the BIOS - you have to actually disconnect the device from the
> motherboard), then 'lilo' does a perfectly fine job of making the SCSI
> disk bootable.  When you then (re)attach an IDE hard drive, it will
> work as expected  and you can boot from either the SCSI or IDE drive by
> selecting the bootdisk in the BIOS setup.  
> 
>   Somehow I suspect this is probably not a limitation only of the
> ASUS motherboards I'm using

No, it's not - I suspect you ignored a lilo warning message.  I wrote
about this around 6 months ago; this is how I see it.

The way lilo works is it writes some assembler code to hard disk that
does a couple of BIOS calls to get the BIOS to load a few sectors from
the disk, and then lilo executes them.  The relevant BIOS calls take a
device number as hex, with the somewhat vague coding that 0x80 is disk
"one", 0x81 is disk "two" and so on.  The problem is to get lilo and
the BIOS to agree on which drive is represented by disk "one" etc.

Well, BIOS defaults to (assuming no disk in the floppy drive - if
there is, shift all the numbers up one)

0x80 = hda, 0x81 = hdb, .., 0x83 = hdd provided these exist.
Then it adds SCSI drives it whatever order your SCSI card tells it
(you can set this order in the SCSI card's BIOS).

So if you have one IDE and one SCSI, the default BIOS setup is

0x80 = IDE
0x81 = SCSI

Now, modern BIOSes allow you to override this, and you can set the
boot order to be SCSI first, in which case BIOS renumbers as follows:-

0x80 = SCSI
0x81 = IDE.

The trick is to ensure lilo agrees about the numbering, so that
its BIOS calls load its second stage from the sectors of the correct
disk.  Remembering that BIOS only attempts to load the boot sector from disk
"one", the trick is to get BIOS and lilo to agree 0x80 = SCSI.

Lilo defaults to IDE = 0x80, SCSI = 0x81 as BIOS does.  The lines

disk=/dev/sda
  bios=0x80

in your lilo main section mean that lilo writes assembler code to disk
assuming /dev/sda is BIOS 0x80.  If you do this, I bet you can boot
from SCSI with both a SCSI and IDE drive present and with BIOS set to
boot from SCSI (I do this regularly).  All this is documented in the
lilo docs, but it's not particularly clear.

One final catch to note is that most BIOSes require that at least one
"real" partition on disk "one" be flagged active, otherwise they
refuse to even try to boot from it even though it would work, giving
up with "non system disk" or "boot failed" or something similar
(i.e. they assume you're runnning MSDOS.)

Neil.
--

-------------------------------------------------------------------
Next Nomikai: May 26 (Wed), 19:30                        Place: TBD
*** Special guest: Eric S. Raymond
Next Technical Meeting: June 12 (Sat), 12  :30   place: Temple Univ.
-------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links