Home >Operation and Maintenance >CentOS >What should I do if centos cannot be started after installing centos from a USB flash drive and removing the USB flash drive?

What should I do if centos cannot be started after installing centos from a USB flash drive and removing the USB flash drive?

王林
王林Original
2020-05-20 13:40:391962browse

What should I do if centos cannot be started after installing centos from a USB flash drive and removing the USB flash drive?

Problem description:

Unplugging the U disk after installing Centos cannot start

Solution:

Re-establish the boot partition

Specific steps:

1. Switch to root user

#su -- root

2. Enter grub mode

#grub

3. Follow the steps below

grub>find /boot/grub/stage1

or

find /grub/stage1

will generally return something like (hd0,5), remember it.

grub>quit

4. Edit grub.conf

#vim /boot/grub/grub.conf

Replace all occurrences of (hdx, y) in the file with the values ​​obtained in step 3.

5. Re-enter grub mode and perform the following steps. Note that there are spaces between the two commands below.

grub>root (hdx,y)   
grub>setup (hdx)
grub>quit

6. Restart

#shutdown -r now

Recommended tutorial: centos tutorial

The above is the detailed content of What should I do if centos cannot be started after installing centos from a USB flash drive and removing the 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