Creation of efi section. System partition (EFI or ESP system partition). Can I delete

In this article, we will show you how to manually restore an accidentally deleted Windows boot partition on a UEFI system. Initially, the article described my experience in restoring a bootable EFI partition on Windows 7, but the article is also relevant for modern Microsoft operating systems (from Windows 7 to Windows 10). It helped me out more than once after accidentally formatting or deleting an EFI partition on Windows 10. In this article, we will show you an easy way to manually recreate a bootable EFI and MSR partitions on Windows.

So, suppose that somehow by accident (or not very accidentally, for example, when trying) the bootable EFI partition on a UEFI system (not BIOS) was deleted or formatted, as a result of which Windows 10 / 8.1 / 7 stopped booting, cyclically prompting you to select boot device (Reboot and select proper boot device or insert boot media in selected). Let's figure out whether it is possible to restore Windows to work when deleting a partition from Boot Manager without reinstalling the system.

Warning... The instruction assumes work with disk partitions and is not intended for beginners. If you interpret the commands incorrectly, you could accidentally delete all data on your hard drive. It is also highly recommended that you back up important data to a separate medium.

Partition structure on a GPT disk

Let's see how the partition table of a bootable hard disk with GPT partitioning should look like. At a minimum, the following sections must be present:

  • EFI system partition (EFI System Partition or ESP - Extensible Firmware Interface) - 100 MB (partition type - EFI).
  • Microsoft backup partition - 128 MB (partition type - MSR).
  • Windows main partition - partition with Windows.

This is exactly the minimum configuration. These partitions are created by Windows Installer when the system is installed on an unallocated disk. PC manufacturers or users themselves can additionally create their own partitions containing, for example, the Windows recovery environment in a file winre.wim (), a partition with a backup system image from the manufacturer (allows you to roll back to the original state of the computer), custom partitions, etc.

EFI section with the Fat32 file system is required on disks with GPT partitioning on UEFI systems. This section, by analogy with the System Reserved section on disks with MSR markup, stores the boot configuration storage (BCD) and a number of files required to boot Windows. When the computer boots, the UEFI environment loads the boot loader from the EFI (ESP) partition (EFI \\ Microsoft \\ Boot \\ bootmgfw.efi) and transfers control to it. If this section is deleted, you cannot boot the OS.

MSR section on a GPT disk is used to simplify partition management and is used for service operations (for example, when converting a disk from simple to dynamic). This is a spare partition and is not assigned a partition code. User data cannot be stored on this section. In Windows 10, the size of the MSR partition is only 16 MB (in Windows 8.1, the size of the MSR partition is 128 MB), the file system is NTFS.

Manually create EFI and MSR partitions on a GPT disk

Because the system does not boot correctly, we need an installation disk with Windows 10 (Win 8 or 7) or any other boot disk. So, we boot from the installation disk and on the installation start screen press the key combination Shift+ F10 ... A command prompt window should open:

Let's start the disk and partition management utility:

Let's list the hard drives in the system (in this example, it is one, disk 0 ... Asterisk ( * ) in the Gpt column means the disk is using a GPT partition table).

Let's select this disk:

Let's list the partitions on the disk:

In our example, there are only 2 partitions left in the system:

  • MSR partition - 128 MB
  • Windows system partition - 9 GB

As we can see, the EFI partition is missing (deleted).

Our task is to remove the remaining MSR partition so that at least 228 MB of free space is left on the disk (for MSR and EFI partitions). You can delete the remaining partition using the graphical GParted or directly from the command line (that's exactly what we'll do).

Select the section to delete:

Select partition 1
And remove it:
Delete partition override

Let's make sure that only the Windows partition is left:

We can now manually re-create the EFI and MSR partitions. To do this, in the context of the diskpart utility, run the commands sequentially:

Selecting a disk:

create partition efi size \u003d 100

Make sure that a 100 MB partition is selected (an asterisk opposite the Partition 1 line):

list partition
select partition 1
format quick fs \u003d fat32 label \u003d "System"
assign letter \u003d G
create partition msr size \u003d 128
list partition
list vol

In our case, a drive letter is already assigned to the Windows partition. C:, if not, assign a letter to it as follows:

select vol 1
assign letter \u003d C
exit

Recovering EFI bootloader and BCD in Windows

After you have created the minimal disk partition structure for a UEFI system, you can proceed to copy the EFI boot files to disk and create a boot loader configuration (BCD) file.

Let's copy the EFI environment files from the directory of your disk where your Windows is installed:

mkdir G: \\ EFI \\ Microsoft \\ Boot

