Solved

Need to restore grub for a windows partition

Posted on 2010-09-02
14
1,262 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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
 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pervasive SQL Error 4 28
windows tablets 1 37
Open Encryption Software Advice needed 4 51
PDFCreator and PrimoPDF both fail to install 11 15
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

808 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