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 have a system with both Windows and Linux. In the last 3 years I have switched between openSUSE and Ubuntu, and two days ago I decided to install Ubuntu.

When I was done it was quite laggy, and in frustration I tried to reinstall. Somehow, something went wrong and Ubuntu quit the installation. I tried openSUSE, but for an odd reason openSUSE got a lot of errors regarding my Windows partition.

I decided to download the newest 64-bit version of Ubuntu on my brothers PC and burn the CD there. Now installation and everything went good, but when I restarted GRUB wasn't loading at all. After some tweaking I got GRUB up and running, but Windows wasn't visible. But all my stuff and the Windows files are visible and accessible in Nautilus & Dolphin, so it is there.

After some reading on the web, I'm pretty sure that my problem is that GRUB is installed in the Windows partition.

Here's my settings: Linux sda1 - windows sda2 - swap sda5

What to do?

share|improve this question
add comment

2 Answers

Have you tried running sudo update-grub in terminal and see if grub can boot Windows partition?

share|improve this answer
    
I have tried that, but it doesn't seem to detect my Windows by some reason... –  Fredrik Aug 5 '12 at 12:00
add comment

I recently had the same problem with Fedora 17. The fundamental problem seems to be there are now several ways grub can be installed, and several different hardware modes a bios can boot-up in. My first attempt to put Fedora 17 on, everytime I would go to install, the Fedora installer would complain I needed a gpt partition. I read the solution to this was to run the following on the command line:

$ su -
# gedit /dev/sda
w

Sure enough, that solved the install problem. But then after that grub2 could not find my windows partition. I tried everything, until I finially discovered what the installer did was create a /boot/efi directory where it installed grub (not grub2), so editing grub2 menus are useless. At this point I probably could have just edited the config file in the /boot/efi directory, but before doing that I tried installing grub2-efi and then running grub2-install again. That resulted in a system that would not boot at all.

At this point, even the live dvd would only boot in UEFI mode. I proceeded with the Fedora install again. When I was done I had a grub 2 install that could boot Fedora, find Windows, but it could not boot Windows. It seems once grub2 is started in UEFI mode that you cannot boot a non UEFI operating system. So I tried the Windows repair disk, and then the recovery disk. Both complained they were for the wrong version of Windows. Even an attempt to reinstall windows in UEFI mode failed, as I could not find a driver for gpt...

So I finally decided to try and restore things back to there original state. I manually deleted the gpt partion, using fdisk and restored the MBR partion table. Still I could not boot windows, as grub was in my MBR and there was nolonger a grub partition. I tried a windows repair. This time it detected it was the right windows version, and it attempted to repair the booting, but windows still would not boot, just grub.

At however, I found I could boot the Fedora 17 live dvd again in non-UEFI mode. So I did that, and ran the install for a third time. I was expecting it to repeat the original error messages and end-up with a EFI install again. However, instead somehow it managed to install without errors. Grub2 is now my boot manager, and Windows boots correctly. The one odd thing is I now gave both a MBR and an GPT partition table. With no gpt partition. While strange, this seems to work. If I were to start from scratch again, I would just manually build both tables, as that seems to work in the desired way.

Here is the actual partitioning I ended-up with in the end:

[root@docbill-PC ~]# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.2

Caution: invalid main GPT header, but valid backup; regenerating main header

from backup!

Caution! After loading partitions, the CRC doesn't check out!

Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan: 
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 1

Command (? for help): print
Disk /dev/sda: 250069680 sectors, 119.2 GiB
Logical sector size: 512 bytes

Disk identifier (GUID): B3845F17-774A-40EE-A48D-6A7841D4E965 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 250069646 Partitions will be aligned on 2048-sector boundaries Total free space is 4717 sectors (2.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   0700  Microsoft basic data
   2          206848       209922047   100.0 GiB   0700  Microsoft basic data
   3       209922048       210946047   500.0 MiB   8300  Linux filesystem
   5       210948096       250068991   18.7 GiB    8E00  Linux LVM

Command (? for help): quit
[root@docbill-PC ~]# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.2

Caution: invalid main GPT header, but valid backup; regenerating main header

from backup!

Caution! After loading partitions, the CRC doesn't check out!

Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: damaged

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT

Your answer: 2

Command (? for help): print
Disk /dev/sda: 250069680 sectors, 119.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 85E271CD-1847-4203-9D2E-0CA970720FDC
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   0700  Microsoft basic data
   2          206848       209922047   100.0 GiB   0700  Microsoft basic data
   3       209922048       210331647   200.0 MiB   EF00  EFI System Partition
   4       210331648       210333695   1024.0 KiB  EF02  
   5       210333696       211357695   500.0 MiB   0700  
   6       211357696       250068991   18.5 GiB    8E00  

Command (? for help): quit

Note: It looks like if you actually edit the gpt partition with gdisk it will replace the MBR partition, and which point you need to rebuild with fdisk too keep everything working correctly.

share|improve this answer
add comment

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.