LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting a duel boot to work (https://www.linuxquestions.org/questions/linux-newbie-8/getting-a-duel-boot-to-work-223533/)

tearinox 08-28-2004 12:06 PM

Getting a duel boot to work
 
Okay, I've done this a million times.. But for some reason today, after i reformatted and installed windows again, lilo wont boot into windows anymore.

Fdisk -l
Code:

Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1      12176    97803688+  83  Linux
/dev/hda2          12177      14608    19535040    b  W95 FAT32
/dev/hda3          14609      14946    2714985  82  Linux swap

Disk /dev/hdb: 33.8 GB, 33820286976 bytes
16 heads, 63 sectors/track, 65531 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hdb1  *          1      65530    33027088+  7  HPFS/NTFS

/etc/lilo.conf
Code:

boot = /dev/hda1
prompt
timeout = 50
vga = 773

image = /boot/vmlinuz
  root = /dev/hda1
  label = Linux
  read-only
other = /dev/hdb1
  label = WinXP
  table = /dev/hdb

Does anyone see anything thats wrong there. Linux (/dev/hda1) is where i put lilo and lilo boots up just fine.. Its just when I select the windows ntfs partition, it just restarts lilo.

Any Ideas?

Demonbane 08-28-2004 12:18 PM

try
Code:

other = /dev/hdb1
 boot-as = 0x80
 label = WinXP
 table = /dev/hdb


tearinox 08-28-2004 12:55 PM

When I changed it to that, and I try to run lilo:

Code:

Warning: LBA32 addressing assumed
Warning: Int 0x13 function 8 and function 0x48 return different
head/sector geometries for BIOS drive 0x80
    fn 08: 1024 cylinders, 255 heads, 63 sectors
    fn 48: 58853 cylinders, 16 heads, 63 sectors
Added Linux *
Unrecognized token "boot-as" at or above line 12 in file '/etc/lilo.conf'


Demonbane 08-28-2004 01:19 PM

ok your version of LILO is old, try this one instead
Code:

other = /dev/hdb1
  label = WinXP
  map-drive=0x80 to=0x81 
  map-drive=0x81 to=0x80


dsegel 08-28-2004 02:28 PM

Try it the simple way:

Code:

other=/dev/hdb1
  label=windows

Forget all the map, table, boot-as, etc. options.

jomen 08-28-2004 02:40 PM

...should'nt you install lilo to mbr of the whole hd - that would mean a line like this:

boot = /dev/hda

if you install it like:

boot = /dev/hda1

it gets installed to the first partition of hda - and will probably not be found - there needs to be a mbr for the disk as a whole - I think

dsegel 08-28-2004 04:38 PM

Quote:

Originally posted by jomen
...should'nt you install lilo to mbr of the whole hd - that would mean a line like this:

boot = /dev/hda

This is true, but he did say lilo was working fine and it was only booting into Windows that was failing.

But this brings up another point - is the OP re-running lilo after each edit of the lilo.conf file? If you don't re-run lilo then it won't install the new options into the MBR. Also, if he does specify it as /dev/hda1 instead of /dev/hda then it might not update the correct MBR.

tearinox 08-28-2004 08:31 PM

No, I do not need to install it on the mbr.. As long as it is the first hard drive parititon with the boot attribute (from cfdisk/fdisk) it will boot..

And thank you demonbane, this was a wierd problem and i dont understand how that fixed it.. Care to explain?

btw- it works now :)

Demonbane 08-28-2004 09:13 PM

It depends on how yor drives were configured when Windows was installed. If your hdb was either set to the first boot device in bios or physicaly moved to hda while installing Windows, then it needs to stay in the first boot device in order to boot, therefore when you set the first boot device back to your 120gig drive it fails to load.
The workaround is to trick the Windows os loader into thinking it is on the first boot device, which is exactly what the "map-drive" or "boot-as" directives in lilo.conf is doing.
Note that this is not always the case, for example if you left the 120gig drive as the first boot device while installing Windows, chances are Windows os loader gets installed /dev/hda2 where it's able to write into and set to active by the installer, in that case you configure lilo to load /dev/hda2 without the drive mappings.

tearinox 08-28-2004 11:24 PM

Oh okay, I did choice A (took out the 120gb and installed windows) because when I tried to install windows with the 120gb still in (installing windows on my 40gb) However It came up with an error saying NTLDR.exe not found or something along those lines.

So I figured I should just unplug the 120gb's power, install windows, plug the 120gb back in and reconfig lilo to boot the new windows.

Then I got that error

Demonbane came to the rescue, thanks buddy. For reference to others about this "boot-as" / "map-drive" trick, heres part of the manual (lilo.conf)

Code:

              This flag (LILO version 22.5) indicates a  DOS/Win_
              dows/OS2  or other system which will only boot from
              BIOS device 0x80, the "C:" drive, or BIOS device 0,
              the  A: drive. When this flag is specified, if this
              drive is not assigned device code 0x80 or 0 by  the
              BIOS,  then  the chain loader will dynamically swap
              the device code actually assigned with device  code
              0x80 or 0 to make this drive appear to be the first
              hard or floppy drive, "C:" or "A:".           

                        This flag is easier to use than  "map-drive="  (see
              below),  and  is  preferred,  if  simple forcing of
              device code 0x80 is all that  is  required.  It  is
              also  more  general,  in that the necessity to swap
              BIOS device  codes  is  determined  dynamically  at
              boot-time,  not at boot install-time, as with "map-
              drive=".  It is slightly more powerful than  "boot-
              as=",  in that the device code which is assigned, 0
              or 0x80, is determined dynamically.

Now I'm just curious and trying to figure out how this really works. The boot-as was supposed to LILO that windows was the first hard drive just to fool windows that it was the first hard drive. However, since my version of lilo seems to be outdated (LILO v22.3.2) Latest (22.5.9), i needed to do a little "hack" with the map-drive option. Im not sure how that part works because you switch it back and forth But it seems to end on 0x80 which is what windows needs to boot.

Sorry for the long post, i just was thinking and typing at the same time. Thanks Demonbane

Demonbane 08-29-2004 12:49 AM

put it this way
Code:

  map-drive=0x80 to=0x81 
  map-drive=0x81 to=0x80

is equivalent to
Code:

boot-as = 0x80
except that the use of "boot-as" is only supported in newer versions of LILO, it is prefered simply because there's less letters to type.


All times are GMT -5. The time now is 04:25 PM.