Red Hat Enterprise Linux Rescue Options
Environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
Issue
- System is unable to boot or filesystem is not accessible.
Resolution
- Single User Mode
- Booting into single user mode using GRUB is accomplished by editing the kernel line. This assumes that either the GRUB boot menu is not password protected or that you have access to the password if it is.
- When the system boots up, you will see the GRUB countdown, which is set to 5 seconds by default . Press "Esc" to intercept this countdown and go enter a GRUB menu. Then :
- Press 'e' to start editing.
- Scroll down to the "kernel..." line. This line tells GRUB which kernel to boot.
- Press 'e' again to edit this line.
- Move to the end of the line. You can add number "1" to the end (to signify single user mode)
- Once you have finished the change, press Enter to accept the editing.
- Then press 'b' to boot using that kernel and boot into runlevel 1 (single user mode).
- Rescue Mode
- Get the first disc of installation media for the major version of the installed Red Hat Enterprise Linux (or the binary DVD). If it's not in your hand yet, follow "How to create CD, DVD, or USB media to install Red Hat Enterprise Linux" for downloading it.
- Note: boot.iso can be used for booting instead of the installation media, but the installation tree (including rescue programs) is still needed in HTTP server or anywhere.
- Follow the instructions given by the rescue boot process:
- Boot the system from boot disc, once the system has successfully booted from the ISO image and Red Hat Enterprise Linux boot screen will appear.
Type: linux rescue without the quotes, and hit enter at the prompt.
[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]
boot: linux rescue
- When prompted for language, keyboard, and network, provide the pertinent information for the system
- Select: Continue when prompted to allow the rescue environment to mount Red Hat Enterprise Linux installation under /mnt/sysimage directory.
- Run the command chroot /mnt/sysimage and then chroot to your system image.
- Emergency Mode
-
If booting into runlevel 1 or into the rescue environment using the installation CD is not possible, there is still hope in fixing the operating system. The system might still be able to boot into "emergency" mode. This "runlevel" is even more basic than runlevel 1. It does not execute the /etc/rc.d/rc.sysinit script and it mounts the root filesystem in read-only mode.
-
To go into "emergency" mode, boot the system until the grub bootloader appears. Before the countdown timer expires, hit 'e'. Select the kernel line using the arrow keys then hit 'e' again. This will position the cursor to the end of the kernel line. Hit the spacebar then type "emergency". Hit 'Enter' then 'b' to boot.
-
The system should boot quickly and prompt for the root password then it will mount the root partition in read-only mode and opens a minimal shell. Mount the /proc partition:
# mount /proc
Then, remount the root partition in read-write mode to allow editing of configuration files:
# mount -o remount,rw /
Resources
- The information above is obtained from these KB articles:
- How do I change a forgotten root password?
- How can I do fsck in rescue mode in Red Hat Enterprise Linux?
- How can Red Hat Enterprise Linux system be accessed when booting into rescue mode or runlevel 1 is not possible?
- How to use rescue mode without CD/DVD installation media?
- How to mount a USB flash drive in Linux Rescue Mode
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.