From Fedora Project Wiki


This test case is intended to validate dracut's ability to locate the root device when referenced using a file system label (e.g. root=LABEL=dracut). Note, this test case may require a fresh installation to prepare the system.

How to test

  1. Start with a system where the root device that does not exist on an encrypted partition, a logical volume, or a RAID device. You may determine your current root device by inspecting the boot arguments provided to your system in /proc/cmdline. If uncertain, you may install a system following the instructions in QA:Testcases_anaconda_ext4_rootfs_on_disk_partition or QA:Testcases_anaconda_ext3_rootfs_on_disk_partition
  2. After install, confirm that your system is using a dracut-enabled initial ramdisk. If the kernel rpm provides a ramdisk image you likely have a host-built dracut initial ramdisk. The following example shows a system with a host-built dracut-enabled initial ramdisk.
    # rpm -ql kernel-$(uname -r) | grep "/boot/initrd.*\.img"
  3. If no dracut-enabled initial ramdisk is found on your system, follow instructions at QA:Testcase Dracut switch to locally built ramdisk
  4. Create a new boot entry to use for this test.
    # grubby --make-default --title "dracut-test" \
     --add-kernel /boot/vmlinuz-$(uname -r) \
     --initrd /boot/initrd-generic-$(uname -r).img \
  5. Determine the UUID used to reference your root (/) filesystem from the file /etc/fstab. Using the example below, the UUID desired is the second line (UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1).
    # cat /etc/fstab
    UUID=b18b0301-5dba-4665-b379-b8d838e24cee /boot                   ext3    defaults        1 2
    UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1 /                       ext3    defaults        1 1
    UUID=83c52ae6-f052-4812-9f9d-a8963e0d925f swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  defaults        0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
  6. Using the UUID, determine the block device using the command blkid -l -t UUID=. For example:
    # blkid -l -t UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1
    /dev/vda2: UUID="6cad5605-1484-47a5-ae77-ba50b0556ee1" TYPE="ext3" SEC_TYPE="ext2" 
  7. Apply a filesystem label to the block device discovered above. Follwing the example,
    # e2label /dev/vda2 dracut
  8. Now edit /etc/grub.conf, locate the boot entry created earlier titled dracut-test, and change root=UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1 to match the label applied above. In this example, use root=LABEL=dracut.
  9. Now reboot the system

Expected Results

  1. The system boots normally.