如何通过Systemd将Oracle Linux 7.x引导到救援模式或紧急模式 (Doc ID 2153996.1)

How to Bootup Oracle Linux 7.x into Rescue Mode or Emergency Mode Through Systemd (Doc ID 2153996.1)

APPLIES TO:

Linux OS - Version Oracle Linux 7.0 and later
Linux x86-64

GOAL

This article explains how to bootup OL7 system into rescue mode or emergency mode.  本文介绍了如何将OL7系统启动到救援模式或紧急模式

In OL7, both rescue mode and emergency mode are systemd targets which replaced the concept of runlevels in previous OL versions.  在OL7中,救援模式和紧急模式都是系统目标,取代了先前OL版本中运行级别的概念

Rescue mode is equivalent to single user mode and requires the root password.  救援模式等效于单用户模式,并且需要root密码

Rescue mode allows you to repair your system in situations when it is unable to complete a regular booting process. Rescue mode will try to mount all local file systems and start some important system services, but it does not activate network interfaces neither allow multiple users to be logged in.  救援模式使您可以在无法完成常规引导过程的情况下修复系统。救援模式将尝试挂载所有本地文件系统并启动一些重要的系统服务,但是它不会激活网络接口,也不允许多个用户登录

Emergency mode provides the most minimal environment possible and allows you to repair your system even in situations when the system is unable to enter rescue mode. In emergency mode, the system mounts the root file system as read-only, does not attempt to mount any other local file systems, does not activate network interfaces.  紧急模式提供了尽可能最小的环境,即使在系统无法进入救援模式的情况下,您也可以修复系统。在紧急模式下,系统将根文件系统安装为只读,不尝试安装任何其他本地文件系统,也不激活网络接口

In case the Linux OS could not bootup itself, please refer to How to Bootup Oracle Linux 7.x into Rescue Mode From ISO Image.  如果Linux操作系统无法自行启动,请参阅 How to Bootup Oracle Linux 7.x into Rescue Mode From ISO Image

SOLUTION

Bootup into Emergency mode(target)  引导进入紧急模式(目标)

1) During bootup, when the GRUB2 menu shows up, press the e key for edit.  在启动过程中,当GRUB2菜单出现时,按e键进行编辑

2) Add the following parameter at the end of the linux16 line on x86-64 systems, or the linuxefi line on UEFI systems:  在x86-64系统上的linux16行的末尾或UEFI系统上的linuxefi行的末尾添加以下参数

systemd.unit=emergency.target

Press Ctrl+a (or Home) and Ctrl+e (or End) to jump to the start and end of the line.  按Ctrl+a (or Home) and Ctrl+e (or End)跳至行的开头和结尾

3) Press Ctrl+x to boot the system with the parameter. 按Ctrl+x 使用参数启动系统

Bootup into Rescue mode(target)  启动进入救援模式(目标)

1) During bootup, when the GRUB2 menu shows up, press the e key for edit.  在启动过程中,当GRUB2菜单出现时,按e键进行编辑

2) Add the following parameter at the end of the linux16 line on x86-64 systems, or the linuxefi line on UEFI systems: 在x86-64系统上的linux16行的末尾或UEFI系统上的linuxefi行的末尾添加以下参数

systemd.unit=rescue.target

Press Ctrl+a (or Home) and Ctrl+e (or End) to jump to the start and end of the line. 按Ctrl+a (or Home) and Ctrl+e (or End)跳至行的开头和结尾

3) Press Ctrl+x to boot the system with the parameter.  按Ctrl+x 使用参数启动系

Bootup into Debug Shell  启动到Debug Shell

The systemd debug shell provides a shell in the startup process that can be used to diagnose systemd related boot-up problems. Once in the debug shell, systemctl commands such as systemctl list-jobs, and systemctl list-units can be used to diagnose boot problems.   systemd debug shell程序在启动过程中提供了一个shell程序,可用于诊断与systemd相关的启动问题。进入debug shell后,可以使用systemctl命令(例如systemctl list-jobs和systemctl list-units)来诊断引导问题。

During bootup, when the GRUB2 menu shows up, press the e key for edit.  在启动过程中,当GRUB2菜单出现时,按e键进行编辑

Add the following parameter at the end of the the linux16 line on x86-64 BIOS-based systems, or the linuxefi line on UEFI systems:  在基于x86-64 BIOS的系统上linux16行的末尾或在UEFI系统上的linuxefi行的末尾添加以下参数

systemd.debug-shell

The systemd will configure the debug shell on TTY9. Press Ctrl+Alt+F9 to connect to the debug shell (no credential needed). systemd将在TTY9上配置debug shell。按Ctrl+Alt+F9连接到debug shell(无需证书)

Switch to Emergency mode(target)  切换到紧急模式(目标)

To switch to Emergency target, simply run following command as root:  要切换到紧急目标,只需以root运行以下命令

# systemctl emergency

Broadcast message from root@dhcp-cn-10-182-71-190.cn.oracle.com on pts/1 (Mon 2016-06-27 00:44:58 EDT):

The system is going down to emergency mode NOW! 

 To prevent systemd from sending informative message:  为防止systemd发送信息性消息

# systemctl --no-wall emergency
# systemctl isolate emergency.target 

Switch to Rescue mode(target)  切换到救援模式(目标)

To switch to rescue target, simply run following command as root:  要切换到救援目标,只需以root运行以下命令

# systemctl rescue

Broadcast message from root@dhcp-cn-10-182-71-190.cn.oracle.com on pts/0 (Mon 2016-06-27 00:22:44 EDT):

The system is going down to rescue mode NOW! 

To prevent systemd from sending informative message:  为防止systemd发送信息性消息

# systemctl --no-wall rescue
# systemctl isolate rescue.target 

  

REFERENCES

NOTE:2302734.1 - How to Bootup Oracle Linux 7.x into Rescue Mode From ISO Image

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值