CompTIA Linux+ (XK0-006)TroubleshootingHard
A virtual machine is migrated to a new hypervisor that uses a virtio disk controller instead of the original IDE controller. On boot, the system halts at a dracut emergency shell with the message "Gave up waiting for root device." After booting from rescue media and chrooting into the system, which command should the technician run to resolve this?
- Aupdate-grub to regenerate the bootloader configuration
- Bmkfs.ext4 /dev/sda1 to rebuild the root filesystem
- Cdracut --force --add-drivers virtio_blk /boot/initramfs-$(uname -r).img
- Dgrub-install /dev/sda
Show answer & explanationAnswer & explanation
Correct answer: C. dracut --force --add-drivers virtio_blk /boot/initramfs-$(uname -r).img
The initramfs image was built without the virtio_blk driver needed to detect the new virtual disk controller, so the kernel cannot find the root device. Rebuilding the initramfs with dracut and explicitly adding the required driver module resolves the issue without touching the bootloader or filesystem.
Why the other options are wrong
- A. update-grub only regenerates grub.cfg menu entries, not the initramfs contents.
- B. Reformatting the root filesystem would destroy existing data and does not address the missing driver.
- D. grub-install fixes the bootloader stage, not a missing driver in initramfs.
dracut Emergency Shell / Missing Driver
'Gave up waiting for root device' in the initramfs stage usually means the initramfs lacks the storage driver needed to detect the root disk after a hardware/controller change.
- Fix with: dracut --force --add-drivers <module> /boot/initramfs-<version>.img
- Common after P2V/V2V migrations changing disk controller type
- Must chroot into the system from rescue media first
Memory trick: No driver, no disk — dracut needs the right key for the new lock