"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, answerguy@ssc.com
LinuxCare, http://www.linuxcare.com/


(?) Keeping Both Hard Drives Connected

New LILO Overcomes 1024 Cylinder Limit!

From Crazy Weirdo on Thu, 23 Mar 2000

Answer Guy,

I just bought a new hard drive for my pc. I put Linux on it. The problem with that is i cant keep both hard drives connected at the same time unless i keep changing the jumpers. Is there a way to make LILO boot windows while its on another HDD....if so...how is it done?

This is a test of the Weirdo e-mail system. Had this been an actual e-mail you would have become extremely hostile towards me and other users of the internet, but just relax and realize that this was just a test.

Weirdo

(!) I presume that these are IDE hard drives. It doesn't matter too much, but there wouldn't be this problem with SCSI.
Anyway, LILO will load an OS off of any drive and partition that the BIOS can see. I've heard that a new version finally overcomes the classic old 1024 cylinder limit that's been plaguing it (and us) for so long.
Oddly enough this is one of the few software upgrades that I've seen recently that I couldn't find at Freshmeat.net (http://www.freshmeat.net)
Another good place to look for open source and free software release announcements is Appwatch (http://www.appwatch.com). Here's the one for the latest LILO:

LILO 21.4.1 (John D. Rowell) 20000321 22:45 GMT

Changes: Since v21: Will boot from disks up to 2048Gb in size, as long as the BIOS allows the Enhanced BIOS calls for 32-bit sector addressing using packet calls; Checks if BIOS supports packet calls (int 0x13, AH=0x42), and uses these calls if 'lba32' was specified.

Otherwise, it uses the C:H:S addressing scheme of the original IBM-PC BIOS; the disk read routine is separated into its own source file, "read.S", which is included in the first-stage, and second-stage loader codes. The first stage loader uses a very stripped down read routine, since it only deals in single sector transfers; if BIOS does not support 32-bit packet calls, and the cylinder address overflows when the 32-bit address is converted to C:H:S, then a "9f" error code is issued; map compaction of 'lba32' addresses is supported with the existing '-c' switch (or 'compact' configuration file global option); floppy disks now will always fall back to C:H:S addressing; changed the -v option to now accept a single digit to set the verbosity level; e.g., 'lilo -v 5 ...' replaces 'lilo -v -v -v -v -v ...' for maximum diagnostic output;

LILO version information is moved to the file 'version.h', and VERSION is now deleted. This allows for tracking of VERSION_MAJOR (=21) and VERSION_MINOR (=3) for this and future code paths;

Inspired by 'dparam.com', a much more extensive BIOS test program is included with this version. Called 'disk.com', it was developed under DOS, and requires 'nasm' to be assembled; DISK.COM will probe the BIOS for disks supported by the BIOS, and report on their CHS geometry.

If EDD is supported, the EDD geometry is also reported. If disks with cylinder numbers of 1024 or above are detected, it will issue a recommendation to use LILO with the 'lba32' option. Creation of the bootable floppy image version of this utility is incomplete at this time. Fixed: bug in 'read.S' that disabled the combination 'linear' with 'compact' ( '-l' and '-c' together). Added: the '-L' command line switch and 'lba32' configuration file global option.

Note: Currently only available here. Console / System (BSD)

(http://www.appwatch.com/Linux/Users/history?app_id=46&vty_id=S)
What all of that goobledygook means is that LILO has been updated to handle these HUGE drives without forcing us to have a little partition below the 1024 cylinder line that used to be the upper limit on PC hard drive sizes. (Read some of my back issue rants about LILO to get more info on that then you want to hear).
So, back to your question:
If you have a LILO conf like this:
              boot = /dev/hda
              root = /dev/hda1
	      prompt

              image = /boot/vmlinuz-2.3.99pre3
		      read-only
		      append="devfs=nomount"
                      label = new

              image = /boot/vmlinuz-2.2.14
		      read-only
                      label = cur

              image = /boot/vmlinuz-2.0.38
		      read-only
		      label = old

              other = /dev/hdb1
		      label = dos

You should be able to have both drives co-exist. You should be able to use LILO to boot any of the three Linux kernels (new, cur(rent), and old) or your MS-DOS/Win'9x by simply typing any one of those three-letter keywords (stanza labels) at the LILO prompt.
Note that the "other" directive points to /dev/hdb1 --- the first partition on the second IDE hard drive on your primary IDE controller. That might be /dev/hdc1 (master hard drive on the secondary controller) or even /dev/hdd1 (slave drive on the secondary contoller). That all depends on how your drives are physically connected, and if you have an IDE CD-ROM and how its connected. Of course it might be in some other partition on any of these drives. You BIOS might only allow you to boot from /dev/hda and /dev/hdb (first two drives on the primary controller).
I'm once again going to point to LOADLIN.EXE. Search through my archives here at Linux Gazette:
http://www.linuxgazette.com/cgi-bin/webglimpse/LG/search? query=loadlin.exe&errors=0&age=&maxfiles=50&maxlines=30 &maxchars=10000&cache=yes
... to review what I've said about this before. My basic rule of thumb is: "If you have to ask about making MS-DOS and/or MS-Win '9x co-exist with Linux --- USE LOADLIN.EXE!"
It just works. No muss! No fuss! No worrying about what drive, partition, or cylinder your kernel is on. The object of this game is to get the Linux kernel (and maybe an initial RAM disk) into memory, and jump into the kernel image's entry point (possibly passing it a list of command line arguments). Once you've managed that, then the Linux kernel can take care of all the other fussy details about finding and mounting its root filesystem and driving its hardware. (The kernel doesn't need the BIOS for any normal operations --- though there is some minor device configuration that the kernel expects is already done before it got loaded. Linux has its own 32-bit native drivers for all PC/x86 hardware). (I guess there are some PCI BIOS32 and APM functions that are actually handled by modern BIOS' --- but I don't know the details).


Copyright © 2000, James T. Dennis
Published in The Linux Gazette Issue 52 April 2000
HTML transformation by Heather Stern of Tuxtops, Inc., http://www.tuxtops.com/


[ Answer Guy Current Index ] [ Index of Past Answers ] greetings 1 2 3 4
5 6 7 8 9
10 11 12 13 14 15 16 17
18 19 20 21 22 23 24


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Linux Gazette FAQ ] [ Next Section ]