xcopy / s C: \\ Windows \\ Boot \\ EFI \\ *. * G: \\ EFI \\ Microsoft \\ Boot

Let's re-create the Windows 10/7 bootloader configuration:

g:
cd EFI \\ Microsoft \\ Boot
bcdedit / createstore BCD
bcdedit / store BCD / create (bootmgr) / d “Windows Boot Manager”
bcdedit / store BCD / create / d “Windows 7” / application osloader

You can replace the inscription “My Windows 10” with any other.

Advice... In the event that only the EFI environment files were damaged on the EFI partition, and the partition itself remained in place, you can skip the process of re-creating partitions using diskpart. Although in most cases it is enough to restore the bootloader according to the article. It is possible to manually recreate BCDs on conventional MBR + BIOS systems.

The command returns the GUID of the created record, in the next command this GUID must be substituted for (your_guid).


bcdedit / store BCD / set (bootmgr) default (your_guid)
bcdedit / store BCD / set (bootmgr) path \\ EFI \\ Microsoft \\ Boot \\ bootmgfw.efi
bcdedit / store BCD / set (bootmgr) displayorder (default)

Further commands are executed in the context (default):

bcdedit / store BCD / set (default) device partition \u003d c:
bcdedit / store BCD / set (default) osdevice partition \u003d c:
bcdedit / store BCD / set (default) path \\ Windows \\ System32 \\ winload.efi
bcdedit / store BCD / set (default) systemroot \\ Windows
exit

Reboot the computer ... In our case, it did not boot the first time, we had to additionally dance with a tambourine:

  1. Turn off the power to the PC.
  2. Disconnect (physically) the hard drive.
  3. Turn on the PC, wait for the boot error window to appear and turn it off again.
  4. We connect the disk back.

Then, in our case (testing was carried out on), we had to add a new boot menu item by selecting the EFI \\ Microsoft \\ Boot \\ bootmgrfw.efi file on the EFI partition.

In some UEFI menus, by analogy, you need to change the priority of the boot partitions.

After all the above manipulations, Windows should boot correctly.

The hard drives of most Windows computers traditionally have two partitions - system and user, at least this is how Explorer shows. In fact, there are more partitions, just some of them are hidden, without a letter, which is easy to see by opening the standard disk management snap-in. The point of hiding them, we hope, is clear to everyone. They contain important data.

Intentional or accidental deletion of which may cause Windows to malfunction or even fail to boot.

Another thing is healthy interest in them, because many, probably, would like to know what the service partitions of the system hide in themselves and what the risk is for a user who wants to delete them, say, in order to increase free disk space. By the way, you can still delete service partitions, only you need to do it correctly and only when it is really necessary. It should also be remembered that in any case this will lead to a decrease in the overall fault tolerance of the system, provided by the separate storage of important system and boot files. However, offline storage of the bootloader is far from the only purpose of hidden partitions, they can contain encryption data BitLocker , image "factory" systems, recovery environment, and so on.

Hidden sections first appeared in Windows 7, at XP nothing like this happened, if the system stopped loading, it was simply reinstalled. On Windows Vista a more advanced mechanism was used, in this OS user could create on DVD -disk recovery environment and use it to bring the system back to life if it could not boot. But in Windows 7 it was already possible to see one on the disk, and in OEM -systems have two service sections - "Reserved by the system" size 100 Mb and an untitled volume from 6 before 15 GBcontaining a split image of the original operating system with "Factory" settings - an analogue of a full backup created by programs like Acronis True Image .

If you mounted the first one, you would see the folder containing the boot configuration files Boot and download manager file bootmgr , on the second volume you would find a regular program Recovery and some original system image files. With an exit Windows 8.1and then Windows 10 everything has changed a little. Section "Reserved by the system" got bigger, there was support UEFI , and along with it, several more service volumes were added to the disk, including the required GPT -disks section MSR not displayed in the Disk Management snap-in. You can view all hidden partitions on your computer using third-party disk managers or the most common command line. Run it as administrator and run the following commands:


list disk
select disk 0
list partition

On our PC there are two service hidden sections, you may have more. Let's try to enter them, for which we will mount the volumes of interest to us using the command. Without leaving the utility, we execute the following commands:

list volume
select volume 2
assign or assign letter \u003d x

2 in this example, this is the number of the volume to be mounted, and X - the letter assigned to it (if you do not specify a letter, it will be selected and assigned automatically) ... After that, go to the section through Explorer and look at the contents, having enabled the preliminary display of hidden objects.

True, this method has a drawback - the folders may be inaccessible for viewing due to the lack of necessary rights, so we still recommend using third-party file managers, which are best included in "Alive" disks.

