Can't boot into Windows 7 EFI GPT after recovery operation

5,713

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.

Share:
5,713

Related videos on Youtube

Nkciy84
Author by

Nkciy84

Computer and gadget loving cook.

Updated on September 18, 2022

Comments

  • Nkciy84
    Nkciy84 over 1 year

    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

    EDIT:

    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
    ubuntu@ubuntu:~$
    

    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

    • Admin
      Admin over 10 years
      You should not change a partition that is currently in use. Also, you may want to backup your partition table before you do anything with it, so that you can easily restore it in case something odd happens.
    • Admin
      Admin over 10 years
      It is very difficult to advise something after things have been messed up. It looks to me that the partition table has been deleted. All the data would still be there, if you can recreate the partition table exactly as it was. Those are the reasons why experts insist on not only backup but also restoration strategies. I would re-install and restore the system for the backups. That is usually the cleanest way to do it. I don't say another way is impossible, but it probably takes a lot longer if you do not have a backup of the partition table.
    • Admin
      Admin over 10 years
      If you are lucky, the partition table still exists on the disk and has only been changed in the buffer. In that case, but only if this is true, switching off the computer and starting it again would bring it back to the old status. However, there is no guarantee that this is the case. It has worked for me in the past, but at times it has not. Therefore, backup as much as you can, as long as you can do it and hope for the best
    • Admin
      Admin over 10 years
      Yes, thanks, allthough actions I might take in the future will not help me now. I rebooted the computer allready. The bios is working but there is no entry for booting windows or linux. I have added some screenshots of TestDisk to have the situation make more sens
    • Admin
      Admin over 10 years
      Whow, I managed to recover everything (all the windows and ubuntu files, the windows recovery partition and everything Ubuntu. The only thing missing is the ability to boot Windows (and the recovery partition of windows), though. If I could only get that last part fixed everything would be peachy again!
    • Admin
      Admin over 10 years
      Your disk has GPT partition table.Is that Windows 7 on sda4 partition.?
    • Admin
      Admin over 10 years
      Yes , sda4 is the windows partition
    • Admin
      Admin over 10 years
      recommended boot-repair doesn't work for you.You have to give the partition where efi boot files are located while running boot-repair.It was on the advanced option.
    • Admin
      Admin over 10 years
      i mean linux boot-repair.see help.ubuntu.com/community/…
    • Admin
      Admin over 10 years
      Are you booting Boot-Repair in UEFI mode, not BIOS? Post link to BootInfo report so we can see details. But grub only boots working Windows, and Boot-Repair only can do minor fixes to Windows, so Windows repairs may be required. Also some UEFI only boot Windows, so in UEFI mode can you boot ubuntu entry in UEFI?
    • Admin
      Admin over 10 years
      The URL from boot-repair-disk is here paste.ubuntu.com/6927462 (I launched using oprom legacy/uefi)
    • Admin
      Admin over 10 years
      what was the output of [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"? If it is EFI then follow Converting Ubuntu into EFI mode in the above link.
    • Admin
      Admin over 10 years
      @AvinashRaj the output is "EFI boot on HDD". How will this help me in restoring the Windows bootloader?
    • Admin
      Admin over 10 years
      If you go to the Command Prompt in the Windows Recovery Environment, and type DiskPart --> List Disk, and post the outcome please.
    • Admin
      Admin over 10 years
      @Mitch I'm sorry for waisting your time. I found a fix for everything and am able to boot into Windows. Seeing it was more of a windows/multi-OS issue I decided to post a slimmed down version of the issue on superuser. Rod Smith has deliverd some tremendous help on there so therefore I have accepted his answer on her to be the right answer. Thank you for giving me your time though. Cheers
  • Nkciy84
    Nkciy84 over 10 years
    I just edited the post, I ended up with this image i.imgur.com/kdOmRyJ.png?1?3211
  • Rod Smith
    Rod Smith over 10 years
    See my edit, above.
  • Nkciy84
    Nkciy84 over 10 years
    That actually makes some sense, because GParted moved files from A to B, and a harddisk working like a harddisk works, the only thing that changed from the old partition SDA7 is ACTUALLY STILL THERE, but they are marked as 'ready to be overwritten'. Am I right?
  • Nkciy84
    Nkciy84 over 10 years
    So actually the only thing missing is the partition table and BIOS_GRUB