1.9. Generating an sos report from the rescue environment
If a Red Hat Enterprise Linux (RHEL) host does not boot properly, you can boot the host into a rescue environment to gather an sos report.
Using the rescue environment, you can mount the target system under /mnt/sysroot, access its contents, and run the sos report command.
Prerequisites
- If the host is a bare metal server, you need physical access to the machine.
- If the host is a virtual machine, you need access to the virtual machine’s settings in the hypervisor.
- A RHEL installation source, such as an ISO image file, an installation DVD, a netboot CD, or a Preboot Execution Environment (PXE) configuration providing a RHEL installation tree.
Procedure
- Boot the host from an installation source.
-
In the boot menu for the installation media, select the
Troubleshootingoption. -
In the Troubleshooting menu, select the
Rescue a Red Hat Enterprise Linux systemoption. At the Rescue menu, select
1and press the Enter key to continue and mount the system under the/mnt/sysrootdirectory.… 1) Continue 2) Read-only mount 3) Skip to shell 4) Quit (Reboot) Please make a selection from the above: 1Press the Enter key to obtain a shell when prompted.
Rescue Shell Your system has been mounted under /mnt/sysroot. If you would like to make the root of your system the root of the activate system, run the command: chroot /mnt/sysroot Warning: The rescue shell will trigger SELinux autorelabel on the subsequent boot. Add "enforcing=0" on the kernel command line for autorelabel to work properly. When finished, please exit from the shell and your system will reboot. Please press ENTER to get a shell: bash-5.2#Use the
chrootcommand to change the apparent root directory of the rescue session to the/mnt/sysrootdirectory.Rescue Shell … Please press ENTER to get a shell: bash-5.2# chroot /mnt/sysimage/Optional: Your network might not be up in the inital Rescue Environment, so make sure you set it up first. For example, if the network requires static IP addresses, and you want to transfer the
sosreport over the network, configure the network:Identify the Ethernet device you want to use:
# ip link show … 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:79:56 brd ff:ff:ff:ff:ff:ffAssign an IP address to the network interface, and set the default gateway. For example, if you wanted to add the IP address of 192.168.0.1 with a subnet of 255.255.255.0, which is a CIDR of 24, to device enp1s0, enter:
# ip address add <192.168.0.1/24> dev <enp1s0> # ip route add default via <192.168.0.254>Add a
nameserverentry to the/etc/resolv.conffile, for example:nameserver <192.168.0.5>
Run the
sos reportcommand and follow the on-screen instructions. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.bash-5.2# sos report sos report (version 4.8.2) This command will collect system configuration and diagnostic information from this Fedora Linux system. For more information on the Fedora Project visit: Community Website : https://fedoraproject.org/ Community Forums : https://discussion.fedoraproject.org/ The generated archive may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party. No changes will be made to system configuration. Press ENTER to continue, or CTRL-C to quit.Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption and your host is connected to the internet. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.sos report (version 4.8.2) … Press ENTER to continue, or CTRL-C to quit. Optionally, please enter the case id that you are generating this report for []:Take note of the
sosreport file name displayed at the end of the console output.Finished running plugins Creating compressed archive… Your sosreport has been generated and saved in: /var/tmp/secured-sosreport-unused-2025-05-14-lofqhen.tar.xz Size 9.30MiB Owner root sha256 bf303917b689b13f0c059116d9ca55e341d5fadcd3f1473bef7299c4ad2a7f4f Please send this file to your support representative. bash-5.2#-
If your host does not have a connection to the internet, use a file transfer utility such as
scpto transfer thesosreport to another host on your network, then upload it to a Red Hat Technical Support case.
Verification
Verify that the
sosutility created an archive in the/var/tmp/directory.$ ls -l /var/tmp/sosreport* -rw-r—r--. 1 root root 65 Mar 14 2025 /var/tmp/sosreport-example.hostname-2025-05-14-lofqhen.tar.xz.sha256 -rw-------. 1 root root 17036176 Mar 14 2025 /var/tmp/sosreport-example.hostname-2025-05-14-lofqhen.tar.xz5-14-lofqhen.tar.xz