How to debug Dracut problems

    If you are experiencing a problem with system initialization due to Dracut, please see the common bugs document before filing a bug. Some easy configuration tweaks that fix a wide range of issues may be listed there. If the problem you are seeing is not listed there or none of the workarounds seem to help, please consider filing a bug to help us make Fedora run better on your hardware.

    Be prepared to include some information (logs) about your system as well. These should be complete (no snippets please), not in an archive, uncompressed, with MIME type set as text/plain.

    1. Remove rhgb and quiet from the kernel command line

    2. Add rd.shell to the kernel command line. This will present a shell in case dracut is unable to locate your root device

    3. Add rd.shell rd.debug log_buf_len=1M to the kernel command line so that dracut shell commands are printed as they are executed

    4. Inspect the system logs:

    In all cases, the following should be mentioned and attached to your bug report:

    • The exact kernel command-line used. Typically from the bootloader configuration file (e.g. /etc/grub.conf) or from /proc/cmdline

    • A copy of your disk partition information from /etc/fstab

    • A device listing from device-mapper. This can be obtained by running the command dmsetup ls — tree

    • A list of block device attributes including vol_id compatible mode. This can be obtained by running the commands blkid and blkid -o udev

    • Turn on dracut debugging (see ), and attach all relevant information from the boot log. This can be obtained by running the command dmesg|grep dracut

    As well as the information from , include the following information:

    • Include physical volume information by running the command: lvm pvdisplay

    • Include volume group information by running the command: lvm vgdisplay

    As well as the information from the ‘all bug reports’ section, include the following information:

    • If using software RAID disk partitions, please include the output of /proc/mdstat

    This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from the ‘all bug reports’ section, include the following information:

    • Please include the output of

    Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages. To enable serial console output for both the kernel and the bootloader, follow the procedure below.

    1. Open the file /etc/grub.conf for editing. Below the line timeout=5, add the following:

      1. serial --unit=0 --speed=9600
      2. terminal --timeout=5 serial console
    2. Also in /etc/grub.conf, add the following boot arguments to the kernel line:

    3. When finished, /etc/grub.conf should look similar to the example below:

    1. default=0
    2. timeout=5
    3. serial --unit=0 --speed=9600
    4. terminal --timeout=5 serial console
    5. title Fedora (2.6.29.5-191.fc11.x86_64)
    6. root (hd0,0)
    7. kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
    8. initrd /dracut-2.6.29.5-191.fc11.x86_64.img

    More detailed information on how to configure the kernel for console output can be found at .

    Using the dracut shell

    Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:

    1. Add the boot parameter rd.shell to your bootloader configuration file (e.g. /etc/grub/conf)

    2. Remove the boot arguments rhgb and quiet

    A sample /etc/grub.conf bootloader configuration file is listed below:

    If system boot fails, you will be dropped into a shell as seen in the example below:

    1. No root device found
    2. Dropping to debug shell.
    3. sh: can't access tty; job control turned off

    Use this shell prompt to gather the information requested above (see ).

    From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:

    • A block device (e.g. /dev/sda7)

    • A LVM logical volume (e.g. /dev/VolGroup00/LogVol00)

    • A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all)

    The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink /dev/root which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume.

    1. Inspect your partitions using :

      1. # parted /dev/sda -s p
      2. Model: ATA HTS541060G9AT00 (scsi)
      3. Disk /dev/sda: 60.0GB
      4. Sector size (logical/physical): 512B/512B
      5. Partition Table: msdos
      6. Number Start End Size Type File system Flags
      7. 1 32.3kB 10.8GB 107MB primary ext4 boot
      8. 2 10.8GB 55.6GB 44.7GB logical lvm
    2. You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes:

      1. # lvm vgscan
      2. # lvm vgchange -ay
    3. You should see any logical volumes now using the command blkid:

    4. From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume.

      1. UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
      2. cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
      3. Enter passphrase for /dev/mapper/linux-root:
      4. Key slot 0 unlocked.
    5. Next, make a symbolic link to the unlocked root volume

      1. ln -s /dev/mapper/luks-$UUID /dev/root
    1. exit

    Summary of dracut kernel command line options

    A selection of the most common debugging related dracut options:

    **rd.shell**

    Drop to a shell, if the initramfs fails.

    **rd.debug**

    Set -x for the dracut shell.

    **rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup]**

    Drop the shell on defined breakpoint (use egrep 'rd.?break' /usr/lib/dracut/modules.d/99base/init.sh to find the breakpoints supported by your dracut version)

    **rd.udev.info**

    Set udev to loglevel info

    **rd.udev.debug**

    Set udev to loglevel debug

    See the for the complete reference.

    Category:Debugging[D] Category:How_to[Category:How to] ‘’’