Re-creating boot efi msr win7. How to manually create a bootable Windows EFI partition on a GPT disk. Managing UEFI Bootloader with eifbootmgr

24.06.2020 Data recovery

In this article, we will show you how to manually recover an accidentally deleted bootloader. Windows 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 operating systems Microsoft 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 highly 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:

  • System EFI 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 sections containing, for example, the environment Windows recovery in file winre.wim(), a partition with a backup system image from the manufacturer (allows you to roll back to original state 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 for Windows boot. 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, let's boot from installation disk and on the installation start screen press the key combination Shift+F10 . A window should open command line:

Let's launch the disk and partition management utility:

Let's display a list 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 remain unallocated on the disk free space(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 section with Windows already drive letter assigned 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

After you have created the minimum disk partition structure for the UEFI system, you can proceed to copying boot files EFI 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 configuration Windows boot loader 10 / 7:

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.

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” sections. At breaking down hard disk to local partitions during OS installation, you can note 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 bootloader/bootloader. Windows entry(similar to the hidden “ ” section on the MBR markup). 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 hidden partitions when partitioning a hard drive standard means Windows installer

Is it possible to delete?

Despite the fact that this is hidden system partition does not contain an 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 it is possible in the future, when you need to do something with your local disks, for example, or vice versa, it may not be possible to compress any of them due to the missing MSR (reserved).

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 thank the author of the article - repost it on your page

When we install Windows to empty (unlabeled) HDD or a 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 to another hard drive with its own independent bootloader, if there is a question about restoring the system after deletion hard drive with a 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. At normal installation from the 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 a medium without markup or 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 simplest and quick way- 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 things 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.

System partition (EFI or ESP system partition).

The computer must contain one system partition on the disk. On EFI and UEFI based systems this partition is called the system partition EFI or ESP. This partition is usually stored on the main hard drive. The computer boots from the system partition. The minimum size of this partition is 100 MB and it must be formatted using the FAT32 file format. This partition is managed by the operating system and should not contain any other files, including Windows Recovery Environment tools. The standard disk configuration in GPT layout on a UEFI system is shown in Fig. 1.

Rice. 1.Example of disk partition configuration on a PC with UEFI.

An EFI partition (ESP) formatted in FAT32 is required for GPT partitioning on UEFI systems. The standard EFI partition size is 100 MB, but on 4K Native Enhanced Format drives (4KB sectors) it is increased to 260 MB due to FAT32 limitations. PC manufacturers may store some of their tools on this section, so its size varies depending on the manufacturer.In GPT partitioning, the EFI partition performs one of the roles assigned to the System Reserved partition in MBR partitioning. It contains the boot configuration store (BCD) and the files needed to boot the operating system.

Basics principles of construction and operation of a file system based on FAT-32.

1) Each element of the FAT table (starting from the second) corresponds to a cluster in the data area with the same number.

2)Number initial file cluster indicated in catalog line, defining File. Thisnumber is also a link to the FAT table element that contains number next file cluster,and is a link to the FAT table element that contains the file's next cluster number etc.

3) A cluster is a continuous sequence of sectors (fixed size). This is an addressable "portion" of a file.

4) Code in FAT table element may still determine free cluster, defective cluster And end-of-file sign.

5) File in the FAT section - this is a sequence of clustersspecified usingdirectory strings and FAT table entries.

6) All operating systems can work with a FAT-32 partition (the main factor in using FAT-32 in ESP).

As a result high-level partition formatting, recording system information in row data blocksinitial sectors of the partition, is created logical drive (volume) file system type FAT32, which consists from three main areas( rice. 2) , arranged in the following order:

- “reserve” area (area of ​​reserve sectors);

- file allocation tables area (FAT1 and FAT2);

- area of ​​files and directories (data area).

Root directory is stored in the data area as a regular file and can be expanded as needed.

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

What have I done?

  1. Booted from installation Windows disk 8.1 and searched for the installed operating system with the command bootrec /RebuildBcd, error " Scanning installed systems Windows completed successfully. Total number of detected Windows systems: 0»
  2. Deleted a partition (300 MB), an encrypted (EFI) system partition containing all Windows 8.1 bootloader files using the command del vol, then applied Automatic recovery boot, the system re-creates this partition, but does not boot. I made this section active in the command line, which also did not help.
  3. I entered commands that were successful, but Windows did not load.

    bootrec /FixMbr

    bootrec /FixBoot

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

I don’t know what else to do or how to restore the Windows 8.1 bootloader. Maybe you can give me some advice?

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 tools to restore the bootloader, then you can delete the system responsible for booting: 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 encrypted (EFI) system partition 300 MB, MSR partition 128 MB visible only in the command line when entering the command"lis par".

Note: If you do not have experience, do not perform this operation unless necessary, use other methods from the about section first. If you want to experiment on a working laptop, then do not start working without first creating backup of these sections, or better yet, create a .

We will delete and recreate partitions:

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

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 GPT disk partitioning.

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

A command line window opens, enter the commands:

diskpart

lis dis (lists physical disks).

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

lis par (shows 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

That's it, we deleted all three hidden sections.

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

Section 4 - installed Windows 8.1

Section 5 - hidden section restore to factory settings.

We create a new encrypted (EFI) system partition of 300 MB, as well as a 128 MB MSR partition

Enter the commands:

diskpart

lis dis (display a list of disks).

sel dis 0 (select the laptop hard drive).

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

format fs=fat32 (format it in file system FAT32).

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