PDA

View Full Version : No Grub on Dual Boot


duralisis
14th April 2005, 06:38 PM
I'm attempting to dual boot XP and FC4T2 on separate drives, but after installing Grub on the MBR, it still goes into NTLDR and jumps straight into XP!

I've previously had a working FC3 install which I dual booted using NTLDR and copying the boot sector of the second drive into a file, then setting "c:\bootsect.lnx=Linux" in my boot.ini. It worked well and I had no problems, but on a fresh install of FC4 (no upgrade, wiped the drive first) I set it to use Grub and install it on the MBR of the first drive (hda) instead of the first partition of the second drive. I thought this would then make Grub my boot loader.

However it doesn't. I get a brief flicker of the screen on boot, then it goes straight into XP. No Grub menu at all. I thought NTLDR should be gone if Grub is installed into the MBR of hda? Just to check that indeed NTLDR is there, I try adding the boot file using "bootpart" to copy the boot sector of hdb and add the entry to boot.ini. Sure enough it does, but it refuses to boot Fedora, I get a message similar to:

"Bootpart 2.50... Cannot load from harddisk, Insert system disk..."

What's going wrong? Shouldn't Grub be there instead of NTLDR? Has something changed from FC3 to FC4 in Grub or the way it boots a partition?

Here's the system config:

Intel Celeron 433
Intel A440LX Motherboard
448MB RAM
hda -- 6.4GB -- Windows XP
hdb -- 10GB -- Fedora

GetTruth
14th April 2005, 08:59 PM
Did you install Fedora Core 4 last? If not, it won't work...

SlowJet
14th April 2005, 09:23 PM

Add a boot line for "Linux" to the Win boot up (boot.ini?)
Point it to hdb (mbr ) or hdb1 (grub /boot)

you'll get windows and Linux, pick Linux and you'll get Grub list.

This is foward chaning to the multiple installs, each having their own BOOT partition.
This is how Grub shold work, but it has a bug and backwards chains because it takes over the member on ever install.

It's a very big issue for those planing on running several installs and whanting to keep the base install or delete the last install because it is a test or it didn't work.

I have looked on the web for information about this and most web sites are in the dark ages.
They haven't a clue about seperate installs. Most are bunched together into one boot and the last install owns the mbr.

Then they pretend to be experts and mummble under their breath when you ask for specifics. ;)

SJ

Firewing1
14th April 2005, 09:51 PM
Hey,
Keep NT boot loader on the MBR. Install grub on the 2nd disk. Then, as you said before, copy the boot sector.. .That's what I did, it work nice 'n sweet. Here's my setup:

MBR --> NT bootloader with Linux as an option
hda1 --> DELL recovery partition, hidden
hda2 --> WinXP
hdb1 --> FAT32 WinXP/Linux share incase I need to restore a system, I put backups here.
hdb2 --> /boot, GRUB
hdb3 --> / (root partition)

GRUB links to NT boot loader, plus all kernels.
NT boot loader can still load XP, but Linux is the default.

So, they link to eachother incase I miss the countdown, and I have Linux on a seperate drive!
http://s-computers.dyndns.org:8000/OS/dualboot.php? for more info.
Good Luck,
Firewing1

duralisis
14th April 2005, 09:57 PM
Yep, XP was already installed. I only wiped the second drive.

duralisis
14th April 2005, 10:03 PM
That what I was doing and it worked fine for FC3, but again, doing the same for FC4T2 results in a "cannot load from harddisk" error; before it even gets to Grub. Additionally, I've tried it both ways now, using NTLDR with the bootsector and by at least _trying_ to have Grub installed on the (hda) MBR. I thought that should have worked no matter what.

I'm going to try an "upgrade" from FC3 next without modifying the boot loader if I can, maybe that'll work. As it is though, something definitely changed. I doubt a simple program like bootpart would have an incompatibility with just a new version. It's only copying the first 512 sectors of the disk.

If this is a bug or problem with the anaconda installer or grub or configuration, I wouldn't know where to start to submit a Bugzilla report. I can't tell what's causing it.

