How to Boot Oracle Linux 5.x into Rescue Mode (Doc ID 1516777.1)
APPLIES TO:
Linux OS - Version Oracle Linux 4.4 to Oracle Linux 5.11 [Release OL4U4 to OL5U11]
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Linux x86
GOAL
It is possible to boot Linux in rescue mode using the installation media and bypassing the disk. During the rescue session, you can choose network. Once the system is up, you will have access to the disk. 可以使用安装介质并绕过磁盘以应急模式启动Linux。在救援期间,您可以选择网络。系统启动后,您将可以访问磁盘。
Note: In rescue mode, HDD/NIC will be recognized by the rescue mode OS, and they could be different from the names in normal boot 注意:在救援模式下,HDD/NIC将由救援模式操作系统识别,并且它们可能与正常引导中的名称不同
SOLUTION
Follow the below steps to boot in rescue mode: 请按照以下步骤以应急模式启动
1) Boot from the Linux Installation Media (this may require you to change the bios to boot from dvd) 从Linux安装介质引导(这可能需要您将BIOS更改为从DVD引导)
2) Choose Rescue Mode by typing the following at the boot prompt and pressing <Enter>: 通过在引导提示符下键入以下内容并按<Enter>键,选择Rescue Mode
boot: linux rescue
3) Choose the Language 选择语言
Select desired language using arrow keys then press enter. 语言使用箭头键选择所需的语言,然后按Enter
4) Choose Keyboard Type 选择键盘类型
Select desired keyboard type using arrow keys then press enter. 使用箭头键选择所需的键盘类型,然后按Enter
5) Network Interfaces 网络接口
The network interfaces are unnecessary. Use arrow keys to highlight No then press enter. 不需要网络接口。使用箭头键突出显示No,然后按Enter
6) Choose to mount the filesystem automatically. or choose Skip mounting current system if you intend to fsck(8) the disk (a filesystem that will be checked must be unmounted) 选择自动挂载文件系统。或如果要fsck(8) 磁盘,则选择“跳过Skip挂载当前系统”(必须卸载要检查的文件系统)You are currently in Rescue Mode. If you allowed it, your root filesystem should be mounted as the /mnt/sysimage directory. For example, your /etc/fstab will be present at the /mnt/sysimage/etc/fstab location. 您目前处于救援模式。如果允许的话,您的根文件系统应作为/mnt/sysimage目录挂载。例如,您的/etc/fstab将出现在/mnt/sysimage/etc/fstab位置。
7) You can switch contexts so all the files will be available at their usual locations: 您可以切换上下文,以便所有文件都可以在其通常位置使用
# chroot /mnt/sysimage
# pwd
/
#
Although you are accessing the user-space files of your root filesystem, remember that you are still using the boot environment (such as the kernel and device inventory) from the rescue mode. Programs such as df(1) or mount(8) may not give the expected results. Leave the chroot(1) context by using exit(1) twice: once to exit the chroot(1) and again to exit rescue mode and reboot:
尽管您正在访问根文件系统的用户空间文件,但请记住,您仍在从应急模式使用引导环境(例如内核和设备清单)。诸如df(1) 或mount(8)之类的程序可能无法提供预期的结果。两次使用exit(1) 离开chroot(1) 上下文:一次退出chroot(1) ,再次退出救援模式并重新启动:
# echo Leaving chroot envronment
# exit
# echo Leaving rescue mode and rebooting
# exit
Here we have omitted some extra messages giving details about the process. 这里我们省略了一些额外的消息,提供了有关该过程的详细信息。