How to upload rdsosreport.txt to another system from the dracut emergency shell
Environment
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
Issue
- How to collect data required for troubleshooting when system fails in dracut emergency shell?
- How to copy and upload
/run/initramfs/rdsosreport.txtfile?
Resolution
Enter the dracut shell
The dracut shell will replace a kernel panic after an error in the initial ramdisk, allowing you to troubleshoot and possibly resolve the issue from there. To enter the dracut shell in place of the panic, interrupt the GRUB boot process, edit the kernel command line as follows, and then continue the boot process:
- Remove these (if present): `rhgb quiet`
- Add this: `rd.shell`
Continue to boot with this change. After the dracut warning, you should see something like this:
Dropping to debug shell.
sh: can't access tty; job control turned off
dracut:/#
Note: In RHEL Dracut shell is automatically triggered when something goes wrong early in the boot process (e.g., missing root device, fstab issues, LVM failures).
Bring up networking in the dracut emergency shell
- If using
DHCP, simply execute thedhclientcommand. - Then confirm with
ip aandpingthat an appropriate address is up and reachable from another machine.
Configure another networked machine to listen on a particular port
-
Use
nmap-ncatto open listening port-
Install the
nmap-ncatpackage.# yum install nmap-ncat -
Choose an unused port and ensure that port is allowed through the firewall.
-
Execute:
# nc -l ADDRESS PORT >rdsosreport.txtWhere
ADDRESSis a local IP addr andPORTis a number, e.g.,7000
-
Back in dracut emergency shell, send the file
-
Execute:
# cat /run/initramfs/rdsosreport.txt >/dev/tcp/ADDRESS/PORTWhere
ADDRESSandPORTcorrespond with what was chosen above
Video overview of different methods:
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.