Solved

Need to restore grub for a windows partition

Posted on 2010-09-02
14
1,256 Views
Last Modified: 2013-12-01
I had a system set up for dualboot (Windows - ubuntu) and then I removed the ubuntu partition and now my grub is hosed (error 22 on boot). I'm trying to restore grub for the windows partition using supergrub but I want to make sure I'm selecting the correct options.

I verified that I can still boot into the windows partition through supergrub 2 (booted into off of a usb stick) by selecting the following options:

1) Detect any OS

2) Windows Vista bootmgr

But now I want to permanently fix the boot partition on the hard drive.

0
Comment
Question by:opike
  • 8
  • 5
14 Comments
 

Author Comment

by:opike
Comment Utility
When I select:

"Detect any GRUB2 configuration file (grub.cfg)"

from the grub 2 menu, I get the error message:

"Error: Could not find any grub.cfg files."

When I select:

"Detect any GRUB2 installation (even if mbr is overwritten)"

I get the error message:

"Error: Could not find any core.img files"
0
 
LVL 18

Expert Comment

by:TobiasHolm
Comment Utility
Hi!

If you only want Windows Vista on your machine you might boot on the Vista installation DVD and select "Repair" to repair the boot. Then you'll lose Grub, but you don't need Grub if you're only gonna use Vista.

Regards, Tobias
0
 
LVL 18

Accepted Solution

by:
TobiasHolm earned 500 total points
Comment Utility
And the same is true if you're using Windows 7.  Boot on the Win7 installation DVD and select "Repair" to repair the boot.

Regards, Tobias
0
 
LVL 18

Expert Comment

by:TobiasHolm
Comment Utility
If you don't have a Windows installation DVD and want to fix the MBR you can use FixMbr: http://www.sysint.no/nedlasting/mbrfix.htm

Download: http://www.sysint.no/products/Download/tabid/536/language/en-US/Default.aspx (scroll down a bit on the page)

Regards, Tobias
0
 
LVL 18

Expert Comment

by:TobiasHolm
Comment Utility
You could try Ultimate Boot CD for Windows ( http://www.ubcd4win.com/downloads.htm ) too, it has MbrFix (I reversed the name above, ignore that ;) and a tool for "Vista Recovery Console" (if you're running Vista).

Regards, Tobias
0
 

Author Comment

by:opike
Comment Utility
I tried running the "Startup Repair" from the windows 7 install dvd and I get the message

"Startup Repair cound not detect a problem"

Ïf you have recently attached a device to this computer, such as a camera or portable music player, remove it and restart your computer. If you continue to see this message, contact your system administrator or computer manufacturer for assistance"

I don't have any external items connected to the machine.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:opike
Comment Utility
I think windows is struggling to repair the boot process because there are 2 paritions, a boot partition (presumably with grub installed) and then the windows partition.
0
 
LVL 18

Expert Comment

by:TobiasHolm
Comment Utility
ok. Do you still see the Grub menu when you boot your machine? Then try to write a "clean" MBR with the MbrFix tool I linked to above. Then Grub won't pop up trying to boot and fail due to the lack of the Linux partition.

Regards, Tobias
0
 

Author Comment

by:opike
Comment Utility
Is this the mbrfix command I should run?

 MbrFix /drive <num> fixmbr {/vista|/win7}
0
 

Author Comment

by:opike
Comment Utility
Here's a list of the partitions:

C:\Users\ollie\Downloads>mbrfix64 /drive 0 listpartitions
# Boot Size (MB) Type
1 Yes     16384   39  Unknown
2           200    7  NTFS or HPFS
3        460355    7  NTFS or HPFS
4             0    0  None
0
 

Author Comment

by:opike
Comment Utility
I tried to issue a fixbootsector command on partition 1:

C:\Users\ollie\Downloads>mbrfix64 /drive 0 /partition 1 fixbootsector /win7
You are about to Fix boot sector,
are you sure (Y/N)? y
Invalid OS version specified
Function failed. Error 10: The environment is incorrect.
0
 

Author Comment

by:opike
Comment Utility
I just fixed the problem.

I went back to the "repair" option off of the windows 7 installation dvd, but I then had to do the following:

Go into the command shell and enter the command:
bootsect /nt60 C:

After this I was able to successfully remove grub and boot directly into windows 7.
0
 

Author Comment

by:opike
Comment Utility
Please reopen this question. The points did not get assigned the way I wanted.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now