Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lilo dual boot quandry ; trying grub too [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 4:08 am    Post subject: lilo dual boot quandry ; trying grub too [SOLVED] Reply with quote

Preface: I tried grub during the initial install process, but after a dozen chroots to fix things I still didn't get a gentoo boot out of grub, so switched to lilo and it worked the FIRST TIME. (Worked better the second time though :) )

But, now with WinXP Pro SP2 installed on my other drive (SATA drives), I can't get windows to boot. Gentoo (AMD64) is on sdb, the bios knows to boot this drive first, and WinXP is on sda. If I switch the boot order in the bios, WinXP boots fine. When using the lilo menu at boot from sdb I get "Loading WindowsXP" and it stops there after a brief drive read. (sdb is partitioned sdb1-ext2, sdb2-swap, sdb3-xfs; sda is sda1-ntfs)

lilo.conf:
# Start LILO global section
#

lba32

# MBR to install LILO to:
boot = /dev/sdb
map = /boot/.map

install = /boot/boot-menu.b # Note that for lilo-22.5.5 or later you
# do not need boot-{text,menu,bmp}.b in
# /boot, as they are linked into the lilo
# binary.

menu-scheme=Wb
prompt
# If you always want to see the prompt with a 15 second timeout:
timeout=150
delay = 50
# Normal VGA console
#vga = normal
# VESA console with size 1280x1024x64k:
vga = 794

#
# End LILO global section
#

#
# Linux bootable partition config begins
#
image = /boot/kernel-2.6.9-gentoo-r14c
label = Gentoo
read-only
root = /dev/sdb3
# append = "noapic apm=off"
#
# Linux bootable partition config ends
#

#
# WinXP bootable partition config begins
#
other = /dev/sda1
label = WindowsXP
table = /dev/sda
#
# WinXP bootable partition config ends

I've tried no table line, I've tried swapping the table and label line order, other simple syntax stuff like that. /boot was mounted, lilo was run before each. Obviously, sda and sdb are found as bootable by fdisk. The bios only offers auto and large as access modes for the sata drives. Is it safe to try linear rather than lba32? Are there some other tricks that can be done?

Your help is appreciated!

-S


Last edited by sinkhole on Wed Mar 02, 2005 8:45 pm; edited 2 times in total
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Wed Mar 02, 2005 12:27 pm    Post subject: Reply with quote

Erm, I think this is to do with fooling Windows into thinking it's on the first disk. It tends to get upset and refuses to boot if it isn't. In grub, the way to do this would be to have an entry for Windows like this:
Code:
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1

Unfortunately, I don't know how to do that with LILO. :?

Another option might be to install LILO to the boot sector of sda, thus keeping Windows on the disk that is booted first.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 2:58 pm    Post subject: was worth a shot Reply with quote

Oh well, it didn't work. Still would not boot windows. (Once it doesn't boot, you have to go into recovery mode in WinXP by booting off the CD then run fixmbr. This was easy enough, just a caution for others looking to try.)

It seems I will have to go to grub... any more pointers for grub? I'm using AMD64, and sata drives. Uh oh... I'm in bootloader hell now. Grub won't even emerge! Only one package isn't masked and it craps out!

-S

PS: Found a good discussion covering what I want to do.... once I can get grub to emerge.

https://forums.gentoo.org/viewtopic-t-162038-highlight-dual+boot+grub+windows+sda+sdb.html
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Wed Mar 02, 2005 3:01 pm    Post subject: Reply with quote

Hmm! What's the error message you're getting with grub?
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 3:25 pm    Post subject: OK now, I think... Reply with quote

Ah, something going on with 32-bit compiling... need to reexamine. Ended up doing emerge grub-static and now have something to work with.

Thanks again!

-S

PS: I'll post a bug if you think it would be wise...

This was the error for emerge grub (AMD64 with emulation libs installed, but perhaps not configured correctly):

