esp section. Installing Linux on UEFI

Before the operating system starts loading, specialized computer software initializes all components, checks their readiness for operation, and only then transfers control to the OS loader.

Previously, a set of BIOS programs was used for these purposes, but this standard is now considered obsolete, and it has been replaced by UEFI technology, which supports secure boot, has a nice graphical configuration interface and many other advantages. Most modern motherboards and laptops are already available with UEFI. In this article we will look at how to install Linux on UEFI and what problems you may encounter.

This is an option for owners of UEFI cards who do not want to understand the intricacies of using this technology and agree to use their device as before with the BIOS. Most motherboards allow you to emulate BIOS mode. In this mode, you can install Linux without any problems and additional partitions, as it was done in the BIOS.

To enable Legasy BIOS mode, you need to enter the BIOS/UEFI settings using the F2, Del or Shift+F2 button and find the corresponding item there. For example, for me this item is on the Boot tab. Here you need to select UEFI or Legasy boot mode.

After saving your settings, you can install your operating system as usual. If you are not satisfied with this option, then we will look at how to install Linux on UEFI.

Installing Linux on UEFI boards

I will look at installation using Ubuntu as an example, but all steps are similar for other distributions. First you need to burn the disk image to a flash drive. Most distributions already support UEFI booting.

Step 1: Burn Linux to UEFI Flash Drive in Linux

To write an image to a flash drive in Linux, it is better to use the Etcher utility. The program will write media that can be booted into both UEFI and a regular system. After starting the program, you need to select the system image:

Then the memory card and wait for the recording to complete:

You can also write the image to a flash drive manually. This is easier than for a regular BIOS, although it will require more steps. First, format your media to FAT32. This can be done in the standard Gnome Disk Management utility:

Then unzip the contents of the installation image to the root of the flash drive:

