Solved

Need to restore grub for a windows partition

Posted on 2010-09-02
14
1,258 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
ID: 33587987
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
ID: 33588736
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
ID: 33588794
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
ID: 33588861
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
ID: 33589030
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
ID: 33589614
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:opike
ID: 33590102
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
ID: 33591592
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
ID: 33593398
Is this the mbrfix command I should run?

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

Author Comment

by:opike
ID: 33593414
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
ID: 33593417
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
ID: 33593560
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
ID: 33593575
Please reopen this question. The points did not get assigned the way I wanted.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

896 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

15 Experts available now in Live!

Get 1:1 Help Now