In the dual system, how does one Delete Linux and restore Windows from MBR boot ?, Linuxmbr

Source: Internet
Author: User

In the dual system, how does one Delete Linux and restore Windows from MBR boot ?, Linuxmbr

Well, more and more people are willing to try Linux now. Generally, if Windows is installed on a computer and then Linux is installed, the grub boot path of Linux overwrites the original Windows boot program stored in MBR. After Linux is installed, if you delete or format the partition of Linux/boot, after the restart, grub cannot find Windows through the grub configuration file under the original Linux/boot, and Windows cannot be started! (In fact, this statement is not easy to understand. I will explain the MBR and its simple principles at the end of this article)

OK, I know the consequences, but if I don't like Linux, do I regret it? Is it because I have installed Windows, Ubuntu, or other Linux, and I cannot switch back to the original unique Windows? Of course not! As mentioned above, the real reason why Windows cannot be started after Linux partition is deleted is that grub in MBR needs to read the configuration file from the/boot directory of Linux to find Windows, because the Linux partition is deleted, the configuration file under the/boot directory is deleted, so Windows cannot be found because grub cannot find the configuration file, so it cannot enter Windows. After understanding the cause, we can come up with two ideas to solve the problem: 1. Try to find Windows for grub; 2. Replace grub with your own boot program for Windows.

The first idea is that the grub boot file has been deleted, and the grub boot program installed in MBR is very limited. Therefore, there is no way for grub to find Windows.

The last one failed, so I had to think of the second way, that is, try to install the Windows boot program back to MBR. Two reliable methods are provided:

Method 1: Use MbrFix to reconstruct MBR in Windows

To use this method, you must delete or have deleted the Linux system,And has not restartedWindows is still running. We can use a small tool to easily write Windows boot programs into MBR. Click here to download MbrFix. The downloaded decompressed file contains 3 files. The detailed instructions are provided. The parameter mbrfix.htm.exe "is a 32-bit system program. The parameter mbrfix64.exe" is applicable to 64-bit systems. Copy a program to the C root directory based on the current system. Then open the command prompt (you can choose "start"> "run" and enter "cmd"> "OK"), and enter the following commands in sequence:

Cd c: MbrFix/drive 0 fixmbr/yes/* if it is a 64-bit system, enter MbrFix64/drive 0 fixmbr/yes */

In this way, the MBR reconstruction is complete. If you have restarted and cannot enter Windows, please refer to method 2 below.

Method 2: Use the Windows installation disc to recreate the MBR

Here we need an installation CD for Windows XP or Windows 7. Start from the CD. Next:

If you are using an xp installation disc:

When you Enter the first interface (Press Enter to install, press R to Enter Recovery Console), and press R to Enter the console, after a while, ask you to select the system to be repaired, enter the Windows system number to be repaired, and enter the administrator password (if no password is set, press enter again ). After the "C: WINDOWS>" prompt appears, enter the following command, press enter, enter "y", and press enter to recreate MBR:

fixmbr

After reconstruction, we enterexitYou can restart Windows ~

If you are using a win7 installation CD:

After selecting the language and other settings, click Next to go to the next page. Instead of clicking "continue installation", click "repair computer" below ". Wait for a while, select the first item in the displayed interface, click "Next", then click "command prompt", and enter the following command to recreate MBR:

bootrec /fixmbr

After reconstruction, we enterexitYou can exit the command prompt and click "restart" to enter the Windows system ~

Principle:

OK. At the end of this article, let's take a brief look at the principle of the entire process.

First, what is MBR? MBR (the Chinese name is "Master Boot Record"), which usually exists in 1st sectors of the disk and has a size of only 512 bytes. There are two main parts: one is the pilot program or the pointer pointing to the pilot program in the "Partition Boot Record", and the other is the partition table. Currently, the commonly used Linux boot program is "grub", while the winXP boot program is called "NTLDR", and WinVista and Win7 are called "BCD ".

If Windows 7 is installed on a computer, and then Linux is installed, and the grub boot program is installed in MBR, every time we start Windows, the boot sequence is as follows: [1], starting grub from MBR, grub reads Linux boot data (stored in "/boot"); [2], choose whether to enter Linux or Windows. If you select Linux, start [3]. If you select Windows, start [4]; [3]. start and end Linux based on boot data; [4]. Find BCD/NTLDR Based on the boot data; [5], BCD or NTLDR and start Windows or perform other boot based on your settings.

If we first install Linux and then install Windows, since Windows will overwrite grub, which originally exists in MBR during installation, We will restart Windows and cannot enter Linux. (Supplement: When grub is installed in Linux, Windows is automatically identified and written to the boot file. However, Windows ignores existing Linux while installing grub. The monopoly mentality of Microsoft !)

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.