Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Grub won't boot Windows XP...


  • Please log in to reply

#16
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts

from post 1

GRUB was installed on the hard drive with Fedora on it, so I bypassed this by switching the primary boot disk to be the Windows drive. At this point I could boot straight into Windows, but I couldn't boot into Fedora.

Here is what I mean by this. At that time, I had the 100GB hard drive (the one with GRUB and Fedora on it) set in the BIOS to boot first. Every laptop has a way to change the boot device selection during POST (mine is by hitting F12). Then, I get a list of what should boot first. If I selected the 80GB drive to boot first, it would go straight to Windows without a GRUB menu selection. The only changes I made to the boot order was in the BIOS, and my assumption was that since I never saw the GRUB menu that it wasn't being used. This is what I meant by "switching the primary boot disk". Then a couple months ago, I wanted to use Fedora, so I decided to try repairing/restoring GRUB on the 100GB hard drive. After I did that, I got the GRUB menu selection again and I could boot into Fedora, but then I couldn't boot into Windows (see post #1).

from post 12

can you still boot windows without grub ?


No, I've never been able to do this.

I suppose that this is a little misleading. What I meant to say was I haven't been able to do this since I repaired GRUB a couple months ago.

do you mean you changed the boot order in grub ?

No. The only boot order I have changed is in BIOS. I have left the boot order of grub alone.

has windows got its bootloader in the mbr of its own drive ?

I assume that it did when I could boot into Windows, but at this point, I don't know. It's possible it could've been overwritten when I repaired GRUB. How would I check this?
  • 0

Advertisements


#17
hawklord

hawklord

    Member

  • Member
  • PipPipPip
  • 400 posts
ok,

if you disconnect/dissable your windows drive and repair grub on the fedora drive then you should be able to boot into fedora,

then you will need to fix your windows drive,
do you have your windows cd ?
  • 0

#18
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
OK. Disconnected the drive, but repairing GRUB doesn't work.

My fdisk -l output looks like this:

Disk /dev/sda: 100.0GB

Device	 Boot	Start   End	  Blocks   Id	System
/dev/sda1			  1   250	2008093+   82	Linux swap / Solaris
/dev/sda2	*	   251  2741   20008957+   83	Linux

Device map looks like this:

(hd0)	/dev/sda
(hd1)	/dev/sdb

Then, tried to repair GRUB by using the Fedora Live CD (rescue mode):

# chroot /mnt/sysimage
# grub-install /dev/hda
/dev/hda: Not found or not a block device.
# grub-install /dev/sda
/dev/sda: Not found or not a block device.

I tried going into the grub prompt as well:

# grub
grub> install /dev/hda

Error 12: Invalid device requested


I also heard that using the Super Grub disc may succeed when the Live CD fails, so I tried that. Every option I tried to select seemed to get stuck, and pressing any key wouldn't do anything, forcing me to do a hard reboot. Here are the results:

Choose Language & Help --> English Super Grub Disk --> Gnu/Linux --> Fix BOOT of Gnu/Linux:
selectfile /grub/stage1 /boot/grub/stage1   <~~~~~~STUCK!

Choose Language & Help --> English Super Grub Disk --> Boot & Tools:
selecthd <~~~~~~STUCK!

Choose Language & Help --> English Super Grub Disk --> Advanced --> GRUB --> any option
selecthd <~~~~~~STUCK!

GRUB => MBR & !LINUX! (1) AUTO:
findf /grub/stage1 /boot/grub/stage1 <~~~~~~STUCK!

GRUB => MBR & !LINUX! (>=2) MANUAL:
selectfile /grub/stage1 /boot/grub/stage1 <~~~~~~STUCK!

Keep in mind that this is all pretty new to me and I am trying to give you as much information as I can, but if you see me doing anything wrong (even if it's something trivial), let me know.
  • 0

#19
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
OK, with help from a friend, I plugged my other hard drive back in, got GRUB working, and can boot into Fedora again.

Here is how I did it:

1. Booted up Fedora Live CD 'rescue mode'

2. chroot into my Linux install
# chroot /mnt/sysimage

3. mounted proper filesystems
# mount /proc
# mount /sys

4. Doing 'grub-install' from here was giving me a "Not found or not a block device" error. So, I had to make them manually first and then do the grub-install.
# grub-install /dev/sda
/dev/sda Not found or not a block device 

# cat /proc/partitions
major   minor   blocks  name
X	   Y	   ......  sda
X1	  Y1	  ......  sda1
X2	  Y2	  ......  sdb
X3	  Y3	  ......  sdb1
X4	  Y4	  ......  sdb2

# mknod /dev/sda  b X Y
# mknod /dev/sda1 b X1 Y1
# mknod /dev/sdb  b X2 Y2
# mknod /dev/sdb1 b X3 Y3
# mknod /dev/sdb2 b X4 Y4

# grub-install /dev/sda
Installation finished.  no error reported
....
....
....

So, GRUB works again and Fedora boots. But, I am back to my original problem. When I try to boot Windows from GRUB, I get an "Error 18".

Edited by UV_Power, 03 September 2009 - 06:52 AM.

  • 0

#20
hawklord

hawklord

    Member

  • Member
  • PipPipPip
  • 400 posts
ok, give me the output of

fdisk -l

and

cat /proc/partitions

with both drives connected

will windows boot using the F12 option ?
  • 0

#21
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
With both drives connected, fdisk -l gives me the same output as in my original post, which is:

Disk dev/sda: 80.0GB ...
...
...
...

Device	 Boot   Start End Blocks Id	 System
/dev/sda1   *	 ...................	 HPFS/NTFS

Disk dev/sdb: 100.0GB ...
...
...
...

Device	 Boot   Start End Blocks Id	 System
/dev/sdb1		 ...................	 Linux swap / Solaris
/dev/sdb2   *	 ...................	 Linux
cat /proc/partitions gives me this:

major	minor	 #blocks   name

7		0		  113320   loop0
8		0		78150744   sda
8		1		78140128   sda1
8		16	   97685784   sdb
8		17		2008093   sdb1
8		18	   20008957   sdb2

When I use F12 to boot the Windows Drive, I get the GRUB menu now. When I select "Fedora", it boots up Fedora just fine. When I select "Windows XP", it just says Error 18.

Edited by UV_Power, 03 September 2009 - 06:53 AM.

  • 0

#22
hawklord

hawklord

    Member

  • Member
  • PipPipPip
  • 400 posts
ok, now i need the contents of your grub menu.conf,

which is your main operating system ?

do you have ntfs-3g installed in fedora ?

do you know how to use partimage ?
  • 0

#23
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
grub.conf hasn't changed much (just the stuff under "Windows XP")

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#		  all kernel and initrd paths are relative to /, eg.
#		  root (hd1,1)
#		  kernel /boot/vmlinuz-version ro root=/dev/sdb2
#		  initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=15
splashimage=(hd1,1)/boot/grub/splash.xpm.gz
title Fedora 10
	root (hd1,1)
	kernel /boot/vmlinuz-2.6.27.30-170.2.82.fc10.i686 ro root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rhgb quiet selinux=0
	initrd /boot/initrd-2.6.27.30-170.2.82.fc10.i686.img
title Windows XP
	root (hd1,0)
	rootnoverify (hd0,0)
	chainloader +1

which is your main operating system ?

Fedora. I just have Windows for MS software development (.NET/XNA, mostly)

do you have ntfs-3g installed in fedora ?

Yes.

do you know how to use partimage ?

No.
  • 0

#24
hawklord

hawklord

    Member

  • Member
  • PipPipPip
  • 400 posts
you can use partimage to back up and restore your full fedora system - even transfer the image to a new drive and have a full working copy, this includes all settings,
it will only copy used portions of the disk, so the image isn't that big,
i have a 9gb / (hda1) partition which copies at just under 1gb
(i use partimage in knoppix for this)

ok, try adding this to the end of your menu.conf

title Win xp
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

  • 0

#25
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
I am actually away from my laptop for the next 24 hours...

I will let you know how it turns out when I get a chance.
  • 0

Advertisements


#26
UV_Power

UV_Power

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 391 posts
Everything seemed to point to a bad boot sector and corrupted boot record. I didn't think that adding extra mappings to grub.conf would help.

I decided to try using the Windows Recovery Console. At the command prompt, I used 'fixboot' and 'fixmbr' (in that order) and, as a result, I was able to boot into Windows just fine. This process overwrote GRUB so I followed the steps from my previous post to install GRUB on my Windows hard drive.

Now, everything is back to the way it should be. I get a GRUB menu selection, and both Fedora and Windows booting normally.

Thank you, hawklord, for all your help. I really appreciate it. :)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP