Removing and recreating EFI partition

0

1

I've wanted dualboot Win 10 and CentOS, but TL;DR I ended up with non-booting notebook. bootrec /scanOs can't find Windows installation (it is still there though).

Auto repair doesn't work, neither bcdboot or bootrec /fixboot/fixmbr/rebuildbcd.

So my question: is removing EFI partition completely (diskpart) and recreating it from the scratch (bcdboot) worth a try?

If it helps: Lenovo Thinkpad X260, SSD, GPT partition style, Win 10 Pro

(I would try to recreate the situation in VirtualBox, but available PC isn't capable of such thing.)

EDIT #1: I've removed the CentOS partition later on (tried to install Windows 10 there hoping for repaired boot manager but with no luck). So it's unformatted 30 GB space now

EDT #2: This is output from diskpart:

DISKPART> list disk

  Disk ###  Status       Size     Free     Dyn  Gpt
  --------  -----------  -------  -------  ---  ---
  Disk 0    Online        238 GB  1024 KB        *

DISKPART> list partition

  Partition ###  Type               Size     Offset
  -------------  -----------------  -------  -------
  Partition 1    System              260 MB  1024 KB
  Partition 2    Reserved             16 MB   201 MB
  Partition 3    Unknown            1024 KB   277 MB
  Partition 4    Primary             206 GB   279 MB
  Partition 5    Primary              30 GB   206 GB
  Partition 6    Recovery           1000 MB   237 GB

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   DISK         NTFS   Partition    206 GB  Healthy
  Volume 1                      RAW    Partition     30 GB  Healthy
  Volume 2     E   SYSTEM       FAT32  Partition    260 MB  Healthy    Hidden
  Volume 3     D   WinRE_DRV    NTFS   Partition   1000 MB  Healthy    Hidden

EFI should be partition 1 / volume 2

EDIT #3: diskpart detail partition 1:

Type    : c12a7328-f81f-11d2-ba4b-00a0c93ec93b
Hidden  : Yes
Required: Yes
Attrib  : 0x0000000000000001
Offset in bytes: 1048576

EDIT #4: Boot menu:

#1 Windows boot manager (does nothing; black screen and takes me back here)
#2 ATA HDD0: SanDisk SD8...001 (same as #1)
#3 USB (my windows install media)
#4 PCI LAN

UPDATE #1 The boot menu allows me to show Diagnostic splash screen where I noticed that System BIOS shadowed Video BIOS shadowed.

Kryštof Šádek

Posted 2017-09-11T08:08:06.143

Reputation: 1

Check that you have single EFI volume and check partition flags, it must be flagged as EFI partition. – Pavlus – 2017-09-11T08:56:00.360

If and only if you don't need any data from that HDD, you may go from scratch and full format HDD to install Windows. – Biswapriyo – 2017-09-11T09:57:57.630

Deleting and re-creating the EFI System Partition (ESP) is likely to make matters worse, not better; the ESP holds boot loaders, so deleting it will cause any boot loaders that are there, but that aren't being launched, to be lost. It's unclear what your "EDIT #4" boot menu is -- the EFI's built-in boot menu, a GRUB menu, or something else. A screen shot (digital photo) would help. My rEFInd boot manager on USB flash drive might help, at least as a temporary/emergency tool. Windows and CentOS recovery procedures will each be unique.

– Rod Smith – 2017-10-08T17:49:58.273

Answers

1

EFI partition is simple vfat. Make sure it's formatted as such.

Windows should write to it as long as the partition type is correct (use GPT with EF00 as the type code. If you have a hybrid MBR/GPT it's easier to remove the MBR and only keep the GPT if it's incorrect.)

If Windows was booting before, you should still have the bootstubs in your EFI partition. unless they've been wiped out somehow (say by a format of said partition or similar.) Are they there by chance?

It's interesting that you suddenly can't boot too; every distro has pretty much gotten coexistence down flat these days, and EFI made that much cleaner, so I'm interested in the above to try to find out what happened to get you into this state as it will surely help your recovery to know ;)

Care to share your current GPT + MBR part tables and such?

It would also help to know your EFI boot manager entries. If you can get into Linux, an easy way to see this is efibootmgr -v.

Most likely, your old EFI boot entry still exists for the Windows boot, but is just set as a later priority. Linux installs tend to install some intermediary bootloader, such as grub/systemd-boot. You can typically access these and manage them from your EFI "setup" screen (on macs it's a different story, but that's an explanation for another day).

FYI, you can boot Linux kernels directly nowadays as well, as they contain an efi bootstub at the beginning of them since quite some time ago.

I'm guessing you had Windows installed and booting already, then installed Linux over top, yes?

trevorj

Posted 2017-09-11T08:08:06.143

Reputation: 11

1I probably should have mentioned that linux is no longer present (formated). So my current set of tools is Windows installation, so cmd. – Kryštof Šádek – 2017-09-11T09:06:55.627

And it isn't hybrid GPT+MBR, just GPT. – Kryštof Šádek – 2017-09-11T09:08:15.690

What do you mean by formatted? Care to elaborate there? A listing of your partition table(s), verification of the filesystem on your EF00 type'd partition, as well as a listing there would help. – trevorj – 2017-09-11T09:13:00.230

I mean I have deleted the partition with Linux. – Kryštof Šádek – 2017-09-11T09:14:52.647

I meant what partitions did you delete? Was one of them the EFI partition? – trevorj – 2017-09-11T09:16:16.127

Can you get a GPT listing that includes partition types in the output? – trevorj – 2017-09-11T09:16:41.597

Nono just with Linux. Although it has it's own /boot partition. But the original from before (created by Windows) it's still presented. I've edited my question and added output from diskpart tool – Kryštof Šádek – 2017-09-11T09:18:39.763

Yeah, thanks for that. I'd still want to see the partition listing with partition table type codes to verify that volume 2 is set to EF00. – trevorj – 2017-09-11T09:19:45.797

Also, getting your efi boot entries would also greatly help, it's likely related. – trevorj – 2017-09-11T09:20:19.903

May I ask how can I do that? – Kryštof Šádek – 2017-09-11T09:27:20.350

Yep I had windows and installed linux afterwards. But then I ended up with non working boot. No grub neither windows boot manager showed up. BIOS boot menu is showing Windows boot manager in the first place but it doesnt work. Then is listed SSD doing the same thing and afterwards USB, network.. – Kryštof Šádek – 2017-09-11T09:36:45.023