After windows is reinstalled, ubuntu9.10 can repair grub.

Source: Internet
Author: User

Boot to the system with ubuntu9.10

Step 1: Enter the following command:
Sudo-I
Fdisk-l
The result is as follows:
Disk/dev/SDA: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0xf0b1ebb0

Device boot start end blocks ID system
/Dev/sda1*1 3246 26073463 + 7 HPFs/NTFS
/Dev/sda2 3247 38771 285354562 + F w95 ext 'd (LBA)
/Dev/sda3 38772 38914 1135960 12 Compaq diagnostics
/Dev/sda5 3247 14720 92164873 + 7 HPFs/NTFS
/Dev/sda6 14721 26194 92164873 + 7 HPFs/NTFS
/Dev/sda7 26195 37242 88743028 + 7 HPFs/NTFS
/Dev/sda8 37243 37485 1951866 82 Linux swap/Solaris
/Dev/sda9 37486 38771 10329763 + 83 Linux
Step 2: Find the LINUX partition, not the swap partition. For example, if my computer is sda9 or LINUX partition
Step 3: Enter the following command:
Mount/dev/sda9/mnt
Grub-install -- root-directory =/mnt // DEV/SDA
Step 4: You may not be able to start Windows.

After the above steps, I found that grub was in progress, but windows was not in progress. It is a real tragedy. But it does not matter. We still have Ubuntu to guide the Windows system. After entering Ubuntu, we need to set grub.

1. You must have the permission to modify grub. You can use the following command to set the permission:

Chmod + w/boot/GRUB/grub. cfg (modify the operation permission of the grub. cfg file)

2. Open the grub. cfg file:

Gedit/boot/GRUB/grub. cfg

3. Finally, modify the Windows Option
Menuentry "Microsoft Windows XP Professional "{
Set root = (hd0, 1)
Search-no-floppy-FS-UUID-set 4a807ca0807c93e3
Drivemap-s (hd0) $ Root
Chainloader + 1
}
Modify:
Menuentry "Microsoft Windows XP Professional "{
Set root = (hd0, 1)
Chainloader + 1

4. Save the changes and exit Ubuntu to go to Windows.

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.