Calculating dependencies ...done!
>>> emerge (1 of 1) sys-boot/grub-0.94-r1 to /
>>> md5 src_uri ;-) grub-0.94.tar.gz
>>> md5 src_uri ;-) grub-0.94-splash.patch.bz2
>>> Unpacking source...
>>> Unpacking grub-0.94.tar.gz to /var/tmp/portage/grub-0.94-r1/work
>>> Unpacking grub-0.94-splash.patch.bz2 to /var/tmp/portage/grub-0.94-r1/work
* Applying grub-0.94-splash.patch ... [ ok ]
* Applying grub-0.94-gcc3.4.patch ... [ ok ]
>>> Source unpacked.
/usr/lib/portage/bin/ebuild.sh: line 1: -fno-pic: command not found
* econf: updating grub-0.94/config.guess with /usr/share/gnuconfig/config.guess
* econf: updating grub-0.94/config.sub with /usr/share/gnuconfig/config.sub
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/lib --datadir=/usr/lib/grub --exec-prefix=/ --disable-auto-linux-mem-opt --enable-diskless --enable-3c503 --enable-3c507 --enable-3c509 --enable-3c529 --enable-3c595 --enable-3c90x --enable-cs89x0 --enable-davicom --enable-depca --enable-eepro --enable-eepro100 --enable-epic100 --enable-exos205 --enable-ni5210 --enable-lance --enable-ne2100 --enable-ni5010 --enable-ni6510 --enable-natsemi --enable-ne --enable-ns8390 --enable-wd --enable-otulip --enable-rtl8139 --enable-sis900 --enable-sk-g16 --enable-smc9000 --enable-tiara --enable-tulip --enable-via-rhine --enable-w89c840
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-pc-linux-gnu-strip... no
checking for strip... strip
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of x86_64-pc-linux-gnu-gcc... gcc3
checking dependency style of x86_64-pc-linux-gnu-gcc... (cached) gcc3
checking for x86_64-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking whether optimization for size works... yes
checking whether -Wundef works... yes
checking whether -falign-loops works... yes
checking for x86_64-pc-linux-gnu-objcopy... no
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... no
checking whether objcopy works for absolute addresses... configure: error: x86_64-pc-linux-gnu-gcc cannot link at address 2000

!!! Please attach the config.log to your bug report:
!!! /var/tmp/portage/grub-0.94-r1/work/grub-0.94/config.log

!!! ERROR: sys-boot/grub-0.94-r1 failed.
!!! Function econf, Line 485, Exitcode 0
!!! econf failed
!!! If you need support, post the topmost build error, NOT this status message.
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Wed Mar 02, 2005 3:33 pm    Post subject: Reply with quote

Well, at least it's working. :D

I found this bug report which has the same error message you have, though: https://bugs.gentoo.org/show_bug.cgi?id=74825#c6. It seems to fail using hardened gcc, but work with the standard variety...
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 4:32 pm    Post subject: Actually... Reply with quote

Sorry... my comments were misleading. Grub is not working at all. It emerged, but that is all. Nothing about grub is easy and its too bad. It should be documented out the whazoo for all the tricks you need to get it to work. Who knew you may need a device.map file? Right now grub will not install to the MBR and I am hitting every possible error from this POS. Here's the info I'm dealing with...


grub # emerge -p grub-static

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild R ] sys-boot/grub-static-0.93.20030118


grub # ls -l
total 39
-rw-r--r-- 1 root root 30 Mar 2 10:58 device.map
-rw-r--r-- 1 root root 221 Mar 2 10:59 grub.conf
-rw-r--r-- 1 root root 1256 Mar 2 10:17 grub.conf.sample
lrwxrwxrwx 1 root root 9 Mar 2 11:04 menu.lst -> grub.conf
-rw-r--r-- 1 root root 33856 Mar 2 10:17 splash.xpm.gz


grub # more device.map
(hd0) /dev/sda
(hd1) /dev/sdb


grub # more grub.conf
default 0
timeout 30
splashimage=(hd1,0)/grub/splash.xpm.gz

title=Gentoo
root (hd1,0)
kernel /kernel-2.6.9-gentoo-r14c root=/dev/sdb3

title=WindowsXP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
chainloader +1


grub # grub-install --root-directory=/boot /dev/sdb
sed: -e expression #1, char 12: Invalid reference \1 on `s' command's RHS
sed: -e expression #1, char 12: Invalid reference \1 on `s' command's RHS
Unrecognized ls output: Not found or not a block device.


