Always make backups of your kernels on CentOS before to run 'yum update'! The system is overwriting the initramfs images.

If you are using additional kernel modules like ZFS, I recommend to make a backup of your working kernels (and initramfs images) before to run 'yum update', because otherwise you can end up with non-working kernels (initramfs images).

I have bad experience with kmod-zfs. The original working (before) kernel (the initramfs) was rebuilt (overwritten) without the zfs kernel module.

You can make backups of your kernels (and their initramfs images) like this:

[root@localhost ~]# ls /boot/
config-3.10.0-514.10.2.el7.x86_64
config-3.10.0-514.el7.x86_64
grub
grub2
initramfs-0-rescue-263ede4315d14b8ba4b3a93abc833aea.img
initramfs-3.10.0-514.10.2.el7.x86_64.img
initramfs-3.10.0-514.el7.x86_64.img
initrd-plymouth.img
symvers-3.10.0-514.10.2.el7.x86_64.gz
symvers-3.10.0-514.el7.x86_64.gz
System.map-3.10.0-514.10.2.el7.x86_64
System.map-3.10.0-514.el7.x86_64
vmlinuz-0-rescue-263ede4315d14b8ba4b3a93abc833aea
vmlinuz-3.10.0-514.10.2.el7.x86_64
vmlinuz-3.10.0-514.el7.x86_64
[root@localhost ~]# cd /boot/
[root@localhost boot]# cp vmlinuz-3.10.0-514.10.2.el7.x86_64 vmlinuz-3.10.0-514.10.2.bak1.el7.x86_64
[root@localhost boot]# cp initramfs-3.10.0-514.10.2.el7.x86_64.img initramfs-3.10.0-514.10.2.bak1.el7.x86_64.img
[root@localhost boot]# 

I am adding '.bak1' string before the 'el7'. When I tried to add '.bak1' at the end - it does not work as expected.

[root@localhost ~]# export ZPOOL_VDEV_NAME_PATH=YES
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.10.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.10.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.10.2.bak1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.10.2.bak1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-263ede4315d14b8ba4b3a93abc833aea
Found initrd image: /boot/initramfs-0-rescue-263ede4315d14b8ba4b3a93abc833aea.img
done
[root@localhost ~]# 

Setting the ZPOOL_VDEV_NAME_PATH variable is critical if you are using ZFS. Otherwise the Grub is not working.

When updating ZFS it updates initramfs images for all kernels. So if it does wrong, even your older kernels are without the support. (According to my tests only the initramfs images with additional (like 'bak1') string added are not modified.)

Comments