CentOS7 VM crashes on boot with "can't find UUID ......"
I just downloaded a CentOS7 VM and it crashes on boot with “can’t find disk UUID ...”
Don’t panic ! Your missing a device driver module.
Why does this happen?
The "why" is easy, when the initramfs is built a default dracut flag ( -H or --hostonly) is used that says "only include modules to boot this system, no extras", so the initramfs is tied to the system the install was done on and when we move the VM to a different hypervisor we break it. Our VM’s are built using a VMware hypervisor so this should only show up when using a different hypervisor, KVM and VirtualBox are the most common.
It must be stressed, NOTHING IS BROKEN, the hypervisors are just different.
How to load the required driver modules? There are a few approaches:
• mess with the disk configuration in the hypervisor until it works
• add a bunch of modules to the original build of the VM
• re-install the kernel
• update the kernel
• run dracut in rescue mode
We are good administrators, so let’s use the cleanest method, dracut.
1. Reset/reboot your VM and stop the boot countdown timer with the space bar
2. Record the latest DISTRIBUTION kernel version.
Do NOT use the development kernel that ends in .0 (BAD = 5.4.0)
Mine is “3.10.0-1062.9.1.el7.x86_64”
3. Select and boot from the “rescue” kernel.
4. Login and open a shell
5. run the following command with your kernel version.
$ sudo dracut - -force - -kver 126.96.36.1992.9.1.el7.x86_64
6. Should be all fixed, reboot.