For a complete list of kernel command line options see *dracut.cmdline*(7).
+If you are dropped to an emergency shell, while booting your initramfs,
+the file _/run/initramfs/sosreport.txt_ is created, which can be safed to a
+(to be mounted by hand) partition (usually /boot) or a USB stick.
+Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
+_/run/initramfs/sosreport.txt_ contains all logs and the output of some tools.
+It should be attached to any report about dracut problems.
+
EXAMPLE
-------
----
# journalctl -ab
----
+. With dracut >= 025 the file /run/initramfs/sosreport.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later.
If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that.
Then you can store the output for later inspection.
[[dracutkerneldebug]]
Debug
~~~~~
+If you are dropped to an emergency shell, the file _/run/initramfs/sosreport.txt_ is created,
+which can be safed to a (to be mounted by hand) partition (usually /boot) or a USB stick.
+Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
+_/run/initramfs/sosreport.txt_ contains all logs and the output of some tools.
+It should be attached to any report about dracut problems.
+
**rd.info**::
print informational output though "quiet" is set
allow dropping to a shell, if root mounting fails
**rd.debug**::
- set -x for the dracut shell and logs to dmesg, console and
- _/run/initramfs/init.log_
+ set -x for the dracut shell.
+ If systemd is active in the initramfs, all output is logged to the systemd journal,
+ which you can inspect with "journalctl -ab".
+ If systemd is not active, the logs are written to dmesg and _/run/initramfs/init.log_.
+ If "quiet" is set, it also logs to the console.
**rd.break**::
drop to a shell at the end
Environment=HOME=/
WorkingDirectory=/
ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\n'
+ExecStartPre=-/sbin/sosreport
+ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\nYou might want to save "/run/initramfs/sosreport.txt" to a USB stick or /boot\nafter mounting them and attach it to a bug report.\n\n'
ExecStart=-/bin/sh -i -l
ExecStopPost=-/bin/rm -f /.console_lock
Type=oneshot
systemctl start dracut-emergency.service
rm -f /.console_lock
else
- echo "Dropping to debug shell."
+ debug_off
+ echo
+ /sbin/sosreport
+ echo 'You might want to save "/run/initramfs/sosreport.txt" to a USB stick or /boot'
+ echo 'after mounting them and attach it to a bug report.'
+ if ! RD_DEBUG= getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
+ echo
+ echo 'To get more debug information in the report,'
+ echo 'reboot with "rd.debug" added to the kernel command line.'
+ fi
+ echo
+ echo 'Dropping to debug shell.'
echo
export PS1="$_name:\${PWD}# "
[ -e /.profile ] || >/.profile
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ _ctty="$(RD_DEBUG= getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
if [ -z "$_ctty" ]; then
_ctty=console
while [ -f /sys/class/tty/$_ctty/active ]; do
if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
_emergency_shell $_rdshell_name
else
- warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."
+ warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."
# cause a kernel panic
exit 1
fi
inst_script "$moddir/init.sh" "/init"
inst_script "$moddir/initqueue.sh" "/sbin/initqueue"
inst_script "$moddir/loginit.sh" "/sbin/loginit"
+ inst_script "$moddir/sosreport.sh" "/sbin/sosreport"
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
mkdir -m 0755 -p ${initdir}/lib/dracut
--- /dev/null
+#!/bin/sh
+
+echo 'Generating "/run/initramfs/sosreport.txt"'
+
+exec >/run/initramfs/sosreport.txt 2>&1
+
+set -x
+
+cat /proc/self/mountinfo
+cat /proc/mounts
+
+blkid
+blkid -o udev
+
+ls -l /dev/disk/by*
+
+cat /proc/cmdline
+
+[ -f /etc/cmdline ] && cat /etc/cmdline
+
+for _i in /etc/cmdline.d/*.conf; do
+ [ -f "$_i" ] || break
+ echo $_i
+ cat $_i
+done
+
+for _i in /etc/conf.d/*.conf; do
+ [ -f "$_i" ] || break
+ echo $_i
+ cat $_i
+done
+
+if command -v lvm >/dev/null 2>/dev/null; then
+ lvm pvdisplay
+ lvm vgdisplay
+ lvm lvdisplay
+fi
+
+command -v dmsetup >/dev/null 2>/dev/null && dmsetup ls --tree
+
+cat /proc/mdstat
+
+if command -v journalctl >/dev/null 2>/dev/null; then
+ journalctl -ab --no-pager
+else
+ dmesg
+ [ -f /run/initramfs/init.log ] && cat /run/initramfs/init.log
+fi
+