Fixing LVM Issues on CentOS After BIOS Updates
Problem Overview
After installing BIOS updates, CentOS failed to boot. The system was stuck at the booting stage, and older kernel versions also encountered the same issue. Even the rescue kernel image failed to boot.
Issue Diagnosis
-
Enter GRUB Edit Mode
- Press
eduring boot to access GRUB edit mode.
- Press
-
Update GRUB Parameters
- Modify the kernel parameters by removing
rhgb quietfrom the line that starts withlinux(this enables printing detailed boot logs). - Save the changes and reboot using
CTRL + x.
- Modify the kernel parameters by removing
-
Observe Boot Logs
- Look for messages similar to the following:
[TIME] Timed out waiting for device /dev/mapper/cs-home. [DEPEND] Dependency failed for /home. [DEPEND] Dependency failed for Local File System.
- Look for messages similar to the following:
-
Create a CentOS Image
- Boot from a CentOS installation image on a USB drive and access the troubleshooting menu.
-
Enable and Unlock the Root User
- Run the following commands:
sudo passwd root sudo passwd -u root - Reboot into the failing kernels; this should now allow access to maintenance mode.
- Run the following commands:
-
Check Journal Logs
- Use
journalctl -xband look for errors similar to:lvm[813]: /dev/nvme0n1p6 excluded: device is not in devices file.
- Use
-
Verify the /home Mount Point
- Confirm that an entry for
/homeexists in/etc/fstab. - Check mounted filesystems with:
df -lHT - Ensure that
/homeis not currently mounted.
- Confirm that an entry for
-
Check Volume Groups
- Run
sudo vgsand verify that there are no entries for thecsvolume group. - Check that there are no entries for
/dev/nvme0n1p6by runningsudo lvmdevices.
- Run
Solution Steps
-
Add Device to the LVM Devices List
- Add
/dev/nvme0n1p6to the devices list:sudo lvmdevices --adddev /dev/nvme0n1p6
- Add
-
Scan Volume Groups
- Run
sudo vgscanand verify that thecsvolume group is now detected.
- Run
-
Activate the Volume Group
- Activate the
csvolume group with:sudo vgchange -ay cs
- Activate the
-
Mount All File Systems
- Mount all mount points, including
/dev/mapper/cs-hometo/homeusing:sudo mount -a
- Mount all mount points, including
After completing the above steps, you should be able to complete the boot process normally.
Conclusion
The LVM issue can be resolved by ensuring the volume group is recognized and activated, allowing the /home mount point to function correctly again.