Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that GRUB boot error occurs when CentOS boots up and cannot enter the system?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about CentOS boot GRUB boot error can not enter the system how to solve, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

When CentOS is booting, there is a sudden GRUB boot error, resulting in the system can not enter, encountered this situation, many people are at a loss what to do, in fact, this kind of problem is not difficult to solve, the following editor will introduce to you the solution of GRUB boot error in CentOS boot.

Solution: use the CentOS installation CD for boot GRUB boot repair

Specific operations:

Boot the computer using the CentOS system CD (the system disk should be the same as the originally installed system version)

As shown in the following figure

Press F5 to enter system repair mode and the following interface appears

Enter: linux rescue enter

Default OK

Select Continue and the following interface appears

Enter: chroot / mnt/sysimage, enter # change the current directory to the root directory of the original system

Continue typing: enter grub, and the following interface appears

Enter: root (hd0,0) enter # Note there must be a space between root and (hd0,0)

Continue to enter: setup (hd0) enter # Note there must be a space between root and (hd0)

Enter again: quit enter # exit grub mode

Finally, enter: reboot # restart the system

Take out the CD, the grub is repaired, and you can enter the system normally.

Note: if you still cannot enter the system normally through the above operation

Can be found in the

Enter: chroot / mnt/sysimage and continue to enter

Edit vi / boot/grub/grub.conf # to add the following (CentOS 5.9 as an example)

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE: You have a / boot partition. This means that

# all kernel and initrd paths are relative to / boot/, eg.

# root (hd0,0)

# kernel / vmlinuz-version ro root=/dev/sda3

# initrd / initrd-version.img

# boot=/dev/sda1

Default=0

Timeout=5

Splashimage= (hd0,0) / grub/splash.xpm.gz

Hiddenmenu

Title CentOS (2.6.18-348.el5)

Root (hd0,0)

Kernel / vmlinuz-2.6.18-348.el5 ro root=LABEL=/

Initrd / initrd-2.6.18-348.el5.img

: wq! # Save exit

Enter: quit enter # exit grub mode

Enter: reboot # restart the system

Generally, it can be repaired successfully and enter the system normally.

If the system is installed through a flash drive, you can't get into the system after unplugging the flash drive, and you can start normally if you plug in the flash drive.

You can fix it in the following ways

Plug in the flash drive and enter the system normally.

Enter: grub-install / dev/sda # install grub to sda

Vi / boot/grub/device.map # edits are modified to

(hd0) / dev/sda

Previously, it might have been:

(hd1) / dev/sda

(hd0) / dev/sdb

Vi / boot/grub/grub.conf # editors modify the inside (hd1,0) to (hd0,0)

Title CentOS (2.6.18-348.el5)

Root (hd0,0)

Kernel / vmlinuz-2.6.18-348.el5 ro root=LABEL=/

Initrd / initrd-2.6.18-348.el5.img

Delete all later

Restart after saving, remove the flash drive and enter the system normally.

The above is how to solve the problem that the GRUB boot error can not enter the system when CentOS boots. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report