CentOS 6. X boot error repair steps sharing

Time:2021-10-15

In 5. X, you usually add a word “single” at the end of the following line in grub to enter single user mode.

Copy code

The code is as follows:

kernel /vmlinuz-2.6.18-8.el5 single ro root=LABEL=/ rhgb quiet

Then 6. X is like this:

Copy code

The code is as follows:

kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=eb7b1e63-5e8c-4e6c-b87c-140a310e8224 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM

Adding “single” directly to the back still can’t enter the system. It’s strange! The results are as follows:

Later, it was changed to follow the practice of 5. Xkernel /vmlinuz-2.6.18-8.el5 single ro root=LABEL=/ rhgb quiet

The following prompt appears:

A hint means there must be a way! Change the kernel line in grub to

Copy code

The code is as follows:

kernel /vmlinuz-2.6.18-8.el5 single ro root=LABEL=/ rhgb quiet rdshell

The system can actually give a debug shell, as shown in the figure:

That’s easy. It is completely normal to restore etc / passwd decisively.

Steps:

Copy code

The code is as follows:

#Mount dev / sda2 TMP first needs to know how your system is partitioned and where etc is placed
#cd tmp
/etc#cat passwd- > passwd

OK, you can restart the system directly.

This article comes from the “song of Maple” blog