cybrjackle
15th April 2005, 02:43 PM
boot from the rescue cd or disk one.


chroot /mnt/sysimage


re-install grub to your mbr, for example if your main disk is hda


grub-install /dev/hda

SlowJet
15th April 2005, 03:23 PM
Grub does not go on a mbr. A boot record goes on a mbr.
Grub is a folder, program. and files.
It cannot be installed on an NTFS file system by anything except Windows XP OS through the NTFS.SYS driver.

SJ

cybrjackle
15th April 2005, 03:53 PM
Grub does not go on a mbr. A boot record goes on a mbr.
Grub is a folder, program. and files.
It cannot be installed on an NTFS file system by anything except Windows XP OS through the NTFS.SYS driver.

SJ

Who said anything about installing it on NTFS?

I said /dev/hda which if that is the main drive, then the first sector will be the mbr and what file system is on /dev/hda1 doesn't matter.

GRand Unified Bootloader as the name suggest is a "bootloader"


10 GRUB image files
*******************

GRUB consists of several images: two essential stages, optional stages
called "Stage 1.5", one image for bootable CD-ROM, and two network boot
images. Here is a short overview of them. *Note Internals::, for more
details.

`stage1'
This is an essential image used for booting up GRUB. Usually, this
is embedded in an MBR or the boot sector of a partition. Because a
PC boot sector is 512 bytes, the size of this image is exactly 512
bytes.

All `stage1' must do is to load Stage 2 or Stage 1.5 from a local
disk. Because of the size restriction, `stage1' encodes the
location of Stage 2 (or Stage 1.5) in a block list format, so it
never understand any filesystem structure.

`stage2'
This is the core image of GRUB. It does everything but booting up
itself. Usually, this is put in a filesystem, but that is not
required.

