How to fix GRUB after XP and UBUNTU are reinstalled on both systems

Source: Internet
Author: User
Article Title: How to fix GRUB after XP is reinstalled on XP and UBUNTU systems. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

After xp is reinstalled, the mbr is written by xp, causing grub to fail to work. solution:

Start from CD-ROM and start from Live CD to desktop.

Open the terminal or switch to a tty (Ctrl + Alt + F1 ).

Input: sudo grub
Input: find/boot/grub/stage1 # Some people say this step is not needed, but I personally think this step should be added.
Input: root (hd0, x) # enter the data fed back by the find command
Input: setup (hd0) # Write (hd0, x) If you want to use xp for multi-system boot)
Enter quit # To exit grub.
Restart. If there is no accident, congratulations! You can see the dual-System Boot of XP and UBUNTU. ^_^

---------------------------------------------------------------------------

How to retrieve Ubuntu after windows XP is reinstalled

First download GRUB for Dos

Install and download the Ext3 partition Access software (with Ext2Fsd or explore2fs)

After running, copy all the Boot folders in the ubuntu root directory to drive C.

After restarting, select GRUB in the boot menu to go to ubuntu.

Key Point: GRUB for Dos is required for ubuntu linux. Therefore, this line is displayed in C: \ BOOT. INI:

C: \ GRLDR = "GRUB" ext3

The boot folder under the partition contains a bootable file, which needs to be placed in the c root directory.

Bytes -------------------------------------------------------------------------------------------------------
1. Use livecd (highly recommended)
2. Use? Cd
3. Use grub4dos
4. Use grub ??

1. Use livecd (highly recommended)

What do you like? G linux livecd (for example, ubuntu 6.06 desktop cd)

Enter:

Code:

Sudo su

Grub

Code: grub>

Enter:

Code:

Root (hdx, y)

Setup (hdx)

Please do not enter them all the same! Understand the meaning of these commands.

Hd indicates the hard disk in the format

(Hd hard drive number, partition number)

Starts from scratch.

So (according to daily habits, count from 1 ),

(Hd0, 0) indicates the first partition of the first hard disk,

(Hd0, 1) indicates the first 2nd partitions of the hard disk,

(Hd1, 4) represents 2nd partitions of 5th hard disks.

(Note: In linux, hda1 is used to represent the first partition of the first hard disk. Do not mix it with the representation in grub .)

Root (hdx, y) (hdx, y) is the partition of the/boot directory.

(Normally, it is the partition where you install the ubuntu system, unless/boot is separated during installation .)

If you do not know which partitions you have installed ubuntu in, you can enter root (hd0, press the Tab key to complete.

(Suppose you have installed ubuntu on the first hard disk) after you press the tab, you will see some information about each partition.

Generally, you can see where your ubuntu system is installed by the partition size and format.

Usually setup (hdx) is setup (hd0 ). (Most of you have installed ubuntu on the first hard disk .)

Note that do not enter setup (hd0, 0 ). I have made this mistake.

(If you do not copy the command and operate it by memory, you may make this mistake .)

Last, use

Code:

Quit

Exit grub, heavy? Convert to y.

[1] [2] [3] Next page

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.