From Fedora Project Wiki

(adjust instructions for root=LABEL)
 
m (Correct <pre> tags)
Line 2: Line 2:
|description=This test case is intended to validate [[Features/Dracut|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.
|description=This test case is intended to validate [[Features/Dracut|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.
|actions=
|actions=
# 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 {{filename|/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]]
<ol>
# After install, confirm that your system is using a dracut-enabled initial ramdisk.  If the {{filename|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.
<li>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 {{filename|/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]]
#: <pre>
<li>After install, confirm that your system is using a dracut-enabled initial ramdisk.  If the {{filename|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"
<pre>
#: /boot/initrd-2.6.31-0.174.rc7.git2.fc12.i686.img
# rpm -ql kernel-$(uname -r) | grep "/boot/initrd.*\.img"
#: /boot/initrd-generic-2.6.31-0.174.rc7.git2.fc12.i686.img</pre>
/boot/initrd-2.6.31-0.174.rc7.git2.fc12.i686.img
# If no dracut-enabled initial ramdisk is found on your system, follow instructions at [[QA:Testcase Dracut switch to locally built ramdisk]]
/boot/initrd-generic-2.6.31-0.174.rc7.git2.fc12.i686.img</pre>
# Create a new boot entry to use for this test.
<li>If no dracut-enabled initial ramdisk is found on your system, follow instructions at [[QA:Testcase Dracut switch to locally built ramdisk]]
#: <pre>
<li>Create a new boot entry to use for this test.
#: # grubby --make-default --title "dracut-test" \
<pre>
#: --add-kernel /boot/vmlinuz-$(uname -r) \
# grubby --make-default --title "dracut-test" \
#: --initrd /boot/initrd-generic-$(uname -r).img \
  --add-kernel /boot/vmlinuz-$(uname -r) \
#: --copy-default</pre>
  --initrd /boot/initrd-generic-$(uname -r).img \
# Determine the UUID used to reference your root (''/'') filesystem from the file {{filename|/etc/fstab}}.  Using the example below, the UUID desired is the second line (''UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1'').
  --copy-default</pre>
#: <pre>
<li>Determine the UUID used to reference your root (''/'') filesystem from the file {{filename|/etc/fstab}}.  Using the example below, the UUID desired is the second line (''UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1'').
#: # cat /etc/fstab
<pre>
#: UUID=b18b0301-5dba-4665-b379-b8d838e24cee /boot                  ext3    defaults        1 2
# cat /etc/fstab
#: UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1 /                      ext3    defaults        1 1
UUID=b18b0301-5dba-4665-b379-b8d838e24cee /boot                  ext3    defaults        1 2
#: UUID=83c52ae6-f052-4812-9f9d-a8963e0d925f swap                    swap    defaults        0 0
UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1 /                      ext3    defaults        1 1
#: tmpfs                  /dev/shm                tmpfs  defaults        0 0
UUID=83c52ae6-f052-4812-9f9d-a8963e0d925f swap                    swap    defaults        0 0
#: devpts                  /dev/pts                devpts  defaults        0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
#: sysfs                  /sys                    sysfs  defaults        0 0
devpts                  /dev/pts                devpts  defaults        0 0
#: proc                    /proc                  proc    defaults        0 0</pre>
sysfs                  /sys                    sysfs  defaults        0 0
# Using the UUID, determine the block device using the command {{command|blkid -l -t UUID{{=}}}}.  For example:
proc                    /proc                  proc    defaults        0 0</pre>
#: <pre>
<li>Using the UUID, determine the block device using the command {{command|blkid -l -t UUID{{=}}}}.  For example:
#: # blkid -l -t UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1
<pre>
#: /dev/vda2: UUID="6cad5605-1484-47a5-ae77-ba50b0556ee1" TYPE="ext3" SEC_TYPE="ext2" </pre>
# blkid -l -t UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1
# Apply a filesystem label to the block device discovered above.  Follwing the example,  
/dev/vda2: UUID="6cad5605-1484-47a5-ae77-ba50b0556ee1" TYPE="ext3" SEC_TYPE="ext2" </pre>
#: <pre>
<li>Apply a filesystem label to the block device discovered above.  Follwing the example,  
#: # e2label /dev/vda2 dracut</pre>
<pre>
# Now edit {{filename|/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''.
# e2label /dev/vda2 dracut</pre>
# Now reboot the system
<li>Now edit {{filename|/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''.
<li>Now reboot the system
</ol>
|results=
|results=
# The system boots normally.
# The system boots normally.

Revision as of 13:49, 1 June 2011

Description

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"
    /boot/initrd-2.6.31-0.174.rc7.git2.fc12.i686.img
    /boot/initrd-generic-2.6.31-0.174.rc7.git2.fc12.i686.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 \
     --copy-default
  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.