Fix broken Windows 7 boot loader

25
2014-04
  • murgatroid99

    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
    
  • Answers
  • murgatroid99

    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.

  • Tom Wijsman

    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.


  • Related Question

    Debian boot problem
  • Damir

    I have installed Slackware on /dev/sda6 and lilo at MBR, after that I installed Debian Squeeze beta2 on /dev/sda7 and grub at first section of /dev/sda7, I added at /etc/lilo.conf record for debian ( I was doing this with other versions of Debian and it worked ), but when I try to enter to Debain I got error message

    First sector of /dev/sda7 doesn't have a valid boot signature

    Can anybody help ?


    @Gilles fdisk -l

    Disk /dev/sda: 250.1 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00e20a72

    Device Boot Start End Blocks Id System /dev/sda1
    1 13 102400 7 HPFS/NTFS Partition 1 does not end on cylinder boundary. /dev/sda2
    13 5100 40861696 7 HPFS/NTFS /dev/sda3 5101
    30401 203222379+ 5 Extended /dev/sda5 5101 14826 78124063+ 7 HPFS/NTFS /dev/sda6
    14827 22699 63232000 83 Linux /dev/sda7 * 22699
    30009 58716160 83 Linux /dev/sda8 30009 30401 3147776 82 Linux swap


  • Related Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.