4

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...

  • Try using a Windows installation disk, it will be able to make the required partitions. You may try to manually remake the EFI partition if you are willing. Not a difficult task. I'll add instructions as an answer if you say so. And before using the Windows disk, make sure to turn on SecureBoot otherwise Windows will say something about GPT disks. (That Legacy is why Windows was complaining) – Ashhar Hasan Dec 6 '15 at 1:45
  • Thanks. I don't have a installation disk, so recreating the efi partition might be my only choice. The secure boot is definitely a helpful tidbit, although it might be tricky to get to the setting as I don't seem to be able to get to the bios anymore... – Mike Menart Dec 6 '15 at 2:34
  • Look in the documentation for your system's motherboard. They usually have a key to directly go to boot menu (bypassing the BIOS). F12 on new Dells and F2 on recent ThinkPads. I'll add the instructions soon. – Ashhar Hasan Dec 6 '15 at 2:40
  • I got back into the bios and disabled secure boot. For some reason in legacy mode I had to use a different key at boot. I went to my windows 10 usb installer, and now it seems to at least recognize my D drive as a valid install target (for some reason it still doesn't let me use my C drive, maybe because its raid?). However, it wouldn't let me install windows 10 on it because it was ntfs configured instead of fat32, so I guess I'm going to try messing with that a bit. I'd still much rather prefer to install the os on the C drive though, as its msata instead of solid state. – Mike Menart Dec 6 '15 at 2:50
  • 1
    Possible duplicate of Can't boot after deleting EFI boot- and Windows-partition – Ashhar Hasan Dec 6 '15 at 23:02
2

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

  • 1
    You basically got it. In the end the right thing to do was just recreate the entire partition table, make an efi partition, and install windows 10 from there. For some reason this took a few tries... but it worked eventually. – Mike Menart Dec 7 '15 at 4:14
  • I am glad your problems were resolved. But still I was hoping to be able to save you the effort of configuring stuff again. – Ashhar Hasan Dec 7 '15 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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