Centos7 enters Emergency Repair Mode
On the centos7 page, the following error occurs:
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:
Run runlevel to display unknown
Modify the default startup level
A. Delete: mv/etc/systemd/system/default.tar get. back # rename the file.
B. Create a soft connection file: ln-sf/lib/systemd/system/multi-user.target/etc/systemd/system/default.tar get
Or
Ln-sf/lib/systemd/system/runlevel3.target/etc/systemd/system/default.tar get
You can also use the systemctl command:
Systemctl set-default graphical.tar get
Systemctl isolate multi-user.target
Error: Error getting authority: error initializing authority: cocould not connect: Resource temporarily unavailable (g-io-Error-quark, 1)
View the journalctl-xb log
An error occurred while mounting the log:
It can be seen that the Mount problem is that the/home file is not mounted.
Edit the automatically mounted file vi/etc/fstab
Comment out the line of Mount/home (back up first)
#/Dev/mapper/centos-home/home xfs default 0 0
Restart server reboot
After the startup is successful, the page is stuck in white bars. You can press esc to view the startup details. It is stuck in/etc/rc. d/rc. local. Restart to enter the single-user mode:
(1). Select e as the default option when starting the instance.
(2) Find ro's line
(3) Change ro to rw init =/sysroot/bin/sh and press ctrl + x to start
(4) After Entering the single-user page, execute chroot/sysroot to obtain the root permission.
After entering the single user mode, edit the rc. local file, comment out the startup items related to/home, and restart the server.
After the restart is successful, the system enters the normal mode. You can check the/home mounting problem.
(1). lvs-a-o + devices view disk details. You can see that the attr parameter of home is not a (activated) inactive.
(2). lvchange-a y/dev/mapper/centos-home to activate home
(3) mount home, mount/dev/mapper/centos-home/home
(4) The mounting is successful, and the comments in fstab and rc. local are modified.
Reboot successful, problem solved