How to fix grub after XP is reinstalled on Ubuntu dual system (more comprehensive)

Source: Internet
Author: User
UbuntuOn dual systemsReinstall XPPost-fix grub

Reinstall XP After the MBR is written by XP, grub cannot work.
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 XP and Ubuntu Dual-system boot. ^_^

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

How to retrieve Windows XP after Windows XP is reinstalledUbuntu
First download grub for DoS
Install and download the ext3 partition Access software (with ext2fsd or explore2fs)
After runningUbuntuAll the boot folders in the root directory are copied to drive C.
After restarting, select grub in the boot menu.Ubuntu.
Key points:UbuntuLinux requires grub for DOS to boot, so in c: \ Boot. ini, there will be this line:
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 Security CD
3. Use grub4dos
4. Use grub zookeeper

1. Use livecd (highly recommended)
Use any Linux livecd you like (for example,Ubuntu6.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.
(NormallyUbuntuSystem partition, unless you separate/boot during installation .)
If you do not knowUbuntuIn the partitions, you can enter root (hd0, press the tab key to complete.
(Assume that youUbuntuAfter you press tab, you will see information about each partition.
Generally, you can see the partition size and formatUbuntuWhere is the system installed.
Usually setup (hdx) is setup (hd0 ). (Most of youUbuntuMounted 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 and repeat the system.
Now, let's summarize the commands used.
(We recommend that you copy the following code on paper. If you are still confused about the meaning of (hdx, Y), You 'd better copy the above explanations .)
Code:

Sudo Su
Grub
Root (hdx, Y)
Setup (hdx)
Quit

Is it easy? The key is to understand the hard disk partition representation in grub.

2. UseUbuntuServer guard CD recovery
UbuntuDesktop-CD may not be used. You may need 7.10 alternative CD.

1. UseUbuntuInstall CD boot
2. When the "Boot:" prompt appears, type "Rescue" as the boot parameter.
Boot: Rescue
3. Follow the instructions on the screen
4. Assume that the/BOOT disk is located at/dev/hda.
Code:

# Grub-install/dev/hda

The following is another method. Firehare wrote:
1. Start the systemUbuntuInstall CD
2. Run the command on the screen until (never exceed this step)
[!] Fdisk Disks
3. Press 'ctrl + ALT + f2'
4. Press 'enter' to enter the terminal
5.
~ # Mkdir/Ubuntu
~ # Fdisk-L/dev/discs/disc0/disc
~ # Mount <yourUbuntuRoot device location>/Ubuntu/
~ # Chroot/Ubuntu/Sh-2.05b #

6. Assume that/dev/hda1 is the address of the/boot partition.
Sh-2.05b # grub
Grub> root (hd0, 0)
Grub> setup (hd0)
Grub> quit

1. UseUbuntuInstall CD boot
2. When the "Boot:" prompt appears, type "Rescue" as the boot parameter.
Boot: Rescue
3. Follow the instructions on the screen
4. Assume that the/BOOT disk is located at/dev/hda.
Code:
# Grub-install/dev/hda

3. Use grub for DoS
NoUbuntuYou can use grub4dos to re-install grub.
You can even use grub4dos instead of grub to introduce the kernel system.

3.1 Use grub4dos to re-install grub
Http: // www.Ubuntu.Org.cn/download/installformharddisk/grldr
Oneleaf writes: Copy grldr to C :\, edit c: \ Boot. ini, and add a line:
C: \ grldr = "Grub"
Then manually enter the startup command
Example: Root (hd0, 0)
Kernel/vmlinuz-2.6.10-5-686 root =/dev/hdb5 Ro quiet splash
Initrd/initrd. img-2.6.10-5-686
Savedefault
Boot
After entering, reinstall grub.
Re-install GRUB:
For example, assume that the/BOOT disk is located in/dev/hda.
Code:

# Grub-install/dev/hda

3.2 replace grub with grub4dos to introduce the fuse system
Yonsan wrote:
(I wrote it by memory. If it is not perfect, please correct it)
If your system is currently using GRUB boot mode, check the content of/boot/GRUB/menu. lst before performing the operation,
We recommend that you copy/boot/GRUB/menu. lst to the backup (copy it to the FAT32 partition for storage )! Enter the Window environment
1) download grub020p.zip and decompress it to the C root directory. Open drive C and check whether the following files exist.

C: \ Boot (folder)
C: \ changelog.txt
C: \ compile
C: \ copying
C: \ grldr
C: \ grub4lin
C: \ grub-0.95-patch1-startups
C: \ grub-0.95-patch2-findroot
C: \ grub-0.95-patch3-ntfs
C: \ grub-0.95-patch4-emulation
C: \ grub-0.95-patch5-splash
C: \ grub-0.95-patch6-scdrom
C: \ grub-0.95-patch7-bioscdrom
C: \ grub.exe
C: \ grub. pif
C: \ readme.txt
C: \ 2.16.xpm.gz
C: \ scratchpad.txt

2) Modify c: \ Boot \ grub \ menu. lst and overwrite c: \ Boot \ grub \ menu. lst with the menu. lst you copied from the Linux system.

3) access the grub command line (press the C key when the grub boot menu appears)
> Root (hd0, 0)
> Setup (hd0)

4) restart the computer

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.