2

I have a computer that dual boots Windows 7 and Ubuntu through GRUB. Recently Windows failed to boot, and after trying various things to fix it, now when I choose Windows 7 in the GRUB menu, I get the message

error: no such device: 9A7AC1417AC11B41
error: hd2 cannot get C/H/S values
Press any key to continue...

and when I press a key it brings me back to the GRUB menu. The message appears in the same style (colors and font) as the GRUB loader.

I have noticed that windows uses two partitions, one called RECOVERY (16 GB) and one called OS (517 GB) and that the GRUB loader points to RECOVERY but Windows is on the OS partition. I can mount both partitions in Linux and the OS disk seems to have the right files. I used the Windows 7 recovery disk and the automated repair thing no longer finds any errors.

How can I fix this an make Windows boot up again?

fdisk -l outputs

Disk /dev/mapper/isw_bdhfaghdfb_dell: 640.1 GB, 640141230080 bytes
255 heads, 63 sectors/track, 77826 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
Disk identifier: 0x2dbec2f5

                          Device Boot      Start         End      Blocks   Id  System
/dev/mapper/isw_bdhfaghdfb_dell1               1           5       40131   de  Dell Utility
Partition 1 does not start on physical sector boundary.
/dev/mapper/isw_bdhfaghdfb_dell2   *           6        1918    15360000    7  HPFS/NTFS
Partition 2 does not start on physical sector boundary.
/dev/mapper/isw_bdhfaghdfb_dell3            1918       64772   504878877+   7  HPFS/NTFS
Partition 3 does not start on physical sector boundary.
/dev/mapper/isw_bdhfaghdfb_dell4           64772       77827   104858625    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/mapper/isw_bdhfaghdfb_dell5           77578       77827     2000128   82  Linux swap / Solaris
/dev/mapper/isw_bdhfaghdfb_dell6           64772       67204    19531008   83  Linux
/dev/mapper/isw_bdhfaghdfb_dell7           67204       74498    58593536   83  Linux
/dev/mapper/isw_bdhfaghdfb_dell8           74498       77577    24731648   83  Linux
4
  • Please update your answer with the output of fdisk -l and the content of /etc/grub.conf, both from Ubuntu.
    – Bibhas
    Feb 11, 2012 at 20:13
  • @Bibhas /etc/grub.conf does not exist on my computer. Where else can I find it? Feb 11, 2012 at 20:19
  • Sorry, that was for Fedora. Is it GRUB2? then check /boot/grub/grub.cfg.
    – Bibhas
    Feb 11, 2012 at 20:22
  • @Bibhas that file looks really long, and it's all of the files in /etc/grub.d concatenated together. Are you sure that's the right one? Feb 11, 2012 at 20:25

3 Answers 3

2

Boot from the Windows Installation DVD or Windows Recovery CD. Open the recovery console and enter the following commands

bootrec /fixmbr
bootrec /fixboot

in that order.

5
  • "boot from the windows DVD" you need to be more specific than this Feb 11, 2012 at 20:51
  • @SimonSheehan What part did you not understand?
    – kinokijuf
    Feb 11, 2012 at 20:55
  • 3
    Not everyone will know this - could you expand your answer to include where your supposed to type these commands? Feb 11, 2012 at 20:56
  • As my edit (which looks like Community's) says, my computer now does not boot into grub at all, so I cannot access either of my operating systems Feb 11, 2012 at 23:59
  • It looks like, after I restored GRUB, these commands successfully got rid of the error message. Feb 13, 2012 at 5:44
0

You may want to try http://www.supergrubdisk.org/. You could burn Rescutux to disc and boot it. It has several options for restoring grub. If this doesn't work, I'd recommend you burn a copy of Ubuntu Live disc or whatever distro you prefer, mount your Ubuntu partition, and reinstall grub. You should check /boot/grub/menu.list. This is where your partitions are defined at. Make sure Windows 7 is pointing to the right one. Reinstall Grub or using Rescutux may automatically resolve this for you though. Here's what they recommend in general

1) Boot off the LiveCD
2) run the following commands

3) find /boot/grub/stage1
4) if that doesn't return any output...then
5) find /boot/grub/stage2
6) sudo grub

   > root (hd0,0) # this will vary depending on the output from find

   > setup (hd0) # this should match the value used in the previous command hdx. hd0 is this case

   > exit

Check the thread here for more info.

This thread happens to be talking about Windows overwriting the MBR...but still provides a very general solution. Grub will typically kick back an error code. If you can get that then that's helpful as well. I've experienced a few of them like 22 15, and 17.

You should be good using a combination of the 5 links I provided. They all pretty much recommend the same solution which I spelled out in steps 1-6. The link for Grub error 17 is probably the most straight forward to follow. At least you've got options.

6
  • Rescatux cannot mount my filesystem because it does not recognize my RAID array, but I can still get to the grub loader using the Super Grub Disk that comes with it. However, this does not fix my original problem with Windows not booting. Feb 12, 2012 at 16:49
  • Yea...you'll have to be able to reinstall your grub or modify menu.list. This probably can't happen unless you can mount your primary drive. Feb 18, 2012 at 7:03
  • When I say this does not fix my original problem, I mean that in my question grub was working and my problem was booting into Windows from grub, but this answer describes restoring a damaged grub loader. Feb 18, 2012 at 7:13
  • What's are the contents of /boot/grub/menu.list? There should be an entry for Windows. Have you verified that it is pointing to the right device (disc and partition)? Feb 19, 2012 at 0:35
  • I also assumed that if you reinstalled ur grub that it would auto correct any invalid entries/configuration..this seemed to have worked for me in the past. Feb 19, 2012 at 0:39
0

If you want to use the Windows Boot manager, this is what I did to restore Windows 7:

  1. Put the Windows Vista or Windows 7 media in the DVD drive, and then start the computer.
  2. Press a key when you are prompted.
  3. Select a language, a time, a currency, a keyboard, or an input method, and then click Next.
  4. Click Repair your computer.
  5. Select the operating system that you want to repair, and then click Next.
  6. In the System Recovery Options dialog box, click Command Prompt.
  7. Type Bootrec.exe /fixmbr, and then press Enter.
  8. Type Bootrec.exe /fixboot, and then press Enter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .