Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does centos7 enter emergency repair mode

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to enter the emergency repair mode of centos7", the content is simple and clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to enter the emergency repair mode of centos7" this article.

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 display unknown

Modify the default startup level

a. Delete: mv / etc/systemd/system/default.target / etc/systemd/system/default.target.back # just rename the file

b. Create a soft connection 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 report during execution: Error getting authority: Error initializing authority: Could not connect: Resource temporarily unavailable (g-io-error-quark, 1)

View log journalctl-xb

An error was found mounting in the log:

You can see that it is the mount problem. The / home file is not mounted.

Edit the automatically mounted file vi / etc/fstab

Comment out the line where / home is mounted (backup first)

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

Restart the server reboot

After the startup is successful, the page card stops in the blank bar. You can press the esc key to view the startup details. It is stuck in / etc/rc.d/ rc.local, and restart to enter single-user mode:

(1)。 Select e by default when you turn it on

(2)。 The one that found ro.

(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 root permission

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

If you enter normal mode after a successful restart, you can check the problem of / home mount.

(1) .lvs-a-o + devices to view the disk details, you can see that the attr parameter of home has no a (active) inactive state

(2). Lvchange-a y / dev/mapper/centos-home activate home

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

(4)。 Mount successfully. Change the comments in fstab and rc.local back.

Restart successfully, problem solved

The above is all the contents of the article "how to enter the emergency repair mode of centos7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report