Home  >  Article  >  Operation and Maintenance  >  How to solve the problem of being unable to enter the system after installing centos from a USB flash drive

How to solve the problem of being unable to enter the system after installing centos from a USB flash drive

WJ
WJOriginal
2020-06-06 16:49:152909browse

How to solve the problem of being unable to enter the system after installing centos from a USB flash drive

How to solve the problem of being unable to enter the system after installing centos from a USB flash drive?

Currently, the use of U disk to install the system is gradually becoming popular because of its convenience. However, using a U disk to install the CentOS system is prone to a problem, which is to pull out the U disk after completing the installation. , cannot enter the system, but when starting up, plug in the USB flash drive and you can enter the system normally. When such a problem occurs, it should be said that grub is installed on your USB flash drive by default when installing the system. Therefore, when you turn on the computer without inserting the USB flash drive, the system cannot boot into the system through grub.

The correction method is actually very simple, please see below:

1、通过U盘先正常进入CentOS系统,然后将U盘拔出。
2、输入grub进入grub命令行模式。  #[root@localhost /]# grub
3、输入find /boot/grub/stage1 或者 find /grub/stage1(我的是这个)   #grub> find /boot/grub/stage1 或 grub> find /grub/stage1  返回的值通常是这样的格式:(hd0,0)
4、输入quit 退出grub命令行模式
5、cd 到/boot/grub目录下,使用vi命令,将grub.conf和menu.lst文件里面的(hd1,0)或者(hdx,x)修改为(hd0,0)就是刚才find出来的位置。
6、再次输入grub,进入grub命令行模式。依次输入:root (hd0,0);setup (hd0);reboot
7、输入quit退出grub模式,然后输入init 6重启计算机,这个时候你会发现系统不需要U盘也可以进入系统了。

Related reference: centOS tutorial
##

The above is the detailed content of How to solve the problem of being unable to enter the system after installing centos from a USB flash drive. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn