5

So, I really screwed things up... Long story short, I deleted my windows 8.1 efi partition and now cannot boot into windows. Furthermore, I don't even have an efi partition left to create a linux install with (which it seems to need so it can put the linux bootloader somewhere).

All I can use on my laptop is the live ubuntu cd. Furthermore, gparted crashes every time I open it giving a very obscure error "Assertion (last_usable <= disk->dev->length) at ../../../libparted/labels/gpt.c:994 in function _parse_header() failed." I'm not even sure my computer can boot off efi anymore as I switched it to legacy mode in the bios menu and haven't been able to get back to it.

I tried using a windows 10 live cd and repairing installing there, but the installer didn't like any of the current existing partitions. For most of them it said there were GPT formatted, and it can't use that.

Where do I even begin to fix this? Is there some way I can create an efi partition from the linux live cd? I have no preference if my whole computer gets wiped, I have all the backups I need, I just want to be able to use my computer again. Here's a list of the partitions given by sudo gdisk -l /dev/sda.

Disk /dev/sda: 250069680 sectors, 119.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 5C489780-9031-436B-B6C1-4F0C29E16773
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500121566
Partitions will be aligned on 2048-sector boundaries
Total free space is 6077 sectors (3.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1230847   600.0 MiB   2700  Basic data partition
   2         1230848         1845247   300.0 MiB   0700  
   3         1845248         2107391   128.0 MiB   0C01  Microsoft reserved part
   4         2107392       500117503   237.5 GiB   EF00  Basic data partition

Here are some images of the partitions recognized by the windows 10 installation usb.

First four partitions, C drive

Next four Partitions, D drive

Message after trying to select Drive 1 Partition 1 for install is "Windows detected that the EFI system partition was formatted as NTFS. Format the EFI system partition as FAT32, and restart the installation." Of course if gparted worked this wouldn't be so bad, but it crashes every time I open it...

1 Answers1

3

In my opinion the best course of action would be to:

  1. Take back up of all your data using Ubuntu.
  2. Delete all partitions on Disk 0 (the one with Windows installed).
  3. Install any of Ubuntu/Windows. They will create the required partitions themselves. (Preferably Windows

In case you want to try and salvage (that seems more difficult now) read on.

Try this first:

gdisk t 2 EFOO
gdisk t 4 0700

Then follow only the Steps 1, 2 and 3 below (DO NOT DO 4). Reboot to see if it works.

IF NOT, then proceed to the below instructions.

The 300MB SYSTEM partition is most likely (99.99%) the EFI partition. You don't need gparted for the operations we need.
Just boot into Ubuntu and run these:

  1. Find you EFI partition's name

    sudo fdisk -l
    

    The EFI partition will be the one with size as 300MB as you have mentioned. Note it's name (/dev/sda2 most likely)

  2. Mount the EFI partition

    sudo mkdir /mnt/efipart
    sudo mount /dev/sda2 /mnt/efipart
    
  3. Copy the EFI directory to the partition from your windows install media. First find the name for your Windows install media using fdisk as in step 1. Let us assume it is /dev/sdc1

    sudo cp -R /dev/sdc1/efi/* /mnt/efipart/EFI/
    
  4. Set the EFI partition flags.

    gdisk t 2 EFOO
    

BTW: Looking again at the partition table you just showed, it seems that this may not work (but is still worth a try).

In case this doesn't work, you will have to repartition the disk (start over from scratch) See these in case:

https://superuser.com/questions/764799/how-to-create-an-efi-system-partition
How do I create an EFI partition