Computer lessons

What is an esp hard drive label. What is the "MSR (Reserved)" section for? Partition structure on a GPT disk

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 bootloader 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.

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 configuration of disks 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.

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

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 boot loaders.

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!