What does that cryptic error message mean? I HATE GRUB! Wish lilo would work.

-S
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Wed Mar 02, 2005 5:58 pm    Post subject: Reply with quote

Oh, wait a minute, I think I've led you astray... I thought Gentoo was installed on the first disk, and Windows on the second... :oops:

In that case you don't need the two map lines, and this should work:
Code:
default 0
timeout 30
splashimage=(hd1,0)/grub/splash.xpm.gz

title=Gentoo
root (hd1,0)
kernel /kernel-2.6.9-gentoo-r14c root=/dev/sdb3

title=WindowsXP
rootnoverify (hd0,0)
chainloader +1

I've never got grub-install to work properly though. I find it's much easier to go through the shell:
Code:
# grub
> root (hd1,0)
> setup (hd0)

_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 7:46 pm    Post subject: Not a problem.... Reply with quote

Not a problem at all Maedhros!

I am the error boy lately... here's another one, while doing the manual grub install.

grub.conf:

default 0
timeout 30
splashimage=(hd1,0)/grub/splash.xpm.gz

title=Gentoo
root (hd1,0)
kernel /kernel-2.6.9-gentoo-r14c root=/dev/sdb3

title=WindowsXP
#map (hd0) (hd1)
#map (hd1) (hd0)
rootnoverify (hd0,0)
chainloader +1


grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

Is it looking for the kernel in /boot/grub/ and /grub ? What does stage1 mean?

-S

PS: How does it distinguish between sata and regular hard drives? I've read not to use sd0,1,2 etc.
Back to top
View user's profile Send private message
samstern
n00b
n00b


Joined: 02 Jun 2003
Posts: 8

PostPosted: Wed Mar 02, 2005 8:03 pm    Post subject: Re: lilo dual boot quandry ; trying grub too Reply with quote

sinkhole wrote:

# WinXP bootable partition config begins
#
other = /dev/sda1
label = WindowsXP
table = /dev/sda
#
# WinXP bootable partition config ends


Hi,

In your /etc/lilo.config Try adding the keyword "master-boot" (needed to assure that xp sees itself as the C: drive) so you will have:

other = /dev/sda1
label = WindowsXP
table = /dev/sda
master-boot
#
# WinXP bootable partition config ends


That's how I got XP fixed up on my system (one drive, three partitions). The "master-boot" option is documented as:

"master-boot
This flag (LILO version 22.5) indicates a DOS/Windows/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.

This option may by specified as a global option, in which case it applies to all "other=" sections unless overridden with a specific "boot-as=" option.
"



good luck!


Sam Stern
Baltimore, MD, USA
Back to top
View user's profile Send private message
sinkhole
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2003
Posts: 136

PostPosted: Wed Mar 02, 2005 8:44 pm    Post subject: Go me, it's my birthday... it's my birthday... Reply with quote

SWEET!

That worked. Ah, good old lilo. I knew it could be done, although I sold out to try grub!


Here is the working lilo.conf (dual boot Gentoo - WinXP; SATA; Gentoo on sdb, Win on sda)....

lba32

boot = /dev/sdb
map = /boot/.map

install = /boot/boot-menu.b

menu-scheme=Wb
prompt

timeout=150
delay = 50

vga = 794

image = /boot/kernel-2.6.9-gentoo-r14c
label = Gentoo
read-only
root = /dev/sdb3

other = /dev/sda1
label = WindowsXP
table = /dev/sda
master-boot


Many thanks guys! I'll keep an eye on grub too.

-S

PS: One advantage of this setup is if either drive craps out you have a native boot into the other.


Gigabyte GA-K8NF-9 (Nvidia Nforce4 x4, "impaired version", but tests real fast)
Athlon64 3000+
1 GB DDR
GIGABYTE nVIDIA GeForce 6600 Video Card, 128MB DDR, 128-Bit, DVI/TV-Out, PCI-Express, Model "GV-NX66128D"
DVD-R/RW
WD 36GB Raptors x2 (SATA)
Samsung 160GB SATA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum