Computer lessons

System partition efi esp. System partition (EFI or ESP system partition)

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 this is the “System Reserved”, “Recovery” and “MSR Reserved” section. When dividing your hard drive into local partitions during OS installation, you may notice that they are created automatically.

In this article we will 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 removed.

Purpose of the section

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

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

Many people mistakenly believe that the MSR partition contains the Windows boot loader/boot record (similar to the hidden “ ” partition on the MBR partition). But that's not true.

How did he appear?

MSR (reserved) is created automatically when you partition your hard drive 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 a hard drive using a standard Windows Installer tool

Is it possible to delete?

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

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


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

When we install Windows to empty (unlabeled) hard drive or formatted partition in the usual way - using installation media, we don't need to bother creating EFI-operating system markup. All necessary partitions, in particular the boot EFI, are created automatically if the computer is running in BIOS UEFI. But if you need to install Windows in a different way.

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

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

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

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

It's very easy to create one on an empty hard drive.

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

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

Launch the command line.

Be sure to do this on behalf of the administrator.

We enter one by one:

diskpart lis disk sel disk 1 (instead of 1, indicate the number under which the hard drive 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 drive you need is listed above)

creat par efi size = 100

format fs = FAT32

In the disk management utility we see that on the second hard drive appeared EFI-section on 100 MB. Now we can create a regular section to indicate its type to programs or WinToHDD as a system partition WITH .

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

Who doesn't like the command line to create EFI-To mark up empty media, you can use a graphical interface utility. 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 - "Re-Partitioning".

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

As a result, we get a disk layout with EFI-section on 128 MB and a partition that contains 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 boot EFI-partition after failure or disconnection of the hard drive on which its bootloader previously existed. And there are solutions for this case. To restore a system without a bootloader, we naturally need an environment to perform certain operations. In one case, regular Windows installation media will do. In another case, we will work with a disk space manager, so we will 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 a Windows mirror that is left without a bootloader must first be converted to a basic type. This can only be done by third-party means.

3. Creating an EFI partition at the end of Windows

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

How to launch 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. Boot from the Windows installation media, immediately press Shift + F10. This combination will launch the command prompt. If we use LiveDisk Sagittarius, we start, accordingly, from it.

And already on board we use the command line.

In it we enter:

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

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

Now we can recreate the bootloader.

On the command line, exit :

That's it - Windows functionality 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's done to speed up Windows startup. To UEFI I found the bootloader faster. On SSD such optimization is unlikely to be noticeable, but in the case of HDD you can compete even for a little bit of productivity.

On board LiveDisk Sagittarius let's launch. Click on the system partition and click on the operations sidebar "Change of size".

Pull the slider on the map a little to the right so that in the column below "Unoccupied space in front" several appeared MB. Next, instead of the drawn number, we enter 105 . To make it work 105 MB. Click "OK".

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

We confirm.

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

Here EFI-the section has been created.

All that remains is to recreate the bootloader, as described at the end clause 3 articles.

Most Windows 7 installations include tiny 100MB partitions called `system Reserved', also known as MSR or 'Microsoft System Reserved' partition. For the rest of this article, for brevity I will refer to this section as MSR.

One of the most basic parameters of each air conditioner is its power. The power of the air conditioner is calculated depending on where you intend to install the equipment or depending on the area of ​​the living space. If you install household air conditioners, which in terms of power are not designed to operate in a large room, then in this situation you simply will not be able to obtain proper cooling. Since the system will work to the maximum.
Note: Some OEM installations may have this section title `system` or even `recovery`. In any case, this will be the `Active` partition on the same drive as the `C` drive.

Do I have an MSR partition?

Some OEM Windows 7 installations do not include an MSR partition. To check if you have this partition, run Macrium Reflect and find the partition on the system drive called `System Reserved'.

Note: If `C` drive is your `Active` partition, you just need to backup and restore `C` drive for a complete system recovery.

What does the MSR partition do?

The MSR partition handles the second stage of the boot process after the Master Boot Record (MBR). The MBR is located on the first sector of the disk and is loaded at system startup, after booting control is transferred to the code section of the boot sector of the active partition, this is the MSR partition if it exists on your `C` drive. The MSR contains an `oot` directory containing Boot Configuration Data (BCD). The BCD controls the next step in the boot process and loads the operating system from the C: drive. The MSR partition is always the `Active` partition on the system disk, and must be mounted to the `Active` partition. The contents of this partition will not change, and by default, there is no drive letter assigned in Windows, so you will not be able to change it.

Do I need his image?

