After a routine system update and an unfortunate hang that required a hard reset, my Linux machine refused to boot. Instead of the familiar login prompt, I was greeted by a cryptic GRUB error: error: no cryptodisk module can handle this device.
My setup uses LUKS2 + LVM. From the GRUB rescue shell, I could actually decrypt the LUKS container. But once decrypted, GRUB completely failed to detect any LVM volumes. It simply acted as if the LVM structure didn't exist.
Meanwhile, if I boot it from a Live Rescue USB, everything worked perfectly. I could open the LUKS container, and the volume group appeared immediately. Tools like vgck and pvck reported no issues.
After a length discussion with AI, eventually I found the magical commands:
vgcfgbackup -f lvm_backup.txt <vg_name>
vgcfgrestore -f lvm_backup.txt <vg_name>
After running these commands and rebooting, GRUB recognized the LVM volumes immediately, and I was back in my system.
Supposedly this forces rewriting the LVM metadata. Perhaps there were issues with the metadata, which were caused by the forced shutdown. The issues can be handled by LVM parser in Linux, but not by the limited implementation in GRUB.
Comments