[CentOS] lvm module missing in initramfs

Thu Aug 28 17:09:10 UTC 2014
Vlado Potisk <reg.centos at poti.sk>

> After upgrading the kernel package, my Centos 7 server didn't boot.
> 
> Here is a small summary:
> old kernel = kernel-3.10.0-123.4.4.el7.x86_64 (everything just fine)
> new kernel = kernel-3.10.0-123.6.3.el7.x86_64
> root partition is on a primary partition, NOT on a LVM volume
> /var partition is on a LVM volume
> new kernel's boot problem = systemd cannot mount /var partition saying
> requirements failed or something like that
> 
> I have find out that the new kernel's initramfs image does not contain the
> lvm module while the old kernel's initramfs did.
> 
> I have created a new initramfs with lvm using dracut and could boot the
> server successfully. However I do not consider this as a fix, and don't
> know how to find the primary cause of the problem. I need some help finding
> out who's to blame:

Update: I did some tests on a very similar Centos 7 server and could reproduce 
the problem with an older kernel. So kernel version doesn't matter.

After  swapoff -a  the mkinitrd command produces an initamfs image WITHOUT the 
lvm. The system cannot boot with it.

Then after  swapon -a  the mkinitrd creates an image WITH the lvm module.

Any ideas why? Is it a bug?

On the original system was the swap not disabled, but replaced with an 
encrypted swap (one added line in crypttab, one line changed in fstab). And 
when the next kernel update came, the server have become unusable as I 
described in my first post.