`e2fs_stage1_5'
`fat_stage1_5'
`ffs_stage1_5'
`jfs_stage1_5'
`minix_stage1_5'
`reiserfs_stage1_5'
`vstafs_stage1_5'
`xfs_stage1_5'
These are called "Stage 1.5", because they serve as a bridge
between `stage1' and `stage2', that is to say, Stage 1.5 is loaded
by Stage 1 and Stage 1.5 loads Stage 2. The difference between
`stage1' and `*_stage1_5' is that the former doesn't understand
any filesystem while the latter understands one filesystem (e.g.
`e2fs_stage1_5' understands ext2fs). So you can move the Stage 2
image to another location safely, even after GRUB has been
installed.

While Stage 2 cannot generally be embedded in a fixed area as the
size is so large, Stage 1.5 can be installed into the area right
after an MBR, or the boot loader area of a ReiserFS or a FFS.


What is the MBR? (http://www.cheap56k.com/glossary/MBR.html)


If you want to do it by hand, we'll pretend your drive is setup like this:

mbr = /dev/hda
ntfs = /dev/hda1
/boot = /dev/hda2
/ = /dev/hda5


# grub
grub> root (hd0,1) (Specify where your /boot partition resides)
grub> setup (hd0) (Install GRUB in the MBR)
grub> quit (Exit the GRUB shell)


The following are helpful places to look if your not sure what you are talking about:

man grub
info grub
http://www.gnu.org/software/grub/

duralisis
15th April 2005, 04:07 PM
Thank you. I'll try that. Will it already have my XP install listed on there? Will I have to add it manually?

duralisis
15th April 2005, 04:10 PM
I have mine setup like this:

/dev/hda - grub in mbr?
/dev/hda1 - ntfs (xp)
/dev/hdb - fedora drive
/dev/hdb1 - /boot
/dev/hdb2 - LVM (/ and swap)

I'm going to try installing Grub from the rescue CD like suggested above, do I need to do anything different or follow the instructions you mentioned?

cybrjackle
15th April 2005, 04:26 PM
# grub
grub> root (hd1,0) (since fedora /boot is on /hdb)
grub> setup (hd0) (still the mbr of the first hd)
grub> quit

duralisis
15th April 2005, 04:42 PM
# grub
grub> root (hd1,0) (since fedora /boot is on /hdb)
grub> setup (hd0) (still the mbr of the first hd)
grub> quit


I tried using rescue mode and running "grub-install" on hda, but that gave me a "hdb1 does not have any corresponding bios drive" error message and wouldn't complete. So I found there's this long standing bug that causes grub-install to do that.

http://lists.gnu.org/archive/html/bug-grub/2003-02/msg00053.html

Anyway...

I followed cybrjackle's instructions and they worked flawlessly. It even shows my Windows XP item I created during the original FC4 install. So, anyone else with this problem, just jump into grub and follow the commands at the top of this post (replacing hd1,0 with your actual root partition).

BTW, if anyone has access to the maintainers and developers, could you see if they recognize this as a bug and maybe fix it before release? I didn't have the same problems with FC3.

SlowJet
15th April 2005, 05:05 PM
1.Grub is on hdb2.
2.You used Grub program from the rescue CD and issued a command called grub-install which wrote a stage 1 boot record to the mbr sector of hda.
3.This was done because:
i. Grub wrote the boot record to hdb during install (doesn't handle exiting disk mbr.
ii. Grub has a bug and wrote to mbr hdb anyway, even though a mbr was on the hda, and should have forward chained from that mbr.
4.You are re-installing the mbr and chaining the boot stages because Grub failed to do it correctly the first time.
5.It is now a backwards chain from hdb1 (boot) to hda ==> hda1 (WinXp)
6.Another install of, say, FC4-T2, on an LVM of Boot4, Swap4, Root4, Grub would overwrite the mbr on hdb.
7.Repeat all or some of above.
8.Backwards chain from FC4-T2, to FC-3, to WinXP.
9.Now, remove FC4-T2.
10.Grub chain is gone, nothing boots.
11.Repeat all or some above.


Explain the errors, if any, to me.

SJ

P. S. MAN pages for Grub FC3 is minimal, Info Grub is TOC only.

duralisis
15th April 2005, 06:17 PM
1.Grub is on hdb2.
2.You used Grub program from the rescue CD and issued a command called grub-install which wrote a stage 1 boot record to the mbr sector of hda.
3.This was done because:
i. Grub wrote the boot record to hdb during install (doesn't handle exiting disk mbr.
ii. Grub has a bug and wrote to mbr hdb anyway, even though a mbr was on the hda, and should have forward chained from that mbr.
4.You are re-installing the mbr and chaining the boot stages because Grub failed to do it correctly the first time.
5.It is now a backwards chain from hdb1 (boot) to hda ==> hda1 (WinXp)
6.Another install of, say, FC4-T2, on an LVM of Boot4, Swap4, Root4, Grub would overwrite the mbr on hdb.
7.Repeat all or some of above.
8.Backwards chain from FC4-T2, to FC-3, to WinXP.
9.Now, remove FC4-T2.
10.Grub chain is gone, nothing boots.
11.Repeat all or some above.


Explain the errors, if any, to me.

SJ

P. S. MAN pages for Grub FC3 is minimal, Info Grub is TOC only.

I can't because I don't understand most of that.

Anyhow, I did get it to work by reinstalling grub on hda from the grub command line. See a couple posts up for instructions. I still think there's a bug or misconfiguartion with T2's installer; this didn't happen for any previous release (FC3, FC2) on the same setup.

mickeyboy
19th April 2005, 01:18 AM
I now have a problem with being able to boot into Linux on FC4T2
but can't boot into WinXP how can I fix that..
Where do I find a kernel-module-NTFS for FC4 ?

Jim

duralisis
19th April 2005, 02:43 AM
If you can't boot into XP, I don't believe that a kernel module will help (other than mounting the partition for reading perhaps?). If your Grub boot loader is installed correctly, you should be able to add your OS as an entry to /etc/grub.conf, like this:

title Windows XP
rootnoverify (hd0,0)
chainloader +1

And remember, you can always use the kamikazee method and do a repair install of XP. That'll surely overwrite the MBR and get you back to your OS. Only problem is you have to "re-update" XP from whatever version was first installed (build 2600 or an OEM SP1 for example).

VP.
23rd April 2005, 04:27 AM
I'm having a similar problem where I can't boot into xp. When I go into the boot loader the XP option is there, and it shows that

rootnoverify
chainloader +1

thing but it seems to just hang there with a flashing cursor below it. Here's my fdisk...does this show what you need to know about the partition set up?


[root@localhost ~]# fdisk -l

Disk /dev/sda: 120.0 GB, 120033041920 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3824 30716248+ 83 Linux
/dev/sda2 3825 14592 86493960 f W95 Ext'd (LBA)
/dev/sda5 3825 11473 61440561 7 HPFS/NTFS
/dev/sda6 11474 14592 25053336 e W95 FAT16 (LBA)


Thanks for help!

steppewolf
23rd April 2005, 05:27 AM
reinstall grub!
please study firewing1's contents .that's the solution

cybrjackle
23rd April 2005, 05:41 PM
I'm having a similar problem where I can't boot into xp. When I go into the boot loader the XP option is there, and it shows that

rootnoverify
chainloader +1

thing but it seems to just hang there with a flashing cursor below it. Here's my fdisk...does this show what you need to know about the partition set up?


[root@localhost ~]# fdisk -l

Disk /dev/sda: 120.0 GB, 120033041920 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3824 30716248+ 83 Linux
/dev/sda2 3825 14592 86493960 f W95 Ext'd (LBA)
/dev/sda5 3825 11473 61440561 7 HPFS/NTFS
/dev/sda6 11474 14592 25053336 e W95 FAT16 (LBA)


Thanks for help!

The other problem your going to have is widows is nuts about being on the first partion. You need to drop winders on sda1 and linux on something afterwards.

VP.
23rd April 2005, 06:49 PM
I'm not sure I really understand his post, and his link appears to be down. I read this from another post is this what I should be doing:


If you want to do it by hand, we'll pretend your drive is setup like this:

mbr = /dev/hda
ntfs = /dev/hda1
/boot = /dev/hda2
/ = /dev/hda5


# grub
grub> root (hd0,1) (Specify where your /boot partition resides)
grub> setup (hd0) (Install GRUB in the MBR)
grub> quit (Exit the GRUB shell)



I don't really understand the syntax of the grub commands...for example it says /boot is on /dev/hda2 so then in grub you type root (hd0,1) for it? I don't understand that...

EDIT: Also as far as getting windows onto the first partition...I'm guessing there's no way to just move partitions around is there? Should I just forget this Fedora install and concentrate on getting XP into the first partition? I haven't done anything important that I need to keep in Fedora yet. I guess I need to figure out how to get into XP first but...

cybrjackle
24th April 2005, 04:47 PM
EDIT: Also as far as getting windows onto the first partition...I'm guessing there's no way to just move partitions around is there? Should I just forget this Fedora install and concentrate on getting XP into the first partition? I haven't done anything important that I need to keep in Fedora yet. I guess I need to figure out how to get into XP first but...

Yes, if you don't put windows on first, you will have nothing but problems.

VP.
24th April 2005, 06:50 PM
So what would be the best way to do this? Use an XP boot disc and format the linux partition from there? Is there a way to migrate my current c: drive to the first partition or will I need to completely reinstall windows?

EDIT: I've been trying to boot from my XP boot cd-rom and it just seems to skip past it. I changed boot priority to cd-rom then HD, and it just booted straight into fedora, then I disabled HD boot and it went into GRUB and then tried to boot XP but just hung on that chainload +1 prompt or whatever. This is messed up!

Dygear
24th April 2005, 11:06 PM
MBR --> NT bootloader with Linux as an option
hda1 --> DELL recovery partition, hidden
hda2 --> WinXP
hdb1 --> FAT32 WinXP/Linux share incase I need to restore a system, I put backups here.
hdb2 --> /boot, GRUB
hdb3 --> / (root partition)

Boot.ini :
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(1)partition(2)\Linux="Fedora Core 3"


That is one of doing it.