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= | ||
<ol> | |||
<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]] | |||
<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. | |||
<pre> | |||
# 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</pre> | |||
<li>If no dracut-enabled initial ramdisk is found on your system, follow instructions at [[QA:Testcase Dracut switch to locally built ramdisk]] | |||
<li>Create a new boot entry to use for this test. | |||
<pre> | |||
# grubby --make-default --title "dracut-test" \ | |||
--add-kernel /boot/vmlinuz-$(uname -r) \ | |||
--initrd /boot/initrd-generic-$(uname -r).img \ | |||
--copy-default</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''). | |||
<pre> | |||
# 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</pre> | |||
<li>Using the UUID, determine the block device using the command {{command|blkid -l -t UUID{{=}}}}. For example: | |||
<pre> | |||
# blkid -l -t UUID=6cad5605-1484-47a5-ae77-ba50b0556ee1 | |||
/dev/vda2: UUID="6cad5605-1484-47a5-ae77-ba50b0556ee1" TYPE="ext3" SEC_TYPE="ext2" </pre> | |||
<li>Apply a filesystem label to the block device discovered above. Follwing the example, | |||
<pre> | |||
# e2label /dev/vda2 dracut</pre> | |||
<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
- 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 - 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
- If no dracut-enabled initial ramdisk is found on your system, follow instructions at QA:Testcase Dracut switch to locally built ramdisk
- 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
- 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
- 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"
- Apply a filesystem label to the block device discovered above. Follwing the example,
# e2label /dev/vda2 dracut
- 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. - Now reboot the system
Expected Results
- The system boots normally.