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

  • 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 06 '15 at 01: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 06 '15 at 02: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 06 '15 at 02: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 06 '15 at 02:50
  • Correction, its the efi partition of the d drive that needs to be formatted as fat32. How do I do that? Better yet, how do I put an actual efi partition on my C drive as that would be much better in the end. – Mike Menart Dec 06 '15 at 02:58
  • When you will tell Windows to proceed with the installation it will tell you that it needs to create certain extra partitions to function properly. Try deleting a partition (preferably the small first partition on your disk). But it would be much better if i could see a photo maybe of what you are seeing. – Ashhar Hasan Dec 06 '15 at 03:16
  • Looking at the gdisk output, the easiest way for you is to delete all partitions on /dev/sda. Start the Windows setup (with secure boot enabled) and create a partition through the Windows setup. It will then set up all required partitions. Btw, if you are using the Windows setup from a live USB, make sure it is GPT compatible otherwise it may give you the same error about GPT disks. – Ashhar Hasan Dec 06 '15 at 03:28
  • @Hasan, Looking back at the gdisk output, it doesn't seem to even acknowledge my C drive partitions, just the partitions on my d drive. I'm a little bit worried about reconfiguring the entire partition table due to the fact that my entire C: drive partition is msata RAID0, which makes it rather complicated and I'm not sure I'd be able to reconfigure it. As far as GPT compatible, how would I make sure the setup is GPT compatible? Is there something I can do to make it GPT compatible? Also, I'll try to get a picture posted soon with the error I'm seeing. – Mike Menart Dec 06 '15 at 16:30
  • To ensure that the Windows installation media is GPT compatible, try seeing if the installation media has an efi subdirectory and that secure boot is on. The above two together mean you are running GPT compatible. – Ashhar Hasan Dec 06 '15 at 16:45
  • As a shot in the dark solution, try copying the efi folder onto the EFI partition using Ubuntu. – Ashhar Hasan Dec 06 '15 at 16:49
  • The installation media has an efi subdirectory, and I'm running in secure boot so that should be taken care of. I don't know how I would copy the file to the efi partition, as I can't find the efi partition (if there actually is one), because it doesn't show up in the windows install partition list and gparted won't work... Also I added some pictures above. – Mike Menart Dec 06 '15 at 19:19
  • See the answer below. – Ashhar Hasan Dec 06 '15 at 19:42
  • 1

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

  • 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 07 '15 at 04: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 07 '15 at 04:16