Table of Contents
Fix initramfs from broken update
Overview
I updated my CentOS 7 virtual guest and after boot it could not locate my partitions. I had actually 2 instances, an LVM guest and a non-LVM guest. LVM guest waited for a few minutes until it told me some errors about dracut. Non-LVM guest waited indefinitely for vda partition mount.
In practice you may see this kind of error message:
dracut-initqueue timeout
and get thrown into dracut shell.
Solution
I booted the virtual instance with CentOS 7 ISO, selected rescue mode, let it mount existing system as read-write to /mnt/sysimage and chrooted to it.
While chrooted I rebuilt my initramfs with following command:
dracut -H -f /boot/initramfs-3.10.0-1127.8.2.el7.x86_64.img 3.10.0-1127.8.2.el7.x86_64 || dracut -fv --regenerate-all
Where 3.10.0-1127.8.2.el7.x86_64 is the kernel version, which you must check before issuing the command. Using uname is not recommended as you are doing this with a rescue kernel.
After that just sync and reboot. You may need to reboot twice.
Comments
All comments and corrections are welcome.
Leave a comment