32.2. Anaconda Rescue Mode
The Anaconda installation program's rescue mode is a minimal Linux environment that can be booted from the Red Hat Enterprise Linux 7 DVD or other boot media. It contains command-line utilities for repairing a wide variety of issues. This rescue mode can be accessed from the submenu of the boot menu. In this mode, you can mount file systems as read-only or even to not mount them at all, blacklist or add a driver provided on a driver disc, install or upgrade system packages, or manage partitions.
Note
Anaconda rescue mode is different from rescue mode (an equivalent to single-user mode) and emergency mode, which are provided as parts of the systemd system and service manager. For more information about these modes, see Red Hat Enterprise Linux 7 System Administrator's Guide.
To boot into Anaconda rescue mode, you must be able to boot the system using one Red Hat Enterprise Linux boot media, such as a minimal boot disc or USB drive, or a full installation DVD.
For detailed information about booting the system using media provided by Red Hat, see the appropriate chapters:
- Chapter 7, Booting the Installation on 64-bit AMD, Intel, and ARM systems for 64-bit AMD, Intel, and ARM systems
- Chapter 12, Booting the Installation on IBM Power Systems for IBM Power Systems servers
Important
Advanced storage, such as iSCSI or zFCP devices, must be configured either using
dracut
boot options (such as rd.zfcp=
or root=iscsi:options
), or in the CMS configuration file on IBM Z. It is not possible to configure these storage devices interactively after booting into rescue mode.
For information about
dracut
boot options, see the dracut.cmdline(7)
man page. For information about the CMS configuration file, see Chapter 21, Parameter and Configuration Files on IBM Z.
Procedure 32.1. Booting into Anaconda Rescue Mode
- Boot the system from either minimal boot media, or a full installation DVD or USB drive, and wait for the boot menu to appear.
- From the boot menu, either select theoption from the submenu, or append the
inst.rescue
option to the boot command line. To enter the boot command line, press the Tab key on BIOS-based systems or the e key on the UEFI-based systems. - If your system requires a third-party driver provided on a driver disc to boot, append the
inst.dd=driver_name
to the boot command line:inst.rescue inst.dd=driver_name
For more information on using a driver disc at boot time, see Section 6.3.3, “Manual Driver Update” for AMD64 and Intel 64 systems or Section 11.2.3, “Manual Driver Update” for IBM Power Systems servers. - If a driver that is part of the Red Hat Enterprise Linux 7 distribution prevents the system from booting, append the
modprobe.blacklist=
option to the boot command line:inst.rescue modprobe.blacklist=driver_name
For more information about blacklisting drivers, see Section 6.3.4, “Blacklisting a Driver”. - When ready, press Enter (BIOS-based systems) or Ctrl+X (UEFI-based systems) to boot the modified option. Then wait until the following message is displayed:
The rescue environment will now attempt to find your Linux installation and mount it under the
/mnt/sysimage/
directory. You can then make any changes required to your system. If you want to proceed with this step choose 'Continue'. You can also choose to mount your file systems read-only instead of read-write by choosing 'Read-only'. If for some reason this process fails you can choose 'Skip' and this step will be skipped and you will go directly to a command line.If you select, it attempts to mount your file system under the directory/mnt/sysimage/
. If it fails to mount a partition, you will be notified. If you select , it attempts to mount your file system under the directory/mnt/sysimage/
, but in read-only mode. If you select , your file system is not mounted. Choose if you think your file system is corrupted. - Once you have your system in rescue mode, a prompt appears on VC (virtual console) 1 and VC 2 (use the Ctrl+Alt+F1 key combination to access VC 1 and Ctrl+Alt+F2 to access VC 2):
sh-4.2#
Even if your file system is mounted, the default root partition while in Anaconda rescue mode is a temporary root partition, not the root partition of the file system used during normal user mode (
multi-user.target
or graphical.target
). If you selected to mount your file system and it mounted successfully, you can change the root partition of the Anaconda rescue mode environment to the root partition of your file system by executing the following command:
sh-4.2#
chroot /mnt/sysimage
This is useful if you need to run commands, such as
rpm
, that require your root partition to be mounted as /
. To exit the chroot
environment, type exit
to return to the prompt.
If you selected Anaconda rescue mode by creating a directory, such as
, you can still try to mount a partition or LVM2 logical volume manually inside /directory/
, and typing the following command:
sh-4.2#
mount -t xfs /dev/mapper/VolGroup00-LogVol02 /directory
In the above command,
/directory/
is a directory that you have created and /dev/mapper/VolGroup00-LogVol02
is the LVM2 logical volume you want to mount. If the partition is a different type than XFS, replace the xfs string with the correct type (such as ext4
).
If you do not know the names of all physical partitions, use the following command to list them:
sh-4.2#
fdisk -l
If you do not know the names of all LVM2 physical volumes, volume groups, or logical volumes, use the
pvdisplay
, vgdisplay
or lvdisplay
commands, respectively.
From the prompt, you can run many useful commands, such as:
ssh
,scp
, andping
if the network is startedFor details, see the Red Hat Enterprise Linux 7 System Administrator's Guide.dump
andrestore
for users with tape drivesFor details, see the RHEL Backup and Restore Assistant.parted
andfdisk
for managing partitionsFor details, see the Red Hat Enterprise Linux 7 Storage Administration Guide.yum
for installing or upgrading softwareFor details, see the Red Hat Enterprise Linux 7 Administrator's Guide
32.2.1. Capturing an sosreport
The
sosreport
command-line utility collects configuration and diagnostic information, such as the running kernel version, loaded modules, and system and service configuration files, from the system. The utility output is stored in a tar archive in the /var/tmp/
directory.
The
sosreport
utility is useful for analyzing the system errors and can make troubleshooting easier. The following procedure describes how to capture an sosreport
output in Anaconda rescue mode:
Procedure 32.2. Using sosreport
in Anaconda Rescue Mode
- Follow steps in Procedure 32.1, “Booting into Anaconda Rescue Mode” to boot into Anaconda rescue mode. Ensure that you mount the installed system
/
(root) partition in read-write mode. - Change the root directory to the
/mnt/sysimage/
directory:sh-4.2#
chroot /mnt/sysimage/
- Execute
sosreport
to generate an archive with system configuration and diagnostic information:sh-4.2#
sosreport
Important
When running,sosreport
will prompt you to enter your name and case number that you get when you contact Red Hat Support service and open a new support case. Use only letters and numbers because adding any of the following characters or spaces could render the report unusable:# % & { } \ < > > * ? / $ ~ ' " : @ + ` | =
- Optional. If you want to transfer the generated archive to a new location using the network, it is necessary to have a network interface configured. In case you use the dynamic IP addressing, there are no other steps required. However, when using the static addressing, enter the following command to assign an IP address (for example 10.13.153.64/23) to a network interface (for example dev eth0):
bash-4.2#
ip addr add 10.13.153.64/23 dev eth0
See the Red Hat Enterprise Linux 7 Networking Guide for additional information about static addressing. - Exit the chroot environment:
sh-4.2#
exit
- Store the generated archive in a new location, from where it can be easily accessible:
sh-4.2#
cp /mnt/sysimage/var/tmp/sosreport new_location
For transferring the archive through the network, use thescp
utility:sh-4.2#
scp /mnt/sysimage/var/tmp/sosreport username@hostname:sosreport
See the references below for further information:
- For general information about
sosreport
, see What is a sosreport and how to create one in Red Hat Enterprise Linux 4.6 and later?. - For information about using
sosreport
within Anaconda rescue mode, see How to generate sosreport from the rescue environment. - For information about generating an
sosreport
to a different location than/tmp
, see How do I make sosreport write to an alternative location?. - For information about collecting an
sosreport
manually, see Sosreport fails. What data should I provide in its place?.
32.2.2. Reinstalling the Boot Loader
In some cases, the GRUB2 boot loader can mistakenly be deleted, corrupted, or replaced by other operating systems. The following steps detail the process on how GRUB is reinstalled on the master boot record:
Procedure 32.3. Reinstalling the GRUB2 Boot Loader
- Follow instructions in Procedure 32.1, “Booting into Anaconda Rescue Mode” to boot into Anaconda rescue mode. Ensure that you mount the installed system's
/
(root) partition in read-write mode. - Change the root partition:
sh-4.2#
chroot /mnt/sysimage/
- Use the following command to reinstall the GRUB2 boot loader, where install_device is the boot device (typically, /dev/sda):
sh-4.2#
/sbin/grub2-install install_device
- Reboot the system.
32.2.3. Using RPM to Add, Remove, or Replace a Driver
Missing or malfunctioning drivers can cause problems when booting the system. Anaconda rescue mode provides an environment in which you can add, remove, or replace a driver even when the system fails to boot. Wherever possible, we recommend that you use the RPM package manager to remove malfunctioning drivers or to add updated or missing drivers.
Note
When you install a driver from a driver disc, the driver disc updates all initramfs images on the system to use this driver. If a problem with a driver prevents a system from booting, you cannot rely on booting the system from another initramfs image.
Procedure 32.4. Using RPM to Remove a Driver
- Boot the system into Anaconda rescue mode. Follow the instructions in Procedure 32.1, “Booting into Anaconda Rescue Mode”. Ensure that you mount the installed system in read-write mode.
- Change the root directory to
/mnt/sysimage/
:sh-4.2#
chroot /mnt/sysimage/
- Use the
rpm -e
command to remove the driver package. For example, to remove the xorg-x11-drv-wacom driver package, run:sh-4.2#
rpm -e xorg-x11-drv-wacom
- Exit the chroot environment:
sh-4.2#
exit
If you cannot remove a malfunctioning driver for some reason, you can instead blacklist the driver so that it does not load at boot time. See Section 6.3.4, “Blacklisting a Driver” and Chapter 23, Boot Options for more information about blacklisting drivers.
Installing a driver is a similar process but the RPM package must be available on the system:
Procedure 32.5. Installing a Driver from an RPM package
- Boot the system into Anaconda rescue mode. Follow the instructions in Procedure 32.1, “Booting into Anaconda Rescue Mode”. Do not choose to mount the installed system as read only.
- Make the RPM package that contains the driver available. For example, mount a CD or USB flash drive and copy the RPM package to a location of your choice under
/mnt/sysimage/
, for example:/mnt/sysimage/root/drivers/
- Change the root directory to
/mnt/sysimage/
:sh-4.2#
chroot /mnt/sysimage/
- Use the
rpm -ivh
command to install the driver package. For example, to install the xorg-x11-drv-wacom driver package from/root/drivers/
, run:sh-4.2#
rpm -ivh /root/drivers/xorg-x11-drv-wacom-0.23.0-6.el7.x86_64.rpm
Note
The/root/drivers/
directory in this chroot environment is the/mnt/sysimage/root/drivers/
directory in the original rescue environment. - Exit the chroot environment:
sh-4.2#
exit
When you have finished removing and installing drivers, reboot the system.