The image on the MSR partition is necessary to restore your system in order to move the system to a new disk. However, if you only need to update the system to an earlier date, the MSR recovery partition is not needed, you just need to restore the C drive. This is necessary to restore the Windows 7 partitions to the same location for the BCD to still be able to reference them while loading. If you restore to a new or unformatted drive, and then go to the primary C drive as “primary”. The simplest solution is to use DiskRestore to restore both partitions at the same time. DiskRestore is available in the Windows PE CD rescuer and can be launched from BartPE if you are running the free edition of Macrium Reflect.

Summary

  • You must create at least one image in the MSR partition if one exists on your system. However, the partition will only occupy 100 MB and this is only a small amount to have an image of the entire image of your `C` drive.
  • If you want to restore your system to an earlier point, then you just need to restore the `C` drive (as "primary" is not active), then there is no need to restore the MSR partition.
  • If you are restoring your system to install it on an empty or unformatted drive, you should first restore the MSR partition as the "active" partition, then restore the `C' drive as primary.

In this article, we will show you how to manually recover 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 has helped me out more than once after accidentally formatting or deleting an EFI partition in Windows 10. In this article, we will show you a simple way to manually recreate bootable EFI and MSR partitions in Windows.

So, let's assume that somehow accidentally (or not so accidentally, for example, when trying) the EFI boot partition on a UEFI system (not BIOS) was deleted or formatted, as a result of which Windows 10 / 8.1 / 7 stopped booting, cyclically asking 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 functionality when deleting the partition with Boot Manager without reinstalling the system.

Warning. The instructions assume working with disk partitions and are not intended for beginners. If you misinterpret commands, you may accidentally delete all data on your hard drive. It is also strongly recommended that you back up your important data to a separate media.

Partition structure on a GPT disk

Let's look at what the partition table of a bootable hard drive with GPT markup should look like. At a minimum, the following sections should 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).
  • The main Windows partition is the partition with Windows.

This is exactly the minimum configuration. These partitions are created by Windows Installer when installing the system on an unpartitioned 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), user partitions, etc.

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

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

Manually creating EFI and MSR partitions on a GPT disk

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

Let's launch the disk and partition management utility:

Let's display a list of hard drives in the system (in this example there is only one, disk 0 . Asterisk ( * ) in the Gpt column means that the disk uses a GPT partition table).

Let's select this disk:

Let's display a list of 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 delete the remaining MSR partition so that at least 228 MB of free space remains unallocated on the disk (for MSR and EFI partitions). You can delete the remaining partition using graphical GParted or directly from the command line (that’s exactly what we’ll do).

Select the partition to delete:

Select partition 1
And delete it:
Delete partition override

Let's make sure that only the Windows partition remains:

Now we can manually recreate the EFI and MSR partitions. To do this, in the context of the diskpart utility, run the following commands:

Select a disk:

create partition efi size=100

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

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

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

select volume 1
assign letter=C
exit

Repairing EFI bootloader and BCD in Windows

Once you have created the minimum disk partition structure for the UEFI system, you can proceed to copying the EFI boot files to disk and creating a bootloader configuration file (BCD).

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

Advice. If only the EFI environment files were damaged on the EFI partition, but the partition itself remained in place, you can skip the process of rebuilding partitions using diskpart. Although in most cases it is enough to restore the bootloader according to the article. You can manually recreate the BCD on regular MBR+BIOS systems.

The command returns the GUID of the created entry; in the next command, this GUID must be substituted instead of (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=c:
bcdedit /store BCD /set (default) osdevice partition=c:
bcdedit /store BCD /set (default) path \Windows\System32\winload.efi
bcdedit /store BCD /set (default) systemroot \Windows
exit

We 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. We 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 file EFI\Microsoft\Boot\bootmgrfw.efi on the EFI partition.

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

After all the above manipulations, Windows should boot correctly.

How to repair EFI bootloader of Windows 7 and Windows 10?

In this article we will try to repair the EFI bootloader for Windows 7 /8 /10 . We already looked at it a little earlier. Now let me immediately note that bootloader damage in our case is most often (among other things) caused by:

  • installing a second operating system
  • incorrect system recovery operations (or unsuccessful system completion)
  • deleting some data from hidden sections
  • bad sectors
  • the action of malware.

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

Hidden drive:\EFI\Microsoft\Boot\ BCD

Here, by the way, is its approximate content from:

To be clear...

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

  • EFI– ESP section ( Extensible Firmware Interface) – partition where software with drivers that enable Windows to load is stored;
  • MSR- aka Microsoft Reserved– partition reserved during Windows installation; it may well not be on your machine
  • Primary section– the volume where system files are stored: registry, services, system utilities, settings files, etc.

Windows 10 also adds a disk here Recovery. By default (i.e. when installing Windows on an UNFORMATED disk), the first two partitions have a clear size. And therefore, if necessary, it is easy to isolate them, focusing only on the sizes of both. In Windows 7, for example, this is accordingly 100 MB And 128 MB. And this, as they say, is a typical configuration. Some computer manufacturers create partitions at their own discretion, for example, by putting the Windows PE recovery environment in a file winre.wim. If you find such a file, know that it contains a system recovery image from the manufacturer. Chapter 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), giving it control over loading Windows itself. No section - no download.

The section 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 spare partition that Windows never assigns identification marks to. And it does not contain user data. In Windows 10, MSR partition size is 16 MB(in Windows 8 - 128 MB), file system type – NTFS.

Windows Boot Configuration Data

That the file is at the above address EFI\Microsoft\Boot\BCD is damaged, you may receive 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 boot loader configuration. However, users familiar with the bootloader recovery utility in MFT bcdedit.exe, this time she won’t help out. When trying to launch it, the user will see something unusual:

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

Like, neither the data nor the device itself exists. There is only one reason: since the configuration of the BCD bootloader in UEFI boot mode lies in a special EFI section:

efi partition in Windows 7

efi partition in Windows 10

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

Is yours also misspelled?

How to restore the Windows 10 EFI bootloader: straight to the point.

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

  • load from ;
  • go to the command line by holding down Shift + F10 after the window appears Windows installation
  • as in the previous mode, we need to decide on the list of computer partitions. Next, I assume that the hard drive is installed in a single copy:
diskpart list volume
  • We find the EFI partition. Its dimensions, I repeat, are small ( 100 MB V W7 And W10), and it has a FAT32 file system:

I have EFI - this is the unnamed Volume 3

  • by default it is hidden, which means it does not have a letter. For further work we will need it. So let's assign a letter right now:
select volume * assign letter Y: exit

After closing the program, 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 deny you access to the specified folder. If an error appears, see paragraph Possible mistakes or skip straight to the next part How to restore the EFI bootloader of Windows 7/10: rebuilding the EFI.

I got the Access Denied error right away

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

/f ALL– will copy boot files (both UEFI and BIOS modes) for possible support for booting to 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 without errors, skip the paragraph.

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

We reboot into Windows 10 on the hard drive and check.

Possible mistakes

The administrator may encounter some errors here. Among them, the most frequently appearing are:

  • BFSVC Error: Cannot open the BCD template store. status – –
    you need to check the entered commands and the path to storing Windows system files; sometimes the error appears due to incorrectly specifying the language locale;
  • BFSVC Error: Error copying boot files from Last Error = 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 partition, but also on the system disk; run the hard drive with the utility chkdsk.exe immediately from the console with the command
chkdsk from: /a

where c is the disk with the system

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

How to restore the EFI bootloader of Windows 7/10: rebuild the EFI.

The most important thing here is not to miss the partition/s and do not delete the one in which Windows data and your information are stored. So, once bootrec.exe I couldn’t get into the section we needed, so we’re removing the section. To do this, we will need to return to diskpart.exe, again decide on the partitions and select the one with 100 MB. Returning to the repair console:

Cd/dx:

And we start again:

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=100 list partition select partition 1 format quick fs=fat32 label="System"

But when trying to assign a previously used letter Y, the console refused (it had to be restarted). I'll give the section a letter Z:

Assign letter=Z exit

Let's prepare the ground for bootrec.

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

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

They won’t go anywhere unless you accidentally delete them or they fall into the bad sector zone. It remains...

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

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

The error appears again...

Do not worry. If you have delved into the process and entered all commands consciously and correctly, the situation has most likely already been corrected. You just need to take into account the peculiarities of the unique security filters adopted for the UEFI mode, and not confuse the drive letters. They can be completed by following these steps:

  • Wake up BIOS:
    – remove the side cover of the computer or the bottom of the laptop
    – disconnect the hard drive (by disconnecting both cables on the “stationary” or by removing them from the connectors on the laptop)
    – turn on the machine, waiting for the boot 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 boot partitions; the first one should be, as you understand, EFI;
  • make sure the label Bootable It stands only opposite the EFI partition, and nothing else. Unfortunately, it is not possible to check and correct the situation from Windows PE. And for this you will have to use additional tools in the form of a bootable flash drive. Do this using any convenient option from the article. Boot disk label: how to add or remove?

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

Read: 1,641