So, what exactly do our hidden sections contain?

On disk "Reestablish" size 498 Mb there is a folder Recovery .

Which in turn contains the folder WindowsRE .

With Windows Recovery Environment.

If you remove it, Windows will still be able to boot. however, all disaster recovery tools will become unavailable.

Second service section (EFI encrypted) size 99 MB contains a folder EFI .

In which directories are stored Boot and Microsoft with download files.

In addition to these two volumes, you may have one or two service partitions. Section MSR size 128 MB with notice "Reserved" not as important as the section EFI , but its removal can also lead to disastrous consequences. It usually stores markup data. GPT , but it may contain boot files as well. Largest hidden section (more than 5 GB) with notice "Recovery" contains an image "Clean" Windows with original parameters. This section is found on OEM -devices with pre-installed OS.

If the disk is low on space, you can delete it, but at the same time you will lose the ability to restore the system to "Factory" settings. Finally, the fifth hidden section, marked "Recovery" size 400-600 or slightly more megabytes can be found on computers updated from Windows 8.1 before Windows 10... It stores the recovery environment of the previous version of the system, i.e. Windows 8.1... You can format it without any negative consequences.

And that's all for now.

If you suddenly want to delete from yourself "excess" service section, first think carefully whether there really is such a need for this and only then proceed to what you intended.

When installing / reinstalling the Windows operating system, many may have noticed one or several small partitions (from 100 to 500 MB) located among the familiar and familiar local drives C, D, etc. Typically, these are the System Reserved, Recovery and MSR Reserved sections. When partitioning a hard disk into local partitions during OS installation, you can note that they are created automatically.

In this article, we'll take a closer look at the MSR (Reserved) section. You will find out what it is, what it is for, when it is created and whether it can be deleted.

Section purpose

Today under Windows there are two main standards for file partitioning of hard drives. These are MBR and GPT. We are talking about them in the previous articles. So the MSR section (reserved) is found only on GPT.

It is a hidden system reserved area of \u200b\u200bthe hard drive that can be used for the various needs of the operating system and its file storage. For example, to convert a simple volume to dynamic.

Many people mistakenly believe that the MSR partition contains the Windows boot / boot record (by analogy with the hidden "" partition on the MBR markup). But this is not the case.

How did it come about?

MSR (Reserved) is created automatically when a hard disk is partitioned into local partitions in the standard Windows installer. But only if you booted in EFI / UEFI mode from the media,.

Automatic creation of hidden partitions when partitioning the hard disk using the standard Windows Installer tool

Can I delete?

Despite the fact that this hidden system partition does not contain an operating system bootloader, and if you delete it, Windows will still start normally, we highly do not recommend doing this. This is due to the fact that it is possible in the future, when you need to do something with your local disks, for example, or vice versa, compress any of them, because of the missing MSR (reserved) this may not work.

And what's the point of deleting it, if in the "Computer" window it is not displayed among the local disks (that is, it does not interfere in any way), and its size is no more than 500 megabytes, by releasing which you will gain practically nothing.


The best way to thank the author of the article is to repost to your page

As soon as we turn on the computer, it immediately starts running a miniature operating system that we know as BIOS. She is engaged in testing devices, memory, loading operating systems, allocating hardware resources. Many of the features in this suite of programs (usually around 256-512 KB) support older operating systems like MS-DOS, giving them many options. Since the days of the PC / AT-8086, BIOS has changed very little, and by the time the first Pentiums were launched, its development had almost stopped. Actually, there was nothing to change in it, except for a dual BIOS, support for network tools and the possibility of flashing. But there are many drawbacks: starting entry into the real mode of the processor, 16-bit addressing and 1 MB of available memory, the impossibility of having a "repair" console. And, of course, the eternal problem of hard drive support. Even now, drives up to 2.2 TB are guaranteed to be supported, no more.

Back in 2005, Intel decided to change the BIOS to EFI / UEFI (Unified Extensible Firmware Interface). The EFI system is a more advanced base operating system. On some Unix and Windows platforms, UEFI has been around for a long time, but the massive transition has yet to take place, despite good intentions. And they are as follows:

  • The presence of the notorious console for repairing system parameters and installing the OS;
  • The EFI section makes it possible to perform some actions without loading the OS (watching movies, starting music);
  • Login to the Internet and, therefore, the presence of installed network drivers, TCP / IP stack, etc.);
  • Presence of graphics mode and custom scripts;
  • Support for giant disks;
  • Storing UEFI on new format (GPT) partitions;
  • Full support for all hardware from the start.

UEFI can use a general-purpose runtime machine like the JVM to use device-independent code, which opens up huge horizons for creating "bootable" software.

There is also criticism of this technology. In particular, its introduction can lead to cutting off new players from the operating system market: for this there is always some kind of technological loophole in the code. Like, for example, the inability to boot Windows 98 from modern BIOS. Worse, you have to forget about the millions of MS-DOS programs and other systems that relied on BIOS functions to operate. Perhaps they will still be emulated, but there are doubts about that. And among them there are probably important programs that there will be no one to rewrite. However, all these are solvable issues - at least due to virtual operating systems. But the fact that new types of viruses will appear is for sure, and we will be able to see it pretty soon.

How to repair EFI bootloader Windows 7 and Windows 10?

In this article, we will try to restore the EFI bootloader for Windows 7 /8 /10 ... We have already analyzed a little earlier. For now, let me immediately note that damage to the bootloader in our case is most often (among other things) caused by:

  • installing a second operating system
  • incorrect operations to restore the system (or its unsuccessful completion)
  • deleting some data from hidden sections
  • broken sectors
  • by the action of malware.

Using the presented tools, you can try to restore the bootloader EFIwhich refuses to boot the system due to a missing or broken configuration file at:

Hidden Drive: \\ EFI \\ Microsoft \\ Boot \\ BCD

By the way, here is its approximate content from:

To make it clear ...

The partition structure in a GPT table on Windows loaded in UEFI mode most often looks like this:

  • EFI - ESP section ( Extensible Firmware Interface) - the section where the software with the drivers for loading Windows is stored;
  • MSR - he is Microsoft Reserved - partition reserved during Windows installation; it may not be on your machine
  • Primary section - the volume where system files are stored: registry, services, system utilities, configuration files, etc.

Windows 10 also adds a disk here Recovery... By default (i.e. when installing Windows on a UNFORMATED disk), the first two partitions have a clear size. And therefore, if necessary, it is easy to isolate them, focusing only on the size of both. In Windows 7, for example, this is respectively 100 Mb and 128 MB... And this, as they say, is a typical configuration. Some computer manufacturers create partitions as they see fit, for example by sticking Windows PE recovery environment into a file. winre.wim... If you find such a file in yourself, know that it is it that contains the system recovery image from the manufacturer. Section EFI required on GPT disks with UEFI support. When the computer turns on, the UEFI environment loads the bootloader ( EFI \\ Microsoft \\ Boot \\ bootmgfw.efi) from section EFI (ESP), transferring control over the boot to Windows itself. No partition - no download.

Section same MSR on the disk is created to facilitate the overview of partitions and is used for system operations (such as converting a disk from simple to dynamic). This is a fallback partition that Windows never assigns an identifier to. And it does not contain user data. In Windows 10, the size of the MSR partition is 16 Mb (in Windows 8 - 128 MB), file system type - NTFS.

Windows Boot Configuration Data

That the file at the above address EFI \\ Microsoft \\ Boot \\ BCD corrupted, you may be informed of a blue screen of death BSOD with the following error:

The boot configuration data for your PC is missing or contains errors. File: \\ EFI \\ Microsoft \\ Boot \\ BCD Error code: 0xc0000 ***

This means that the data in the file Boot Configuration Data do not recognize your Windows bootloader configuration. However, users familiar with the MFT bootloader repair utility bcdedit.exe, this time she won't help out. When trying to run it, the user will see something unusual:

The boot configuration data store could not be found. The requested system device cannot be found

They say that neither the data nor the device itself exists. There is only one reason: since the BCD bootloader configuration in UEFI boot mode lies in a special EFI partition:

efi partition in Windows 7

efi partition in Windows 10

... then our utility simply does not see it. Those. does not see the bootloader itself, or even the entire section. In general, traditional recovery tools created for such a case do not save either:

You also misspelled it?

How to repair EFI bootloader Windows 10: forehead.

  • select the boot device by calling the quick boot menu with the keys in zone F or

  • load from;
  • exit to the command line by holding Shift + F10 after the window appears Installing Windows
  • as in the previous mode, we need to decide on the list of computer partitions. Further, I will assume that the hard disk is installed in a single copy:
diskpart list volume
  • find the EFI partition. Its size, I repeat, is small ( 100 Mb at W7 and W10) and it has the FAT32 file system:

my EFI is an unnamed Volume 3

  • it is hidden by default, which means it has no letter. For further work we need it. So we assign a letter right now:
select volume * assign letter Y: exit

After closing the program, we go to this section:

cd / d Y: \\ EFI \\ Microsoft \\ Boot \\

