How does dual system remove Linux, restore Windows from MBR boot booting?

Source: Internet
Author: User

Well, there are more and more people who are willing to try Linux now. Normally, if you have Windows installed on a computer, and then install Linux, the Linux grub boot program will overwrite the original Windows bootstrapper stored in the MBR. If after installing Linux, the user deletes or formats the partition of Linux/boot, it will cause the grub to fail to find Windows through the Grub configuration file of the original Linux/boot and will not start windows! (This statement is not rigorous, so the explanation is only understandable.) The simple principle of MBR and this part, I will explain at the end of this article)

OK, know the consequences, but in case I do not like Linux, there is no regret medicine? Did I install Windows and Ubuntu or other Linux and I couldn't get back to the only Windows? Of course not! As Yang said, the real reason why the reboot failed to enter Windows after removing the Linux partition is that grub in the MBR needs to read the configuration file from the Linux/boot directory to find Windows, because the Linux partition is deleted. The configuration file under the boot directory was deleted, so grub could not find the configuration file and could not locate windows, so it couldn't get into windows. Knowing the reason, we can draw two ideas to solve the problem: 1, try to get grub to find windows;2, replace grub, and switch to Windows ' own boot program.

The first idea is that because grub-initiated files have been deleted and the Grub boot program installed in the MBR is very limited, there is no way for grub to find Windows.

The last one is out of the way, only by the second way of thinking, that is, try to put the Windows boot program back into the MBR. There are two reliable ways to do this:

Method One: Rebuild MBR using mbrfix under Windows

The only way to use this method is if you are about to delete or have deleted the Linux system and have not restarted the Windows system is still running. We can easily write the Windows bootstrapper to the MBR with a gadget. Click here to download Mbrfix. Download after the decompression, there are 3 files, "Mbrfix.htm" is the detailed use of the documentation, "MbrFix.exe" is applicable to 32-bit system programs, "MbrFix64.exe" is applicable to 64-bit system programs. We copy one of the programs to the C packing directory according to the current system. Then open a command prompt (available from start, run, enter cmd, OK to open), and then enter the following two commands:

CD c:mbrfix/drive 0 fixmbr/yes/* If 64-bit system Enter mbrfix64/drive 0 Fixmbr/yes */

This allows the MBR to be rebuilt. And if you have restarted, unable to enter Windows, please look at the following method two.

Method Two: Rebuilding the MBR with the Windows installation CD

Here we need the same prop, which is a Windows XP or Windows 7 installation CD. We boot from the CD and then:

If you are using an XP installation CD:

When you enter the first interface (press "enter" to install, press "R" to go to "Recovery Console"), press "R" to enter the console, after a while ask you to choose which system to repair, enter the Windows system number to be repaired, then enter the administrator password (if not set a password to continue to enter). After the "c:windows>" prompt appears, enter the following command, carriage return, and enter "Y" to rebuild the MBR by entering:

Fixmbr

Once the rebuild is complete, we exit can reboot into the Windows system by typing.

If you are using the Win7 installation CD:

Enter, after selecting the language and other settings, click Next to enter the next screen, do not click "continue to Install", but click "Repair Computer" below. Then you need to wait a while, then select the first item in the interface that appears, click "Next", then click "Command Prompt" and enter the following command to rebuild the MBR:

Bootrec/fixmbr

Once the rebuild is complete, we exit can exit the command prompt by entering and then click "Restart" to enter the Windows system.

Principle:

OK, at the end of this article, let's take a brief look at how the whole thing works.

First, what is MBR? MBR (Chinese name "Master Boot Record", English full name "Master Boot Record"), it usually exists in the 1th sector of the disk, the size is only 512Byte. The most important of these are two parts, one is the bootloader or a pointer to the boot program in the partition boot record, and the other is the partition table. Linux is commonly used by the boot program is "Grub", and WinXP's boot program called "NTLDR", WinVista and Win7 called "BCD."

If we installed the Windows7 and Linux in a computer, and install the Grub boot program in the MBR when installing Linux, then each time we boot into Windows, the boot order is like this: [1], boot grub from MBR, Grub reads the boot data from Linux (saved in "/boot"), [2], lets the user choose whether to enter Linux or Windows, if Linux is selected to start [3], if you choose Windows to start [4];[3], directly from the boot data boot Linux, end; [4], according to the boot data to find BCD/NTLDR;[5],BCD or NTLDR and then according to their own settings, directly start Windows or other boot.

Conversely, if we installed Linux and then install Windows, because Windows will be installed in the original MBR in the grub overwrite, so we install after Windows restart, will not go to Linux. (Supplemental: The Linux installation will automatically recognize the Windows system when setting grub and write to the boot file, while Windows will ignore the existing Linux installation without ignoring it.) Visible Microsoft's monopoly mentality! )

How does dual system remove Linux, restore Windows from MBR boot booting?

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.