Home> System Tutorial> LINUX> body text

Steps to enter CentOS 7 emergency repair mode

PHPz
Release: 2024-01-13 09:36:11
forward
1125 people have browsed it

Open the centos7 page and appear:

Welcome to emergency mode! after logging in, type “journalctl -xb” to view system logs, “systemctl reboot” to reboot, “systemctl default” to try again to boot into default mode.

give root password for maintenance

(?? Control-D???):

Solution:

Execute runlevel and display unknown

Modify the default startup level

a. Delete first: mv /etc/systemd/system/default.target /etc/systemd/system/default.target.back #Rename the file

b. Create a soft link file: ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

or

ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target

You can also use the systemctl command:

systemctl set-default graphical.target

systemctl isolate multi-user.target

Error reported during execution: Error getting authority: Error initializing authority: Could not connect: Resource temporarily unavailable (g-io-error-quark, 1)

View log journalctl -xb

Found a mounting error in the log:

Steps to enter CentOS 7 emergency repair mode

It can be seen that it is a mounting problem, the /home file is not mounted

Edit automatically mounted files vi /etc/fstab

Comment out the line that mounts /home (backup first)

#/dev/mapper/centos-home /home xfs default 0 0

Restart the server reboot

After the startup is successful, the page is stuck on the white bar. You can press the esc key to view the startup details. It is stuck on /etc/rc.d/rc.local. Restart into single-user mode:

(1). Select e

as the default option when booting up.

Steps to enter CentOS 7 emergency repair mode

(2).Find the line of ro

Steps to enter CentOS 7 emergency repair mode

(3) Change ro to rw init=/sysroot/bin/sh and press ctrl x to start

Steps to enter CentOS 7 emergency repair mode

(4) After entering the single-user page, execute chroot /sysroot to obtain root permissions

After entering single-user mode, edit the rc.local file, comment out all startup items related to /home, and restart the server

After the restart is successful, it will enter the normal mode. At this time, you can check the /home mounting problem

(1).lvs -a -o devices Check the disk details and you can see that the attr parameter of home does not have a (activated) inactive status

(2).lvchange -a y /dev/mapper/centos-home Activate home

(3).Mount home,mount /dev/mapper/centos-home /home

(4). Mount successfully, change the original comments in fstab and rc.local back

Steps to enter CentOS 7 emergency repair mode

Restart successful, problem solved

The above is the detailed content of Steps to enter CentOS 7 emergency repair mode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!