How to start Grub

Source: Internet
Author: User

I use a grub-guided dual-system. I started grub directly when I started the system. On the dark screen, there was only a grub prompt, which was quite unpleasant. Many people have encountered similar problems. The solutions provided on the Internet are generally as follows:
Grub> root (ha0, 0)
Grub> rootnoverify (ha0, 0)
Grub> chainloader + 1
Grub> boot
In this way, enter xp.

At least you can use windows! But is it not depressing to enter the above commands every time you start the system? My method is to enter windows for the first time, Enter cmd in the running process, enter DOS, and use the command FDISK/MBR, so that the system will directly go to windows after it is started again, instead of entering the above lines of commands! What is MBR? A: MBRMaster Boot Record, which is also called Main Boot Record. It is because it is damaged that it cannot enter windows.
How to enter linux? My method is to use the original image file to reinstall linux. Of course, during the reinstallation, the original partition is not formatted, so grub is reinstalled, in addition, the bad files in linux have also been repaired, and others have not changed, and the speed is also very fast! After that, you will see the selection interface for the two systems. If the partition is formatted, it is actually reinstalled! The speed is very slow.
There are other methods, such as modifying the menu. list of installed grub by knowing the kernel of the linux system, and adding a new startup Item to it. The general format is as follows:
 

 
 
  1. title CentOS (2.6.18-92.el5xen)  
  2. root (hd0,0)  
  3. kernel /boot/xen.gz-2.6.18-92.el5  
  4. module /boot/vmlinuz-2.6.18-92.el5xen ro root=LABEL=/ rhgb quiet  
  5. module /boot/initrd-2.6.18-92.el5xen.img  

Of course, the content of different systems is definitely not the same, but every time you enter linux, you need to enter grub, and then choose the corresponding title in menu. list, which is a little bit of trouble.

I found a post on the Internet, which is very good, but I have never done it myself. If you encounter a similar problem, try it and hope it will be useful to you. The following is the post content, which is shared with you.

Start Grub and run commands to enter xp
Grub> root (ha0, 0) # (ha0, 0) indicates the first partition where I installed xp on a hard disk.
Grub> rootnoverify (ha0, 0) # I do not know this sentence.
Grub> chainloader + 1 .. Haha
Grub> boot

Go to Grub and run commands to go to linux
Grub> root (h # As long as you enter root (h is automatically completed by pressing the TAB key, and the following similar information will appear)
 

 
 
  1. Possible partitions are:   
  2. Partition num: 0, Filesystem type is fat, partition type 0x6   
  3. Partition num: 2, Filesystem type is ext2fs, partition type 0x83   
  4. Partition num: 6, Filesystem type is fat, partition type 0xb   
  5. Partition num: 7, Filesystem type is fat, partition type 0xb   
  6. Partition num: 9, Filesystem type unknown, partition type 0x82  


Partition num: 2, Filesystem type is ext2fs, partition type 0x83
# Indicates that your linux is installed in 3rd partitions. It should be the root partition.

Partition num: 9, Filesystem type unknown, partition type 0x82
# Indicates the swap partition of your linux

After you know which partition of your linux instance is located, you can directly enter ()
Grub> root (ha0, 2)
Grub> kernel/boot/vmlinuz-2.4.20-8 ro root =/dev/hda3 (press the TAB when entering the kernel, it will appear
Vmlinuz-2.4.20-8 and other information .)
Grub> initrd/boot/initrd-2.4.20-8.img
Grub> boot

In this way, you can enter linux...

But it is not a way to execute commands like this every time you enter the system. Right, let's modify grub in linux.
Change the ha0 and 8 in grub to the corresponding partitions in linux. For example, if my current partitions are hd0 and 2
Default = 0
Timeout = 10
Splashimage = (hd0, 2)/boot/grub/splash.xgm.gz # indicates the position of the grub menu image. The partition location is consistent with that installed in linux ..
Title Red Had linux (2.4.20-8)
Root (hd0, 2) indicates the second partition of the first hard disk, which is Redhat9.
Kernel/boot/vmlinuz-2.4.20-8 ro root = LABEL =/
Initrd/boot/initrd-2.4.20-8.img

After the instance is started, go to Grub and modify grub .. We need to reinstall grub .. Open the terminal ..
Cd/boot/grub
Grub # Enter grub and wait for it to appear later
Grub>
Enter
Root (hd0, 2)
Setup (hd0)
Quit
Reboot
After restarting, you can see the selection screen of xp and linux.

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.