Windows 10 + CentOS7 dual system (UEFI + GPT)

Source: Internet
Author: User

Windows 10 + CentOS7 dual system (UEFI + GPT)
Preface

I really want to install the Windows 10 + CentOS7 dual system. However, I have learned a lot from the previous installation failure. I checked a lot of information and finally decided to try again after a week. In general, the installation process was quite smooth, but the problem of Windows guidance was complicated for three days.

If the technology is not good, an alternative dual system will be developed: Windows10 is started by default, Windows Quick Boot is supported, and CentOS is switched under BIOS.

Device information

PC: Thinkpad E431, Microsoft Windows10 Pro 64Bit (10240)
CentOS version: CentOS-7-x86_64-DVD-1511 (this version of CentOS supports UEFI)

Preparations 1. Allocate a CentOS installation drive letter

Directly use Windows disk management and compress the disk to split a space. I switched it out 50 GB.

2. Disable Windows Quick

RunWin+RInputgpedit.msc, Computer configuration-> Management Module-> shutdown, double-click the right side, selectDisabled.

3. Disable Secure Boot

This should be executed in BIOS.

Install CentOS1. UltraISOCreate a CentOS boot disk. 2. Set the CentOS Image Location

Choose USB flash drive to start BISO. The black interface is displayed as follows:

Move the cursor to the first line, and this is not a direct pointInstall CentOS7To configure the CentOS Image Location first, press the Tab key.
After you press the Tab, You can see three lines in English:

setparams "Install CentOS 7" Install    limuze /image/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet      initrdefi /image/pxeboot/initrd.img

This is used to select the image location, because CentOS does not automatically locate the correct location... Therefore, we need to modify the above content first.
① Change the second sentence:

   limuze /image/vmlinuz initrd=initrd.img linux dd quiet

② PressCtrr+xRun the command to view all the drive letters and numbers. Similar to the following:

As you can see, the position of the CentOS image (that is, My USB flash drive) issdb4. Remember this sdb4, and then turn off this interface and try again.
③ Click the graph in step 2 again and press the Tab key. This time, the second line is changed to the following format:

limuze /image/vmlinuz inst.stage2=hd:/dev/sdb4 quiet

Next, pressCtrr+xRun the command to install CentOS. Remember to check a desktop (such as gnome Desktop ).

4. Set CentOS Disk Partitions

After entering the installation interface, select the disk that was cut out.

During CentOS installation, you need to set disk partitions. This involves Linux disk partitions. The following is my settings:

/: 30 GB in size, device type 'lam ', file system 'ext4'/boot: 200 MB in size, device type 'standard partition ', file System 'ext4'/boot/efi: The size is 128 MB, the device type, and the default value of the file system (this efi partition stores CentOS uefi files, it seems that the space is about 10 MB at the end.)/swap: 8 GB in size, device type 'lam ', and file system 'ext4. (it is said that the swap partition is twice the physical memory, but I think the 8 GB memory is too much for it.)/home: The rest of the space is for it. The device type is 'Ls', and the file system is 'ext4'

And then start a long installation ....

Repair Guide

After CentOS is installed, the computer will be restarted. At this time, you will see a System OptionWindows10AndCentOS, SelectWindows10, "Slot! My Win10 is okay. The online scammers have caused me a false shock. Restart and check out CentOS first ". Select CentOS and you will see the following stuff:

"What do you mean when Windows is not started ?"
Then I started my tough journey .....
(Here we omit the heartbleed history of over ten thousand words)
The following is a solution

1. Suggestions from netizens

Use it in WindowseasybcdAfter adding CentOS boot, I tried it many times but failed. In facteasybcdOnly the mbr Boot of CentOS can be added.easybcdAs you can see, I installed it through UEFI, but it should not work.

2. A new approach

① Actually/boot/efiIsESPPartition (UEFI system partition ). It contains the CentOS EFI boot file.

$ ls -R EFI/EFI/:BOOT/  centos/EFI/BOOT:BOOTX64.EFI*  fallback.efi*EFI/centos:BOOT.CSV  gcdx64.efi*  grub.cfg.bak  grubx64.efi*     shim.efi*fonts/    grub.cfg     grubenv       MokManager.efi*  shim-centos.efi*EFI/centos/fonts:unicode.pf2

The most important file isgrubx64.efiDuring boot, the BIOS first finds the corresponding efi program through the ESP partition and then loads the boot system.grubx64.efiIs used to load CentOS.
② Similarly, there must be similar files in Windows. Indeed, when Windows 10 is installed, a hidden ESP partition is automatically allocated, and the drive letter alias isSYSTEM_DRV:

BOOT/EFI/

WhereEFI/Microsoft/BootThe directory contains the efi file for Windows. That isEFI/Microsoft/Boot/bootmgr.efi.
As we can see from the above, the entire hard disk has two ESP partitions. It seems a little unscientific in general sense. I don't know if I can. I think it may be impossible. After testing, I found that every time the BIOSSYSTEM_DRVSearch for the efi program, while the CentOS efi is notSYSTEM_DRVDirectory, which is why CentOS cannot be started.
③ So next I will putEFI/centosCopy the entire folderSYSTEM_DRVDisk/EFIDirectory. I can't restart my computer. The reason is very simple.
A. if you want to select two systems, you need to use Win10 to guide CentOS or a program to guide the two systems. In the former, I found a lot of information and still did not get it out, it seems that you want to modify WindowsBCDFile. The latter is calledrEFindThe Program (rEFind download) can achieve the goal, but the interface is too ugly, I gave up.
B. if you want to use BIOS bootEFI/centosThe path is written to some special files.BOOTICEDownload the BOOTICE tool.

3. BOOTICETutorial

① Open BOOTICE, select UEFI, and clickModify startup sequence


② Select add on the left. Select an efi file for the local disk andStart FileChange

\EFI\centos\grubx64.efi

Start PartitionSelect the same item as Windows.
Finally, move it to the second one and save it.
③ Use PE\EFI\centosMove from the ESP directory of CentOS to the ESP directory of Windows. This step is to make the above settingsStartup File: \ EFI \ centos \ grubx64.efiEffective.
I have to say that PE is a good tool.

Successful

After the above steps, restart the computer, the computer should still automatically enter Win10, becauseBOOTICEThe tool is to add CentOS to the startup sequence of BIOS =
Restart and enter BIOS (Thinkpad is F12). You can see that the BIOS boot list hasWindows10,CentOS,USB HDDWait.USB HDDUSB flash drive, clickCentOSThen you can start CentOS. It is successful here.

Experience

It took me a long time to install this dual system, but I also learned a lot, such as the difference between UEFI and traditional Legacy, the working principle of UEFI, and the role of PE, the final file is not lost, which is a value. The following is a summary.
1. UEFI + GPT dual system installation is really troublesome
2. Microsoft's monopoly mentality is terrible
3. Google search is far more reliable
4. PE is a good tool (entering the disk to modify the EFI file)
5. How is my dual-system different from everyone's? =
(Continue to work ...)

CentOS7 Security tutorial
  1. Notes for installing centos 7 on a USB flash drive
UEFI boot repair

Install CentOS6.4 in GPT mode on UEFI Motherboard

Install Windows 8 and CentOS on UEFI + GPT

A perfect tutorial on coexistence of Windows 10 and CentOS Systems

Two UEFI startup Modes

Use rEFind in UEFI + GPT to implement Win10 + Kali2.0 Dual Boot

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.