What should I do if grub appears at startup?

Source: Internet
Author: User

In the process of using Linux, most beginners have encountered the problem that the system stops after it is started to the "Grub>" prompt. fans who are not very diligent may be helpless and choose to reinstall the system, in fact, this is only a small problem in the system. In this case, the grub configuration file of the system fails. You can use the following two solutions to solve the problem:

1) grub configuration file backup exists

If grub configuration file backup exists, it can be easily restored as follows:

Use the CD to boot the machine and enter the "Linux Rescue" mode, that is, the system maintenance mode. Run the CP command at the prompt "Sh #" to copy the backup file to/boot/grub. conf.

Sh # cp/backup/grub. conf. bak/mnt/sysimage/boot/GRUB/grub. conf

Assume that the backup file is/backup/grub. conf. bak, because in most Linux CD repair modes, the "/" partition of the hard disk system will be chroot to "/mnt/sysimage, therefore, the target of the copy is "/mnt/sysimage/boot/GRUB/grub. conf "instead of"/boot/GRUB/grub. conf ".

Restart the instance. Kernel files, image files,/boot directories, and other files are damaged or lost. You can also use this method to repair them.

2) if there is no grub configuration file backup

If you can use the grub swap function when there is no backup file, you can perform the following operations on the "Grub>" command line to manually start the system:

Find the directory where the/boot/GRUB/grub. conf partition is located:

Grub> Find/boot/GRUB/grub. conf

(Hd0, 0)

Note that the above command will get the partition of the system where the grub. conf configuration file is located. (hd0, 0) indicates that it is in the hda1 partition.

Run the following command to view the grub. conf file errors:

Grub> CAT (hd0, 0)/boot/GRUB/grub. conf

Note that an error occurs in the configuration file so that it can be modified later.

Specify the/boot partition using the command: Root (hd0, 0)

Starting from this step, this is the main guiding step of the grub configuration file mentioned earlier in this article. It is generally because the system reads the grub configuration file. in case of a problem, we can start it manually.

Specify the command for Kernel loading: kernel/boot/vmlinuz Ro root = label =/

The following command can be used to specify the location of an image file: initrd/boot/initrd-2.6.24-1.3194.fc7

Run the following command to start from the/boot partition: boot (hd0, 0)

In this case, the system can be started normally. In fact, the above step is to load the grub. conf file during GRUB boot. After the system is started normally, modify the grub configuration file correctly.

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.