There is a slight digression here. This path exists by default, and there is no reason for the console to refuse you to go to the specified folder. If an error appears, see paragraph Possible mistakes or go directly to the next part How to repair the EFI bootloader Windows 7/10: rebuilding the EFI.

i got the error Denied access immediately

  • re-create the boot sector of the partition of the same name:
bootrec / fixboot
  • using utility bcdedit.exe Let's create the repository again by copying the boot files from the system folder:
bcdboot C: \\ Windows / l ru-ru / s k: / f ALL

/ f ALL - copies boot files (both UEFI and BIOS modes) for possible boot support on EFI and BIOS;

/ l ru– ru - will indicate the language locale of the system that will be used, i.e. into Russian. If everything goes well, skip this paragraph.

  • we execute the following commands sequentially:
bootrec / scanos bootrec / rebuildbcd

Reboot to Windows 10 on your hard drive and check.

Possible mistakes

There may be some errors for the administrator here. Among them, the most common are:

  • BFSVC Error: Can not open the BCD template store. status - -
    you need to check the entered commands and the path to the storage of Windows system files; sometimes the error appears due to the incorrect indication of the language locale;
  • BFSVC Error: Error copying boot files from Last Error \u003d 0x570 - the error is a consequence of the very phenomenon that Windows does not boot. It is likely that bad sectors appeared not only in the EFI boot section, but also on the system disk; drive the hard disk with the utility chkdsk.exe right there from the console with the command
chkdsk with: / a

where c is the disk with the system

  • Access denied - there are many reasons for that: from the presence of bad sectors to an incorrectly set boot mode (worth Legacy instead UEFI; need to - uEFI only) from a USB flash drive. But. UEFI would not be UEFI if everything went so smoothly: the fact that the EFI partition does not admit its files is more a pattern than an exception. So, if you are denied access, I advise you to simply delete the EFI partition itself (and we no longer need it), recreate it with the only directory necessary for it to work, and then rely on the repair bootrecallowing her to complete the job. So, if the need arose, we continue to work from the moment the team refused.
bootrec / fixboot

How to repair the EFI bootloader Windows 7/10: rebuilding the EFI.

The most important thing here is not to miss the partition / s and delete the one that stores your Windows data and your information. So once bootrec.exe I could not get into the section we need, we remove the section. To do this, we will need to go back to diskpart.exe, again determine the partitions and select the one that is 100 MB. We return to the repair console:

Cd / d x:

And we start over:

Diskpart select disk 0 list partition select partition 2

remove it:

Delete partition override

you can check the result:

List partition

We have some unallocated space left, in which we re-create the just deleted partition:

Create partition efi size \u003d 100 list partition select partition 1 format quick fs \u003d fat32 label \u003d "System"

But when you try to assign the previously used letter Y, the console refused (it had to be restarted). I will assign a letter to the section Z:

Assign letter \u003d Z exit

Let's prepare the ground for bootrec.

  • create a download folder:
mkdir Z: \\ EFI \\ Microsoft \\ Boot

  • copy the files there from the EFI environment from the folder installed by Windows (C is the letter of the drive with Windows system files):
xcopy / s C: \\ Windows \\ Boot \\ EFI \\ *. * Z: \\ EFI \\ Microsoft \\ Boot
  • let be bootrec from your flash drive will check the disks for Windows system files:
bootrec / scanos

They will not go anywhere unless you accidentally deleted them, or they did not fall into the zone of bad sectors. It remains ...

  • ... force to write the "correct" BCD file and other "configs":
bootrec / rebuildbcd

Turn off the computer, take out the flash drive and turn on the machine. We are waiting for the appearance of Windows. Let it boot to the Desktop and check if everything is in place.

The error reappears ...

Do not worry. If you delved into the process, and entered all the commands deliberately and correctly, the situation is most likely already fixed. You just need to take into account the peculiarities of the security filters adopted for the UEFI mode, and do not confuse the drive letters. They can be passed by following these steps:

  • Wake up BIOS:
    - remove the cover on the side of the computer or the bottom of the laptop
    - disconnect the hard drive (by disconnecting both loops on the "hospital" or removing them from the connectors on the laptop)
    - turn on the machine, waiting for the download error;
    - after turning off the computer, reconnect the hard drive and again, turning on the computer, check;
  • check the UEFI menu of the computer board for the correct order of the boot partitions; the first should be, as you understand, EFI;
  • make sure the label Bootable stands only opposite the EFI partition, and no one else. Unfortunately, it will not work to check and correct the situation from Windows PE. And for this you have to use additional tools in the form of a bootable flash drive. Do it any convenient option from the article Disk Label Bootable: how to add or remove?

That's all I wanted to say. Good luck.

Read: 1 641