sudo mount /path/to/image.iso /mnt
sudo mount /dev/sdb1 /media/flash/
sudo cp -r /mnt/* /media/flash

Here /dev/sdb1 is the name of the partition of your flash drive. You can do all these steps in the file manager. It is not necessary to use commands. Next, you need to install two flags on the partition of the flash drive where you unpacked your files - boot and lba. This can be done using Gparted. Just run the program, select your flash drive in the list of disks:

Right-click on the partition, select Manage Flags and check the boxes next to the boot and lba flags.

Whatever method you use, your flash drive is ready and you can boot from it. Most Linux images already contain an EFI bootloader and the computer's firmware will find it the next time it reboots.

Step 1 (alternative). Burning Linux to a UEFI flash drive in Windows

If you decide to burn Linux on Windows, then it is better to use the Rufus utility. It is necessary to set the following parameters:

  • Partition layout and system interface type: GPT for computers with UEFI;
  • File system: FAT32.

All other parameters are default. Once recording is complete, your flash drive is ready for use.

Step 2: Select Boot Order

In order for your system to boot from the flash drive you just recorded, you need to disable UEFI Secure Boot. This mode allows only signed operating systems to boot, and only Microsoft operating systems are signed. Therefore, for Linux this mode must be disabled. I also have this setting on the Boot tab:

In addition, you need to install the flash drive in the first place:

After this, you can restart your computer and begin installation. If you see a window like this, then everything is fine. Here you need to select "Try Ubuntu without installing", this is a prerequisite:

I will not describe all the installation steps that need to be completed, they are no different from installing a regular OS, the only difference is installing the bootloader and disk partitioning. We will dwell on it further.

Step 3. Disk partitioning for UEFI

UEFI has several differences from BIOS in this regard. The first is the use of a GPT disk partition table. This is a new technology that has many advantages over MBR, including a very large number of primary partitions (MBR has only four), recovery from damage, and much more. Read more about this in a separate article. The second difference is that the operating system boot loader files are no longer stored in the first 512 bytes of the hard drive. All of them are stored on a separate partition called ESP.

Before you click "Install Ubuntu" It is advisable to prepare the disk using Gparted. Open the utility from the main menu of the image. Then select Device -> Create Partition Table:

Select GPT partition table from the list:

Step 4: Create an ESP partition

In Gparted we only need to create an ESP partition for UEFI. To do this, select "Unnoticed", and then right-click on it and select "New":

You must select FAT32 as the file system for the partition, size - 100 megabytes. Next, click the button "Apply" to apply the changes.

Then click "Manage Flags" and check the boxes next to the flags "boot" And "efi".

Step 5. Disk partitioning option

When the system prompts you to select a markup method, you can let the system mark everything up automatically. But this is only if you do not already have any operating system installed. Otherwise we choose "Your version":

Step 6. Assigning partitions

If you chose a different layout option, a menu will open in front of you with a list of all sections. Find the bottom of the window "Device for installing bootloader" and select the partition for EFI from the list.

Then click on the EFI section in the list and select "EFI System Partition":

You can then continue the installation as usual. You need to create a root partition, and you can optionally create a bootloader, swap, and home partition. You can read more about installing Ubuntu 18.04 at.

Step 7: Complete installation

Once all the files are unpacked and the bootloader is installed, the Linux installation on UEFI is complete, you can reboot your computer and use your system as usual.

But let's also look at managing menu items and EFI bootloaders.

Managing UEFI Bootloader with eifbootmgr

When the system boots you can display the default UEFI settings by running the command:

Let's take a closer look at what each of the parameters means:

  • BootCurrent- the bootloader that was used to launch this operating system;
  • BootOrder- the order of bootloaders in which the boot manager will sort them out during system startup. If the first bootloader does not work, the second one will be used and so on;
  • BootNext- a bootloader that will be launched at the next boot;
  • Timeout- timeout during which the boot loader selection menu will be shown before it is selected automatically;
  • Items 0000 - 0004- loaders that can be used.

You can change the boot order using the -o option, for example, let's make the OS from the optical disk boot first:

sudo efibootmgr -o 0,1,2,3

And let's put Ubuntu back in first place:

sudo efibootmgr -o 3,0,1,2

You can change the timeout to display the system selection menu:

sudo efibootmgr -t 20

Here we have set the timeout to 20 seconds.

conclusions

In this article, we looked at how to install Linux on UEFI, as well as how to manage the boot order on the installed system. Now, if you want to install this operating system on your new laptop with EFI, then you already know how to do it. If you have any questions, ask in the comments!

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

The hard drives of most computers running Windows traditionally have two partitions - system and user, at least that's what Explorer shows. In fact, there are more partitions, just some of them are hidden and do not have a letter, which is easy to verify by opening the standard disk management snap-in. The meaning of hiding them, we hope, is clear to everyone. They contain important data.

Deliberate or accidental deletion of which can lead to Windows not working correctly or even being unable to boot.

Another thing is a healthy interest in them, many people would probably like to know what the service partitions of the system are hiding and what the risk is for a user who wants to delete them, say, for the sake of increasing free disk space. By the way, you can still delete service partitions, but 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, which is ensured by separate storage of important system and boot files. However, offline storage of the bootloader is far from the only purpose of hidden partitions; they may contain encryption data BitLocker, image "factory" system, recovery environment, and so on.

Hidden sections first appeared in Windows 7, V XP there was nothing like that; if the system stopped booting, it was simply reinstalled. On Windows Vista a more advanced mechanism was used, in this OS the 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 could already be seen on the disk alone, and in OEM -systems have two service partitions - "Reserved by the system" size 100 MB and an untitled volume ranging in size from 6 before 15 GB, containing an image of the original operating system divided into several parts with "factory" settings - analogous to a full backup created by programs like Acronis True Image .

If you mounted the first one, you would see a folder storing boot configuration files Boot and file download manager bootmgr, on the second volume you would find a standard program Recovery and several original system image files. With the exit Windows 8.1, and then Windows 10 everything has changed a little. Chapter "Reserved by the system" got bigger, got support UEFI, and along with it several more service volumes were added to the disk, including the one required for GPT -disk partition MSR, not showing up in Disk Management. 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 hidden service sections, you may have more. Let's try to enter them, for which we will mount the volumes that interest us using the command. Without leaving the utility, run the following commands:

list volume
select volume 2
assign or assign letter=x

2 in this example, this is the number of the mounted volume, 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 previously turned on the display of hidden objects.

However, this method has a drawback - folders may not be viewable 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 do our hidden sections actually contain?

On disk "Restore" 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 .

Where directories are stored Boot And Microsoft with download files.

In addition to these two volumes, you may have one or two more service partitions. Chapter MSR size 128 MB marked "Reserved" not as important as section EFI, but its removal can also lead to disastrous consequences. Typically it stores data responsible for markup GPT, but it may also contain boot files. Largest hidden section (more than 5 GB) marked "Recovery" contains an image "clean" Windows with original settings. This section appears on OEM -devices with pre-installed OS.

If there is little space left on the disk, 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 a little more than a megabyte can be found on computers updated with 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 your "extra" service section, first think carefully about whether this is really necessary and only then proceed with what you have planned.

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 boot loader ( 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

As soon as we turn on the computer, it immediately starts running a miniature operating system, which we know as BIOS. It deals with testing devices, memory, loading operating systems, and distributing hardware resources. Many of the features of this set of programs (usually about 256-512 KB in size) allow you to support older operating systems like MS-DOS, giving them many features. Since the days of the PC/AT-8086, the 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 dual BIOS, support for network tools and the ability to flash the firmware. But there were a lot of disadvantages: initial entry into the real processor mode, 16-bit addressing and 1 MB of available memory, the inability to have 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. UEFI has been working on some Unix and Windows platforms for a long time, but a mass transition has not yet occurred, despite good intentions. And they are like this:

  • Availability of the notorious console for repairing system parameters and installing the OS;
  • The EFI partition makes it possible to perform some actions without loading the OS (watching movies, playing music);
  • Internet access and, therefore, the presence of installed network drivers, TCP/IP stack, etc.);
  • Presence of graphic mode and user scripts;
  • Support for gigantic disks;
  • UEFI storage on new format partitions (GPT);
  • Full support for all equipment from the moment of launch.

UEFI can use a general-purpose execution engine like the JVM to run hardware-independent code, which opens up enormous possibilities for creating bootable software.

There is also criticism of this technology. In particular, its implementation may lead to cutting off new players from the operating system market: for this purpose there will always be some technological loophole in the code. Like, for example, the inability to boot Windows 98 from modern BIOSes. But what’s worse is that you’ll 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 this. And among them there are probably important programs that there will be no one to rewrite. However, all these issues can be resolved – at least through virtual operating systems. But what is certain is that new types of viruses will appear, and we will be able to see this quite soon.