How to reload grub so that it can boot a dual system

Source: Internet
Author: User

Introduction:

Grub is a startup manager for multiple operating systems. Used to guide different systems, such as Windows,linux.
In general, install Windows First, then install Linux, so that grub can take effect (grub exists in Linux installation).

The two days I reload the windows,grub will not work, nor can I get into Linux (the default for grub settings goes to Windows).
In the event that you do not want to reload Linux, you need to reload grub, and the data collected and the results of the validation are sorted and stored here.

Preparatory work:
Verify the location of the root partition of the Linux system. For example, the root partition of my Redhat9.0 is installed on the 3rd partition of the first hard drive, written as
GRUB recognizes the directive as root (hd0,2), with the sequence number starting at 0.

Note:
There is a space between the root and (hd0,2) and a space between setup and (hd0).

Repair Grub by
1. Put the first piece of the Linux installation CD into the optical drive, then reboot the machine, and start the system in the BIOS using a light drive.
2. When the Linux installation interface comes out, press [F5] to enter the Linux rescue mode. (You can also enter the "Linux single root=/dev/hdxx initrd=" comment after the boot:
    prompt appears without entering the rescue mode): Hdxx for your Linux system
     area, such as my Redhat9.0 storage with the 4th partition of the first hard drive,/DEV/HDA4)
3. Go to Linux After the rescue mode need to do some keyboard and a few simple configuration (press OK), after the [Continue] ...
4. The following prompt appears:
   sh#    (Redhat9.0 to sh-2.05#)
5. Grub can be manipulated at this time, type grub:
   Sh#grub
   the prompt will appear as follows:
   Grub>
6. After the grub> prompt, type:
   Grub>root (hdx,y) Note: Tell the system where your Linux root partition is located (my Redhat9.0 corresponds to root (hd0,2))
   If you don't remember, you can type "root (HD") Click the TAB key.
   then type
   grub>setup (hd0) Note: Mount grub into the primary boot area (MBR), or type setup (hdx,y) to place grub in the location you want to install.
   If successful, there will be a successful ...
7. Grub>quit Note: Exit Grub
8. sh#exit   Note: Reboot after exiting Shell
  , if (hdx,y) is correct, you can boot with grub.

However, there are some possible causes that, although successful, are still not bootable and are directly in Windows.
As follows: Grub loading stage 1.5
Grub Loading Please wait ...
Then go directly to Windows ...

The main reason is the grub problem, the fix was successful, but the letter was wrong. (typically the system-booted disk character is inconsistent with your root)

Workaround:
Locate and modify the file grub.conf.

After you re-enter rescue mode by following the steps above,
Sh#cd/mnt
SH#CD sysimage Note: The actual Linux system is mounted under the/mnt/sysimage directory
SH#CD Boot
SH#CD Grub
Sh#vi grub.conf
Whether the control is consistent with your previous root (hdx,y). Generally there is a problem, it can be changed back to the same operation as under Linux.

Q: What's the difference between HDA and hd0?

The main problem is naming. HDA is named from the alphabet, and the hd0 begins with the numbers.
Hda=hd0
hda8= (hd0,7) Note: Hda started with hda1

Karen

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.