Ubuntu – Can’t boot into Windows 7 EFI GPT after recovery operation


My question, or rather issue, is in the extent of this previous case in which I wanted to grow my Linux (ext4) partition. The partition /dev/sda6 was in the way of doing this and since it contained bios_grub I didn't touch it until someone with expert knowledge could help me.

enter image description here
As suggested by the helper I deleted the highlighted partition /dev/sda6

Step 2
All seemed well

The partition was successfully removed so I went on to step 3, merging /dev/sda7 (the ext4 containing everything Ubuntu) with the unallocated partition to grow my Linux partition.

enter image description here
Everything still seemed to be going the right way

So everything went well. The helper suggested to turn swappoff on /sda8 during the process, so I did.
Gparted kept on merging the two partitions, which I think was a good thing, as well as refreshing itself to find all the partitions after turning swapoff.

When GParted finally refreshed, the program just stopped and shut itself down while it was still in the middle of growing /dev/sda7.

I restarted GParted to find this:
enter image description here
Mini heart attack

Now I'm running sudo testdisk from Ubuntu live DVD session, performing a deeper search on the hard drive. I did this yesterday allready, but I realized fixing this was a little, if not way over my head. So please, if you have the time (but especially the knowledge to help me with this (preferably in real time through chat or anything)), help me liberate myself from this torment…

EDIT: 'new' information:

enter image description here

enter image description here
Extra information if needed


enter image description here
enter image description here
enter image description here
TestDisk results

Output of fdisk in terminal:

ubuntu@ubuntu:~$ sudo fdisk -l /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0fb2bbaa

Disk /dev/sda doesn't contain a valid partition table

Output of gdisk in terminal:

ubuntu@ubuntu:~$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.1

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: not present
  BSD: not present
  APM: not present
  GPT: damaged

Found invalid MBR and corrupt GPT. What do you want to do? (Using the
GPT MAY permit recovery of GPT data.)
 1 - Use current GPT
 2 - Create blank GPT

Your answer:  

I answered with 1
enter image description here

And TestDisk gave me these results:
enter image description here

After further exploration, TestDisk (while selecting my hard disk as gpt efi) showed that ALL of my files on partitions [OS], [DATA] and [RECOVERY] where perfectly in tact. The unlabeled partitions are respectively 2 Linux partitions containing data (a lot of it is damaged, but thats not the upmost priority at the moment) and one SWAP partition.

At the moment I am copying the whole hard disk to an external hard disk to prepare for any probable error when fiddling with TestDisk to try and recover the system.

EDIT 13 Februari 2014:
At the moment my setup looks like this. I have some confusion over my hard disk, was it MBR or GPT to begin with? Anyway, some last steps to be taken care of, I hope someone can help me! Ubuntu is booting from GRUB and/or rEFInd but Windows 7 just doesn't boot.
current situation
I tried with every boot repair option I could find (about windows 7) but untill now everything has failed.
– Boot with Windows 7 boot repair cd and enter Command Prompt environment
– I tried the commands: bootrec /fixmbr, bootrec /fixboot, bootrec /rebuildbcd, and rebooted, but it fixed nothing
– So I tried the "nuclear method" by using the commands: bootsect /nt60 c: /force /mbr, bcdboot c:\windows /s c:
– boot-repair-disk (linux lubuntu) didn't help me either, I tried common repair and advanced repair.
Above steps didn't work for me.
sda4 is the partition containing the Windows OS

Best Answer

Try option 1 in gdisk and see what it says (type p to view your partitions). gdisk holds data in memory until you write, so using this option to view the partitions is fairly risk-free; only if you type w to save your changes will you put anything at risk. If you're lucky, gdisk will be able to recover valid partition data. See this page (part of the gdisk documentation) for more on repairing GPT disks.

If gdisk doesn't work or if some of the partitions it recovers are invalid, you may need to use TestDisk.

Edit: It's PROBABLY OK to accept the partitions that gdisk has recovered. It appears that those partitions are from after your partition-resizing operation. With the exception of /dev/sda7, which you resized, the gdisk output matches that shown in your second screen shot. (One important caveat: gdisk shows start and stop points precisely, but GParted doesn't.) Given your description, it sounds as if the resize operation succeeded, so chances are /dev/sda7 will work when recovered. If not, you can delete it without touching the other partitions and then use TestDisk to try to recover the filesystem that /dev/sda7 should contain.

Note that there can be NO GUARANTEES about any of this. In a worst-case scenario, though, you can wipe the recovered partition table and start again; you would then be no worse off than you are now.

Related Question