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

Re: lilo (linux only hd -> dos only hd), no solution possible?



On 29 Oct, Kevin Grant wrote:
> Thanks for the help I've gotten on this so far.  Unfortunately it doesn't
> seem to be working.  I seem to be caught in a catch-22 situation as far
> as getting the system to behave as I want it to.  Here's the situation:
> 
> I have one dos/windows only hd.  I have one linux only hd.  I want to be
> able to boot up linux and then use lilo to move to dos if I desire.  The
> earlier problem was that I had the linux hd as /dev/hda and the dos drive
> as /dev/hdb and lilo couldn't get dos to boot off of /dev/hdb.  Apparently
> the dos hd has to be /dev/hda (drive C in dos terms) to boot.  So I could
> only get into dos by telling my bios to swap the boot sequence around and
> boot off of drive "D" (apparently this caused the system to treat the dos
> drive as if it were drive C).
> 
> To solve this I swapped the hd's around and made the dos drive /dev/hda and
> the linux drive /dev/hdb.  However I still want to boot off of the linux
> drive, so I set the bios boot sequence so that it would boot from drive D
> (/dev/hdb).  Unfortunately this seems to cause the bios to consider
> drive C not to be the master drive anymore so that when I try to use lilo
> to get into dos I get exactly the same error message as before, a sort of
> "disk not available or non-system disk in drive" sort of message.
> 
> The catch-22 seems to be: the only way to boot linux from a linux-only hd
> as the default when the machine is turned on is to make the linux-only hd
> /dev/hda, or to alter the bios boot sequence so that the system treats it
> that way (no, I don't want to use a boot floopy to boot up linux either).
> At the same time, in order for lilo to boot up a dos-only hd, the dos-only
> hd has to be /dev/hda.  Unfortunately both hd's cannot be /dev/hda at the
> same time.  So if my analysis is correct, and unless lilo has some way to
> make the system change the hd that it considers the primary drive, there
> is no way to accomplish what I wish to accomplish.
> 
> The problem is that I am a linux newbie and can't tell if I'm making sense
> here.  Comments and possible solutions, if any exist, are requested.
> 
> Oh, and my latest attempt has netted me a "cannot start virtual terminal"
> sort of error message on the linux side, followed by a freeze, so that I
> can't boot linux at all.  This raises another interesting issue.  Since
> the lilo.config I'm experimenting with now contains lines like
> "boot = /dev/hdb1", if I change the drives back the way they were (with the
> linux drive as /dev/hda) presumably I won't be able to boot linux because
> the lilo.config stuff will point to the wrong place.  On the other hand, I
> can't boot into linux now to change the lilo.config file.  So how do you
> get into linux to change a lilo.config file when you cannot get into
> linux until after you've changed the file? :)  I'm guessing I've got to
> resort to the boot floppies at this point, right?  Even if this is the case,
> there should be a sort of general solution to this problem, to let you
> experiment with the contents of lilo.config safely.  I.E. to write a new
> one that doesn't work, and then to be able to get into linux anyway,
> without having to resort to a boot floppy, by some command that tells
> lilo to boot up using a "safe" backup config file that you know works.
> Is this option around and being new I'm just not aware of it?
>  
> If you've actually read this far thanks for your attention,
> -Kevin
> 

Whew!  I'm not sure what to tell you as to how to get from where you
are to where you want to be, but:

Dos/Win really must boot from the "first" hard drive, i.e. hda.  So
that one has to go first, and linux has to go on hdb.  When you have
the BIOS switch things around, dos gets confused, so that won't do
either.  What you need to do is to put the hard drives in with the dos
drive as hda and the linux drive as hdb, with the BIOS set to boot from
hda.  From here, what you would like to have happen is to have lilo
boot from hda and boot into linux on hdb or dos on hda.  I think your
/etc/lilo.conf should look something like:

boot=/dev/hda    (this line is the key)
root=/dev/hdb1   (or whatever)
.....            (regular linux boot stuff)
....             (and any other stuff you need or want)
other=/dev/hda1  (or whichever partition dos is really on)
label=dos

The first line tells lilo to install itself on the master boot record
of hda, so that it will be called first in the boot sequence.  The rest
just tells it where everything lives, so that it can find it
appropriately.

HTH,

-- 
Stephen Ryan                   Debian GNU/Linux
Mathematics graduate student, Dartmouth College


Reply to: