This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12093|Reply: 1

[windows] Easily teach you how to create XP+Linux+Win7 three-system tutorial

[Copy link]
Posted on 4/9/2015 8:58:52 PM | | |

Easily teach you how to create XP+Linux+Win7 three-system tutorial
In fact, the core problem of multi-system boot is how to boot, so it is common to encounter two operating systems installed, but find that they cannot be booted, or after reinstalling one operating system, the other system cannot boot
So let's talk about guidance first
Let's assume that the installed operating systems are all Windows series, such as Win98, Win XP, and Win 7
Then, there is a principle that the oldest system is installed first, such as installing win98 first, then xp, and then installing win7.
The reason is actually very simple, we can think like this, when Microsoft developed win98, the development of XP has not yet begun, so the boot boot of win98 definitely does not support xp, and when developing xp, considering the principle of forward compatibility, its boot boot device must be more and more advanced, and it will definitely be able to support the predecessor, and even the previous operating systems.
The win7 operating system installed at the end can boot the previous operating systems (theoretically supports win98)

Okay, now to complicate the problem, let's introduce operating systems under other platforms (not developed by Microsoft), such as Linux operating systems (here is a brief explanation of the CentOS distribution)

XP, Win7, and Linux, how can they be installed on a single machine?

First we consider xp, and win 7, when there are only these two, we install xp first according to the principle of installing the old system first,
Then install win7, so that after starting, through the boot mechanism of win7, we can successfully boot these two systems

Now we are going to introduce the Linux operating system, which is another platform, first of all it is necessary to understand the boot mechanism of Win7 and Linux operating system

Win7's bootstrapping mechanism:
Win7 (including Vista), boot using bootmgr (boot manager).
The boot process of a computer with win7 can be simply summarized as follows
Power-on---- BIOS self-test---- reading the master boot record MBR------Bootmgr takeover---- BOOTMGR reading bcd file (Boot Configuration Data") --- loading kernel - system boot
So you can see that bootmgr reads the bcd file for system boot

Linux boot mechanism:
There are many distributions of Linux, such as Red Hat, Red Flag, etc., here is CentOS as an example
The boot process after the computer with CentOS is turned on can be summarized as follows
Power-on----BIOS self-test---- reads the main boot record, MBR-----grub takes over---- grub reads the data in the configuration file menu.lst----- loads the kernel - system boots

You can see that the difference between the two is that one uses bootmgr and the other uses grub (the earlier one is useful LILO, which is not in the scope of discussion), and the result is that the system kernel is loaded through them, while bootmgr and grub are generally installed on MBR (special cases will be discussed later)



OK let's say we have XP installed, and Win7, in this case, we use Win7's bootmgr to boot the system, and there will be options on its boot menu, such as: boot the earlier Windows version and the option to boot Windows7, so that we can boot the corresponding system by selecting different options (note that bootmgr is installed on the MBR of the hard disk here)


Now we install centos on this basis, (if we install grub on the hard disk MBR, this will rewrite the hard disk MBR, we can think that we have replaced the original bootmgr with grub), grub should be able to successfully detect the existence of xp and win7, so there will be three options on its boot menu for us to choose from (theoretically), so the three systems coexist.

We came to the conclusion that xp first, then win7, and finally centos (linux)



-------------------------- more complex situations------------------------

If you are already dizzy now, then it is not recommended to continue reading.
I encountered a more complicated situation, because I installed xp first, then centos, and then grub of centos
installed on MBR, so if I install win7 again, bootmgr will replace the original grub (rewrite MBR),

Microsoft's bootmgr is not as smart as Linux, more SB, it only recognizes its own brothers, so XP can recognize it, CentOS can't, what is the solution?

There are two solutions here

1: Install xp first, then install centos, no problem, but centos grub must not be installed on MBR (to prevent it from being rewritten when installing win7), you can mount it under "/", and then continue to install win7, bootmgr still can't find centos, enter win7, download the easybcd software, open easybcd, in add/remove entry, select linux, Type select grub, add the name you want to Name, write any one such as centos, Driver select the partition where linux is located. The partition selected here should be the same as the location of the grub installation when Linux was installed just now. Finally, add entry is saved, and you can see two options in view settings, one is the original win7, and the other is the option you just built.
Finally restart, and it's OK

Two: But I installed the grub of centos on the MBR, and when I installed Win7, the MBR will definitely be rewritten, what should I do? ? The answer is simple, backup !!

1. First enter centos, open the terminal,
Enter dd if=/dev/sda 0f=/root/centos.mbd bs=512 count=1
This command is used to back up mbr, here I will back it up to the centos.mbr file




2 Then enter the XP system (XP+CentOS at the beginning, Win7 installed last), and install Win7 on the hard disk

3 After win7 was installed, the mbr was rewritten, and bootmgr reoccupied the high ground, but this sb didn't know centos, only xp, so we had to force it to know!

Go to win7 and copy the previously backed up centos.mbr to the system directory, I am here on the H drive
Run cmd in administrator mode
Run the following command with this
bcdedit /create /d "centos 5.4" /application bootsector

The command result should return a GUID that subsequent commands will use

Run the following command to set the partition where the Linux boot sector backup is located:

bcdedit /set {GUID} device partition=H: (I am here on H disk)

Then specify the path to boot the sector backup:

bcdedit /set {GUID} path /centos.mbr


After the command is completed, restart, you should see that there is more Linux in the boot options.



Restart, done!!
Three options appear in the bootstrap menu
1: Previous versions of Windows systems
2: Start your Windows 7 system
3: centos 5.4
Select the corresponding menu to enter


We can compare it like this:
The core of this article can be summarized in the following words that there used to be a big family, there were three families, one was called win7, one was called linux, and one was called xp, all three of them lived in a place called hard drive, win7 family had a son called bootmgr, linux family had a son named grub, xp family son was the most 2b, always followed them, no right to speak.
The family needs someone to manage, so the three sons compete for the right to manage, the son of the XP family is the most useless, only knows to follow the other two, first exclude,
Both bootmgr and grub are people with some skills, and both are qualified to manage the entire family
There is a mysterious place in the family called MBR, and it is said that whoever finds out and occupies this place has the right to control the entire family
Suppose bootmgr controls this place, but bootmgr is an megalomaniac who does not recognize the status of the Linux family after having the right to manage, but only recognizes the XP family that is closer to his blood
Assuming that grub controls this place, grub is much better, and after becoming an administrator, he still recognizes the status of the three families and admits that the three are inseparable wholes of the hard drive
We want the family to be well managed, so the answer is simple

One: Let grub, the son of the linux family, occupy MBR and control the entire family (so install xp first, then win7, and finally linux)
Two: We can also let bootmgr, the son of the win7 family, occupy MBR, but considering his arrogant nature, we have to force him to give orders and recognize the status of the linux family (so give him orders through the girl of easybcd, who made bootmgr always like easybcd).




Previous:How to turn on slow query logging in Mysql
Next:Database Design Principles (Reprint) Fourteen Tips
Posted on 11/21/2018 8:40:36 PM |
Study hard~
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com