Current location - Quotes Website - Signature design - Linux and Windows 10 boot tutorial using grub
Linux and Windows 10 boot tutorial using grub
Last summer vacation, I wrote an article on how to install Linux and Windows 10 dual systems. The reason for writing this article is that it takes a long time to install the dual system, and there is no detailed tutorial on the Internet. Because I was not skilled in writing the tutorial last year, I encountered some problems in the process of using it for more than one year, so I prepared this article "Reconstruction".

Before the course officially begins, take a moment to explain the composition and function of EFI partition.

First of all, after you install Windows, Windows will divide the hard disk into a partition with the size of 100m during the installation process. This partition is called EFI partition, which plays a guiding role. This partition can't be seen in explorer, but it can be seen in disk management, which requires the help of DG tools. Briefly explain, after installing Linux, I mounted EFI to the boot partition screenshot:

As you can see, this partition contains three folders (only two if Linux is not installed), namely Boot, Microsoft and Manjaro, in which the Boot folder is the necessary file for UEFI to start.

Let's continue to open the Microsoft/Boot folder:

These files are necessary to start Windows 10, including language packs, fonts, etc. BCD contains information after Windows starts. Where bootmgfw.efi is the default boot file for Windows.

The above is the file structure of UEFI starting Windows 10. That is, when you press the start button, UEFI first finds the boot folder of the EFI partition, then loads the bootx64.efi file, reads the file information, finds EFI/Microsoft/boot/bootmgfw. EFI, loads the required startup information according to the requirements of bootmgfw.efi, and starts Windows 65438+.

Before the formal installation of the system, we still need to do some preparatory work:

The function of this function is that the power supply is not completely cut off when it is turned off, which is similar to putting the system in a "sleep" state, so that it can be turned on faster. But it also leads to the use of Windows system only.

By default, UEFI firmware loads only those bootstrappers that have been signed. On a traditional PC lacking secure boot function, a malicious backdoor program can load itself and then pretend to be a boot program. In this case, the BIOS will load the backdoor program at startup, so that it can hide itself deeply outside the operating system.

But we have to say that this has caused us a lot of trouble in installing Linux, and it is also the direct reason why we won't be on Linux after restarting to Windows 10.

First of all, we have to turn off this function: enter the BIOS, find the safe boot, select disable, and it will be turned off. Of course, some people will find that the safe boot option is gray when entering the BIOS (for example, mine is), so you need to set a password for your BIOS first, and then you can turn off the safe boot.

All the preparations have been completed, and then you can prepare to burn the USB flash drive. UltraISO is not recommended. After personal testing, floppy disks can only be successfully burned to Ubuntu, and most other distributions will fail. Recommend "Rufus" and "USBWriter", both of which can be used.

Press f 12 to restart after recording, and select Boot from USB device. For most distributions, as long as you keep pressing the Enter key, you only need to pay attention to one thing: when you choose the location to mount the boot, you must mount it in the efi partition, and nothing else will work.

After restarting, if there is no accident, directly enter Windows 10. Don't worry, Linux has been successfully installed at this time, and we only need to replace the boot file.

First open the EFI partition with DG, and you will see an additional folder whose name depends on the distribution you have installed. I installed Manjaro Linux, the name is Manjaro. After opening, you will find a file named grubx64.efi, which is the boot file for starting Linux. Similar to bootmgfw.efi of Windows 10, we want to replace bootmgfw.efi with GRUBx64.efi boot, so that we can boot with grub. Steps:

At this point, if you have installed most distributions except Arch, it's none of your business. You made it. Enjoy it!

After booting up, you will find that booting to GRUB usually includes at least three options (taking Manjaro as an example): Manjaro, Manjaro Advanced Options and Windows Manager. This means that you have solved the dual system startup problem of Windows and Linux perfectly.

I found this when I installed Arch Linux. The installation process of ARCHLINUX is manual. When writing GRUB, you will not be able to scan the partition where Windows Manager is located (of course, not everyone will encounter it), so you may not see the Windows Manager option in the GRUB interface. Windows 10 cannot be accessed, so you need to edit GRUB information manually here. We opened the file /boot/grub/grub.cfg and found that there was no startup information for Windows 10, so we added the following:

note:

Here, $hints_string represents the terminal executing the command:

After output;

$fs_uuid stands for:

The output of.

Then save it. Execute the command at the terminal: sudo grub-mkconfig-o/boot/grub/grub.cfg, and it will be OK.

At this point, Arch Linux and Windows 10 dual systems have also been configured.

In this more than a year of use, I encountered the following problems:

Finally: I wish you a pleasant use.