System partition (EFI or ESP system partition). Create EFI bootable GPT partition with gdisk on previous MBR corrupted GPT How to access efi partition

So this is a sister question to my previous question about partitioning for the UEFI bootloader. Deviation for UEFI bootloader, can I use LVM?

Disclaimer: I'm not talking about the data. Windows 8 can die in a fire.

Following the instructions, I have one 400MB device that I believe was previously a Microsoft Reserved partition (I believe it's an MBR partition?). Before I knew what I needed to do, I deleted the existing partition using the fdisk utility and created an MBR partition with an ext4 file system and rebooted for the changes to take effect.

Then I realized it wouldn't work for a UEFI firmware, a firmware so hipster and awesome that it has to be different in every way. gdisk this time I went into gdisk and looked for partitions and didn't find any. I created a new GUID partition on this 400MB device with the correct EFI code of type EF00. This proved to be successful, so I created a FAT32 file system with mkfs -t fat32 /dev/sda1 and it was successful.

I followed all the instructions to install Arch Linux from a bootable installation CD that was booted in UEFI mode which I could add. I got to the point where I installed gummiboot on the system and it immediately told me that my sda1 device was not a proper EFI partition. Thoroughly confused, I did a gdisk -l on the device and found that it determined that the GPT partition was corrupted and the MBR partition was still there.

Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: damaged

He then introduced three options: MBR, GPT, or pure GPT. I chose GPT thinking it would remove the MBR partition tables, but that doesn't matter.

Realizing that I still don't and don't know how to create a proper GPT partition from an existing MBR partition, I ran Quick Analyze on testdisk and everything looks good and green. The testdisk utility recognizes this as a valid EFI boot partition in every way.

I'd like to fix the GPT partition if possible so I can avoid all the installation and setup steps starting with my Arch install. If that's not possible and I need to destroy this partition and start from there, can I keep the data that was already set here and manually add it back after I've fixed the boot partition?

One Solution collect form web for “Creating EFI bootable GPT partition with gdisk on previous MBR, corrupted GPT”

Ubuntu UEFI Community Wiki notation. The same rules apply regardless of distribution.

Creating an EFI Partition

If you are manually partitioning your disk in the Ubuntu installer, you will need to make sure you have an EFI partition set up.

  1. If you already have an EFI partition on your drive (for example, if your computer has Windows8), it can also be used for Ubuntu. Don't format it. It is highly recommended to have only one EFI partition per disk.
  2. The EFI partition can be created with the latest version of GParted (the version of Gparted included in the 12.04 disk is fine. Note: I have included a link to the GParted LiveCD) and must have the following attributes:

    • Mount point: /boot/efi (note: it is not necessary to set this mount point when using manual partitioning, the Ubuntu installer will detect it automatically)
    • Size: at least 100Mib. Recommended 200MiB.
    • Type: FAT32
    • Other: The "boot" flag is required.

See this screenshot which will give you an idea of ​​the layout. (Notice /dev/sda1 , I apologize for relying on Ubuntu snapshots again.) You can create this partition by resizing your arch if necessary. This is also a layout for OSX, so if you want to dual boot with Win8, you would combine sda2 and sda3 from the screenshot below into 1 ntfs type partition, and then sda4 , sda5 and sda6 will be used for Arch.

As for LVM

I believe LVM can be used, but experience will dictate that the EFI partition and mount point you create cannot exist within a volume group and should not exist as a volume. To keep your EFI partition "clean", create a partition that is not part of any LV.

I came across a strange hard drive, it seems there was Linux or MacOS. I deleted all partitions, but one, using standard tools (Disk Utility and Disk Management), could not reach 200 meters.

In the context menu, the item Delete volume… is inactive.

Delete EFI Encrypted Partition in Windows 7 you can use a console program diskpart.

1. Run cmd as administrator

2. Enter in cmd - diskpart. will start diskpart in a new window

list disk - look at the list of disks
select disk # - select the desired disk. instead of # specify the disk number
clean - delete all partitions or volumes on the disk
list partition - check that all partitions are deleted

4. Check the result in Disk Management.

5. All sections are removed.

efi section
efi sections
efi disk partition
efi windows partition
mbr partition table efi system
gpt efi partition
efi system partition
encrypted efi partition
delete efi partition
create efi partition
format efi partition
efi encrypted system partition
efi mac partition
efi partition mac os
efi boot partition
format efi partition fat32
format system partition efi fat32
efi system partition formatted ntfs
create efi partition
format efi system partition with fat32 format
efi system partition installed
efi hard disk partitions
efi partition recovery
delete encrypted efi partition
how to recover efi partition
open efi encrypted partition
how to delete efi encrypted system partition
efi partition size
efi partition in linux
deleting the efi partition
mount efi partition

When we install Windows on an empty (untagged) hard drive or partition formatted in the usual way - using the installation media, we don't have to worry about creating EFI operating system markup. All necessary sections, in particular, boot EFI, are created automatically when the computer is in BIOS UEFI. But if Windows needs to be installed in a non-traditional way.

And on another hard drive with its own independent bootloader, if there is a question of restoring the system to working capacity after removing the hard drive with the boot partition, in such non-standard situations, manual work will be required.

Windows on the second connected to the computer GPT- the disk is not installed with its own EFI-structure. During a normal installation from the installation media, the bootloader of the second system is registered on an existing one. EFI-partition - the one that is on the first disk.

What makes the second Windows vulnerable is that it will not be able to exist on its own if the boot loader of the first system is damaged. Or if it fails or the first hard drive is simply disconnected. For the second Windows to have its own independent EFI- markup, at the time of its installation, you need to make the first system invisible - disable its carrier in the settings BIOS, if possible, or by hardware. This is not always convenient, and sometimes impossible in the case of laptops.

The second Windows with its own independent bootloader can be installed by programs running in the environment of the current system, such as or WinToHDD. But they will require you to specify the boot EFI-chapter.

Creating one on an empty hard drive is very easy.

1. Create an EFI partition on an empty hard drive on the command line

So, we have initialized as GPT media without markup and data.

We start the command line.

Be sure to do this as an administrator.

Enter in succession:

diskpart lis disk sel disk 1 (instead of 1, specify the number under which the hard disk you need is listed above) creat par efi size=100 format fs=FAT32

lis disk

sel disk 1 (instead of 1, indicates the number under which the hard disk you need is listed above)

create par efi size = 100

format fs=FAT32

In the disk management utility, we see that the second hard drive has EFI- section on 100 MB. Now we can form a regular section to indicate it to programs like or WinToHDD as system partition WITH .

2. Creating an EFI partition on an empty hard drive with the Bootice utility

Who doesn't love the command line to create EFI-blank media markup can use a utility with a graphical interface. It is free and can be downloaded from any software portal on the Internet. In the main window, select the second hard one. Click .

Then - "Repartitioning".

First of all, check the box GPT in the column "Partition table type". Then tick the box "Create ESP partition". And at the top in the graph "Settings" remove all values Size except the last. We press "OK".

As a result, we get a disk layout with EFI- section on 128 MB and a partition containing the rest of the disk space.

But what if the hard drive is not empty? If it has a structure and stored user data. Or we want to restore Windows that has lost its boot EFI-partition after the failure or disconnection of the hard drive on which its bootloader previously existed. And there are solutions for this. To restore a system without a bootloader, we naturally need an environment to perform certain operations. In one case, a regular Windows installation media will do. Otherwise, we will work with a disk space manager, so we need a functional and reliable LiveDisk WinPE. One of these is LiveDisk Sagittarius. Image download site - Sergeistrelec.Ru .

Note: the following operations cannot be performed on disks dynamic type. The disk of the Windows mirror left without a bootloader must first be converted to the basic type. This can only be done using third party tools.

3. Creating an EFI Partition at the End of Windows

So, we have, for example, the second Windows, which has lost EFI-loader after a disk failure with the first system.

How to run it? The easiest and fastest way is to create EFI-partition at the end of the system partition and recreate the bootloader. You don't need anything more than the command line to do this. We boot from the Windows installation media, immediately press Shift + F10. This combination will launch a command prompt. If we use LiveDisk Sagittarius, we start, respectively, from it.

And already on board we use the command line.

In it we enter:

diskpart lis vol sel vol 1 (instead of 1, specify the number under which your partition with the system appears above) shrink desired=100 creat par efi format fs=FAT32

Here is the specified section shrunk to 100 MB and in the vacated place was created EFI-chapter.

Now we can recreate the bootloader.

On the command line, exit :

That's it - Windows has been restored.

4. Creating an EFI Partition Before Windows

The boot partition usually exists at the beginning of the disk, before the system partition. It doesn't have to be this way, but it is done to speed up Windows startup. To UEFI found the bootloader. On the SSD such optimization is unlikely to be tangible, but in the case of HDD you can compete even for a fraction of performance.

On board LiveDisk Sagittarius we start . We make a click on the system partition, on the sidebar of operations, click "Change of size".

Slightly pull the slider on the map to the right so that in the column below "Unallocated space in front" several MB. Next, instead of the drawn figure, we enter 105 . To make it work 105 MB. We press "OK".

As a result, the program will release the correct amount of disk space, in our case 102.01 MB. And leave a little tail at the back of the section. We press.

We confirm.

Now let's start the command line. And we create EFI- section exactly as described in item 1 articles.

Here EFI-section created.

It remains only to recreate the bootloader, as described at the end item 3 articles.

Updated: October 2013

Purpose: Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

This section describes how to configure disk partitions, including hard disk drives (HDDs), solid state drives (SSDs), and other drives, for BIOS-based computers with a Common EFI Interface (UEFI).

In this section

Partition Configurations

This section describes the default partition configuration and the recommended partition configuration.

Default Configuration: Windows Recovery Environment Tools Partition, System Partition, MSR Partition, and Windows Partition

The default Windows setup configuration includes a Windows Recovery Environment Tools Partition, a System Partition, an MSR Partition, and a Windows Partition. This configuration is shown in the following diagram. This configuration allows you to enable BitLocker Drive Encryption and store the Windows Recovery Environment in a hidden system partition.

Using this configuration, utility tools such as Windows BitLocker Drive Encryption and Windows Recovery Environment can be added to a custom Windows installation.

Recommended Configuration: Windows Recovery Environment Partition, System Partition, MSR Partition, Windows Partition, and Recovery Image Partition

The recommended configuration includes: the Windows Recovery Environment tools partition, the system partition, the MSR partition, the Windows partition, and the recovery image partition. This configuration is shown in the following figure.

The Windows Recovery Environment tools partition and the system partition are added before the Windows partition is added. The partition containing the recovery image is added last. This partition order will keep the system partition and the Windows Recovery Environment tools partition safe during actions such as deleting the recovery image partition or resizing the Windows partition.

System and service partitions

By default, system partitions are not displayed in File Explorer. This is done in order to prevent the user from accidentally making changes to the system partition.

Hello! Windows 8.1 won't boot on laptop with UEFI BIOS and I can't do anything. When loading, an error occurs on the screen File: \ EFI \ Microsoft \ Boot \ BCD ... I studied all the Internet articles on this topic, but nothing helps in my case.

What have I done!

  1. Booted from the Windows 8.1 installation disk and searched for the installed operating system with the command bootrec /RebuildBcd, an error occurred Scanning for installed Windows systems completed successfully. Total Windows systems detected: 0»
  2. Deleted a partition (300 MB), encrypted (EFI) system partition containing all Windows 8.1 bootloader files with the command del vol, then applied Automatic Boot Repair, the system re-creates this partition, but does not boot. I made this section active on the command line, it did not help either.
  3. I entered commands that are successful, but Windows is not loaded.

    bootrec /FixMbr

    bootrec /FixBoot

  4. Also formatted the same partition (300 MB) Encrypted (EFI) with the command format fs=FAT3 and recreated it.
  5. I tried to write for Windows 8.1 a new boot store with the command bcdboot.exe C:\Windows, where (C:) is the partition with the installed Windows 8.1 operating system and I again get an errorFailed to copy download files.

I don’t know what else to do and how to restore the Windows 8.1 bootloader. What can you suggest?

Hello friends! My name is Vladimir and I will answer this question.

If your Windows 8.1 does not boot and you have used all available means to restore the bootloader, then you can delete the system boot manager: the 300 MB encrypted (EFI) system partition, as well as the 128 MB MSR partition and create them again.

In Disk Management you can only see 300 MB encrypted (EFI) system partition, 128 MB MSR partition visible only on the command line when typing a command"lispar".

Note: If you are inexperienced, do not perform this operation unless necessary, use other methods from the section on first. If you want to experiment on a working laptop, then do not get started without first creating a backup copy of these partitions, but best of all, create a .

We will delete and create new partitions:

1. Section (400 MB) containing the Windows 8.1 recovery environment (you can get rid of this section altogether and use the recovery environment located on the Win 8.1 boot media if necessary).

2. Section (300 MB), Encrypted (EFI) system partition containing all Windows 8.1 boot loader files.

3. Service partition MSR (Microsoft System Reserved) 128 MB, required for partitioning GPT disks.

We boot the laptop from and in the initial window of the system installation, press the keyboard shortcut Shift + F10,

A command prompt window opens, enter the following commands:

diskpart

lis dis (lists physical disks).

sel dis 0 (select a 931 GB laptop hard drive, and the second 14 GB drive is a bootable Windows 8.1 flash drive).

lis par (show all partitions of the selected disk, we will delete the first three partitions).

sel par 1 (select the first section

del par override (delete the partition, to delete the ESP and MSR partition or the laptop OEM partition, you must specify the override parameter)

sel par 2

del par override

sel par 3

del par override

Everything, we deleted all three hidden sections.

Now, if you select a drive and enter the lis par command, then we will see only two partitions on the laptop's hard drive:

Section 4 - Installed Windows 8.1

Partition 5 is a hidden recovery partition with factory settings.

Create a newly encrypted (EFI) 300 MB system partition, as well as a 128 MB MSR partition

We enter the commands:

diskpart

lis dis (displays a list of disks).

sel dis 0 (select laptop hard drive).

create par efi size=300 (we create an encrypted (EFI) 300 MB system partition).

format fs=fat32 (we format it into the FAT32 file system).

creat par msr size=128 (create a 128 MB MSR partition)