Fix the Ubuntu boot partition after Windows XP is reinstalled.

Source: Internet
Author: User

The day before yesterday, my windows xp crashed, So I re-installed xp and rushed out the original Ubuntu boot Partition Table mbr. But it doesn't matter. Fix mbr.

First, let's talk about the role of mbr: when we start the computer. The computer first runs Power On Self Test (POST), that is, Power-On Self-check. POST checks the overall memory of the system and the status of other hardware devices. If the BIOS of the computer system (Basic Input/Output System) is out-of-the-box, the computer hardware device will be inspected and configured. The computer's Basic Input/Output System (BIOS) locates the computer's Boot device, and MBR (Master Boot Record-Hard Disk dominant Record) is loaded and run. If you only install Windows 98, it is automatically booted to the desktop. If it is Windows XP/2000/2003, the control is handed over to the NTLDR-system loader, And the Boot. ini is called to display multiple menu files. To wipe MBR is to wipe the boot records of the hard disk.

After windows is reinstalled, grub cannot be started because the hard disk mbr is overwritten, that is, grub information in the original mbr is cleared, and linux cannot be guided, at this time, many people may only have to reinstall linux, but in fact they only need to simply fix mbr.

The following describes how to fix mbr:

First, put the Ubuntu installation CD in, and then start. normally enter the installation interface, open the terminal:

1. Input: sudo grub, so it becomes
Grub>

2. First find the boot partition of your ubuntu (that is, the partition of your/boot directory)
Input: find/boot/grub/stage1
After I press enter on the machine, the following figure is displayed: (hd0, 2) hd0 indicates the first hard disk, and 2 indicates 3rd partitions, that is, the partition where the Ubuntu root directory is located (0 indicates the first partition ).

3. Input: grub> root (hd0, 2)

4. Input: grub> setup (hd0)
If successed appears, it indicates that it is successful.

5. Enter grub> quit and restart.

For friends with multiple hard disks, please note that if your windows disk is installed on the first disk and linux disk is installed on the second disk, if your bios is set to start from the first disk, you must set the parameter to your first disk during the above steps. You need to mount grub into the mbr of the boot hard disk. Of course, you can mount grub into the mbr of each hard disk, this is just a matter of order

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.