Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was using Win8 and installed Ubuntu 12.10... There is an entry in GRUB for W8, but when selecting it - GRUB comes back again, so Windows never boot up. I can only launch my Ubuntu.

/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   123086847    61440000    7  HPFS/NTFS/exFAT
/dev/sda3       123086848   586145789   231529471    7  HPFS/NTFS/exFAT
/dev/sda4       586145790   976771071   195312641    5  Rozszerzona
/dev/sda5       586145792   761929727    87891968   83  Linux
/dev/sda6       761931776   976771071   107419648   83  Linux

sda2 is Windows 8 partition, sda1 is Windows swap (or whatever it names). In GRUB Customizer entry for W8 look like that:

insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  A456A29B56A26DAC
else
  search --no-floppy --fs-uuid --set=root A456A29B56A26DAC
fi
drivemap -s (hd0) ${root}
chainloader +1

sudo update-grub didn't help me :/

The A456A29B56A26DAC is Windows boot (sda1), Windows (sda2) is 0CDA0065DA004D80

Result from bootinfoscript: http://pastebin.com/bVc9Ziq0 show that Grub has overwritten the Windows 8 boot partition boot sector:

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Grub2 (v1.99)
    Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda1
                       and looks at sector 667401296 of the same hard drive
                       for core.img. core.img is at this location and looks
                       in partition 72 for . No errors found in the Boot
                       Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD

Is there an easy way to fix it and make Windows bootable without reinstalling?...

share|improve this question
    
Please run the bootinfoscript and add a link to the results: bootinfoscript.sourceforge.net –  bcbc Mar 3 '13 at 23:53
    
There is result from bootinfoscript: pastebin.com/bVc9Ziq0 –  Szorstki Mar 4 '13 at 11:18

2 Answers 2

up vote 3 down vote accepted

Somehow Grub has overwritten your Windows boot sector on your Windows 8 boot partition /dev/sda1. You will need to repair it in order to boot Windows again. And then don't use your custom Windows 8 grub entry (that is pointing at /dev/sda2) - the default on /dev/sda1 is required.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Grub2 (v1.99)
    Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda1
                       and looks at sector 667401296 of the same hard drive
                       for core.img. core.img is at this location and looks
                       in partition 72 for . No errors found in the Boot
                       Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD

You can repair in one of two ways:

  1. Boot a Windows repair CD to a repair prompt and for Windows Vista/7/8 run: bootrec /fixboot and for Windows XP run fixboot
  2. Recover the backup boot sector using testdisk. The beauty of this solution is that you can do it from Ubuntu. Reference here.

Instructions for using testdisk

First install and run testdisk:

sudo apt-get install testdisk
sudo testdisk

Then follow instructions for each screen in testdisk:

First   screen:  Select "No Log" and press enter.
Second  screen:  Select /dev/sda - the hard drive containing the Windows system partition and  choose "proceed".
Third   screen:  "intel"
Fourth  screen:  "advanced",
Fifth   screen:  Select /dev/sda1 - the Windows system partition and choose "boot"
Sixth   screen:  "BackupBS"
Seventh screen:  type "Y" to confirm

Please also refer to this bug report and click "This bug affects me" so that Grub can be fixed.

If grub is only in the Windows boot sector, i.e. the Windows bootloader is still in the Drive MBR, then it's best to boot Ubuntu and install Grub to the MBR before fixing the Windows bootsector. e.g. sudo grub-install /dev/sda (adjust to the correct drive if not /dev/sda).

If you don't do this, after repairing the Windows boot sector, only Windows will boot, and you will need to install the Grub bootloader to the disk MBR in order to boot Ubuntu. Or you could use something like easyBCD. But to use grub, boot an Ubuntu live CD/USB (same release is best) and run (assuming your Ubuntu install is on /dev/sda5):

sudo mount /dev/sda5 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda

Then reboot.

share|improve this answer
    
Thanks - it helped (win8 starts) but now Grub disappeared. It's probably not a bug but my mistake (selecting wrong partition for Grub or smth). On which partition Grub should be installed? –  Szorstki Mar 6 '13 at 20:10
    
I added how to install the grub bootloader at the bottom of my answer. This will install Grub to the drive MBR, not any partition. PS it is a bug, because Grub is supposed to recognize NTFS partitions and not allow installing to them. –  bcbc Mar 6 '13 at 21:49
    
Thanks a lot - I don't have enough reputation to click "^", so... just a simple thank you :) –  Szorstki Mar 7 '13 at 23:29
    
You're welcome! Don't worry about the "^" although it should work for you since you asked the question. Try the tick mark instead. –  bcbc Mar 7 '13 at 23:32

Fix the bootsector of your sda1 partition this way: https://help.ubuntu.com/community/BootSectorFix

share|improve this answer
    
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Eliah Kagan Mar 20 '13 at 5:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.