You are not logged in.

#1 2010-03-01 01:13:04

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

[Solved] Grub fails to load Windows, stuck on "Grub loading stage2"

When I try to boot Windows from GRUB, I see:

...
makeactive
chainloader +1

Grub loading stage2

and that's is, it just hangs there.  Linux itself boots fine, both the regular and fallback kernel.  I think this might be caused by accidentally installing Grub to the Windows partition 'setup (hd0,0).   This sounds like a thing that 'fixmbr' might fix from a Windows disk but unfortunately I don't have one.   I have tried to restore the Windows boot record with ms-sys (link) but with no luck.  Any ideas?

Last edited by Gen2ly (2010-03-05 00:46:26)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#2 2010-03-01 06:07:05

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: [Solved] Grub fails to load Windows, stuck on "Grub loading stage2"

Post your full grub config and also the partition layout. You should've setup grub on (hd0) I think, check the wiki.
Also there's a chance your Windows XP died for no reason. Happened to me once, the only solution was to reinsall windows, as fixboot and fixmbr didn't do anything.


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#3 2010-03-01 07:51:19

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [Solved] Grub fails to load Windows, stuck on "Grub loading stage2"

This turned out to be a long journey that started here and ending happily.  Basically the story started when I decided to add a partition for swap between the Windows and Arch partition, and Dolphin didn't recognize the Windows partition anymore, and from there on it got a bit scary.  I'll go over the steps I did here that was just tinkering but hopefully some people can help me figure out how this worked and posibly a better way to do it.

Steps I did:

1) Partitioned.  Put swap partition in between Windows and Arch, fixed menu.lst.
2) Rebooted, no boot because re-partitioning as such effects Grub.
3) Reinstalled Grub but first accidentally installed GRUB to Windows partition.
4) Rebooted, near 100% sure I saw 'Windows' partition in Dolphin (ghost effect?)
5) Partition order changed, used LiveCD to fix.  Fdisk reports swap as sda3.  Used LiveCD and fdisk to fix: fdisk /dev/sda, x, f
6) Reboot, disk order fixed, Windows partition disappears in Dolphin, 'mount' partition unsuccessful.
7) ms-sys -p /dev/sda1, and ms-sys -m /dev/sda to reinstall Windows standard MBR, re-install Grub... again.  No luck Windows partition still a no show.
8) Used TestDisk to repair Window partition boot sector:

      No log
      Choose Disk > Proceed
      Intel
      Advanced
      Select partition > Boot
      Rebuild BS > Write

9) Window partition viewable again in Dolphin, but XP will not boot.
10) Rebuilt BS with XP Recovery Console and 'fixboot' command which restores the boot sector with instructions to boot NTLDR (boot loader up until XP).
11) Success!

Glad this worked, but was hoping to get some explanation of it.  From what I've found out, installing Grub to the Windows partition is primarily to blame here.  What I know is that Grub writes a bit of code (that is the stage1) to the boot sector of the Windows partition when this occurs, and removes reference to the Window bootloader.  TestDisk rebuilds BS but must not put mention of NTLDR in there, but amazingly 'ntfs-3g'(?) must look for something in the boot sector... hmmm.  Lastly, I'm not sure why fdisk made the Windows partition to disappear, what would it have to do the the boot sector?  I'd be more likely to put this on Dolphin, but not really sure what to think of it.

Has anyone else done this before?  How did you fix it?  Any thoughts about what happened?

Last edited by Gen2ly (2010-03-06 18:44:43)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#4 2010-03-05 00:45:19

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [Solved] Grub fails to load Windows, stuck on "Grub loading stage2"

Ok, got it figured out and this is a problem related only to installing GRUB to my Windows partition.  When GRUB is installed it installs a small piece of code (that is the stage1) onto the boot sector of the partition.  The boot sector on the Windows partition points to the file NTLDR (the bootloader for XP and pre-os's).  TestDisk worked because it fixed the boot sector enough to be recognized but doesn't add information to point to the bootloader.  The only way I found to fix this was to use a Windows Recovery Console and run the 'fixboot' program and all is well again.  Put it up on the wiki for further use:

[wiki]GRUB#Accidental_install_to_a_Windows_partition[/wiki]

Last edited by Gen2ly (2010-03-05 00:49:14)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

Board footer

Powered by FluxBB