Now you’re less likely to miss what’s been brewing in our knowledge base with this weekly digest
A restored Linux VM fails to boot with the following symptoms:
For RHEL/CentOS/SUSE systems, during the boot process they will drop into the dracut emergency shell, and display errors similar to:
dracut-initqueue timeout - starting timeout scripts /dev/vgroot/root does not exist
For Debian systems, a different error message may be shown. By default Debian doesn't use use dracut to generate initramfs images, so the following error is shown:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block()
This issue occurs because the initial ramdisk image does not contain the necessary block device kernel modules (drivers).
The initial ramdisk image (initramfs/initrd) is an image of an initial root filesystem used as a part of the Linux boot process.
The most common scenario for this is when restoring a virtual machine that backed up using Veeam Agent for Linux to completely new hardware. For example, a virtual machine was backed up in VMware and is restored to a Hyper-V environment.
To resolve this issue, you must regenerate the initramfs image.
This consists of three main steps:
The information below is broken into the following sections:
Example:
mkdir /targetroot
Example for sda3 partition:
mount /dev/sda3 /targetroot
mount /dev/centos/root /targetroot
mount /dev/mapper/centos-root /targetroot
Example for sda2 boot partition:
mount /dev/sda2 /targetroot/boot
Assuming EFI system partition on sda1:
mount /dev/sda1 /targetroot/boot/efi
Note: If BTRFS using separate subvolumes is in use for any of the required partitions, you might have to use subvol= or subvolid= parameters in the mount command to specify a subvolume to mount.
Example:
mount -o subvol=/@/boot/grub2/x86_64-efi /dev/sda2 /targetroot/boot/grub2/x86_64-efi
This command mounts /@/boot/grub2/x86_64-efi BTRFS subvolume from /dev/sda2 device to /targetroot/boot/grub2/x86_64-efi
For more information on BTRFS mount options refer to the BTRFS manpage.
mount --bind /dev /targetroot/dev
mount --bind /proc /targetroot/proc
mount --bind /sys /targetroot/sys
mount --bind /run /targetroot/run
chroot /targetroot /bin/bash
The initial ramdisk image (initramfs/initrd) is an image of an initial root filesystem used as a part of the Linux boot process. Initial ramdisk images are stored as files under /boot, named initramfs-<kernel version>.img or initrd-<kernel version>.
Example for Red Hat Enterprise Linux 8:
# ls -la /boot/initramfs-*
-rw-------. 1 root root 65698610 Aug 8 2019 /boot/initramfs-0-rescue-b15a66f034f840ecb6a1205c983df822.img
-rw-------. 1 root root 19683576 Sep 13 2020 /boot/initramfs-4.18.0-193.19.1.el8_2.x86_64kdump.img
-rw-------. 1 root root 27783687 Nov 8 2020 /boot/initramfs-4.18.0-193.28.1.el8_2.x86_64.img
-rw-------. 1 root root 22324786 Nov 8 2020 /boot/initramfs-4.18.0-193.28.1.el8_2.x86_64kdump.img
-rw-------. 1 root root 27989970 Dec 6 13:17 /boot/initramfs-4.18.0-240.10.1.el8_3.x86_64.img
-rw-------. 1 root root 22485564 Jan 17 2021 /boot/initramfs-4.18.0-240.10.1.el8_3.x86_64kdump.img
-rw-------. 1 root root 27943270 Jan 17 2021 /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img
-rw-------. 1 root root 22485474 Jan 17 2021 /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64kdump.img
# ls -la /boot/initrd*
lrwxrwxrwx 1 root root 29 Aug 23 2019 /boot/initrd -> initrd-4.12.14-197.15-default
-rw------- 1 root root 11142180 Dec 27 16:37 /boot/initrd-4.12.14-197.15-default
-rw------- 1 root root 15397016 Dec 22 2020 /boot/initrd-4.12.14-197.15-default-kdump
-rw------- 1 root root 10994816 Dec 27 16:37 /boot/initrd-4.12.14-197.15-default.backup
Initial ramdisk image files correspond to GRUB/GRUB2 boot menu entries - when a specific entry is selected in the boot menu, a corresponding initramfs image is loaded. The relation between GRUB menu entries and initial ramdisk image files can be determined via grub.cfg file (generally located under /boot/grub or /boot/grub2) - look for menuentry records which denote GRUB boot menu entries.
Example from SUSE Linux Enterprise Server 15 SP1:
### BEGIN /etc/grub.d/10_linux ### menuentry 'SLES 15-SP1' --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bf547c2f-3d66-4be6-98c3-8efe845a940d' { <...> echo 'Loading Linux 4.12.14-197.15-default ...' linuxefi /boot/vmlinuz-4.12.14-197.15-default root=UUID=bf547c2f-3d66-4be6-98c3-8efe845a940d ${extra_cmdline} splash=silent resume=/dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0-part3 mitigations=auto quiet crashkernel=175M,high echo 'Loading initial ramdisk ...' initrdefi /boot/initrd-4.12.14-197.15-default }
Red Hat Enterprise Linux 8 uses BLS framework with boot menu entries stored under /boot/loader/entries:
# ls /boot/loader/entries/ b15a66f034f840ecb6a1205c983df822-0-rescue.conf b15a66f034f840ecb6a1205c983df822-4.18.0-240.10.1.el8_3.x86_64.conf b15a66f034f840ecb6a1205c983df822-4.18.0-193.28.1.el8_2.x86_64.conf b15a66f034f840ecb6a1205c983df822-4.18.0-240.1.1.el8_3.x86_64.conf # cat /boot/loader/entries/b15a66f034f840ecb6a1205c983df822-4.18.0-240.10.1.el8_3.x86_64.conf title Red Hat Enterprise Linux (4.18.0-240.10.1.el8_3.x86_64) 8.3 (Ootpa) version 4.18.0-240.10.1.el8_3.x86_64 linux /vmlinuz-4.18.0-240.10.1.el8_3.x86_64 initrd /initramfs-4.18.0-240.10.1.el8_3.x86_64.img $tuned_initrd <...>
Note: Rebuilding the initial ramdisk will overwrite the existing image. You should consider making a copy of the existing initramfs/initrd image beforehand. Example:
cp /boot/initramfs-<kernel version>.img /boot/initramfs-<kernel version>.img.backup
Now that you have identified the initramfs that needs to be rebuilt, expand the section below matching the distro for information about rebuilding it.
dracut -f -v /boot/initramfs-<kernel version>.img <kernel version>
Here, <kernel version> has to be replaced with the kernel version for which the initramfs is being rebuilt.
Example:
# ls -la /boot/initramfs-* -rw-------. 1 root root 65698610 Aug 8 2019 /boot/initramfs-0-rescue-b15a66f034f840ecb6a1205c983df822.img -rw-------. 1 root root 19683576 Sep 13 2020 /boot/initramfs-4.18.0-193.19.1.el8_2.x86_64kdump.img -rw-------. 1 root root 27783687 Nov 8 2020 /boot/initramfs-4.18.0-193.28.1.el8_2.x86_64.img -rw-------. 1 root root 22324786 Nov 8 2020 /boot/initramfs-4.18.0-193.28.1.el8_2.x86_64kdump.img -rw-------. 1 root root 27989970 Dec 6 13:17 /boot/initramfs-4.18.0-240.10.1.el8_3.x86_64.img -rw-------. 1 root root 22485564 Jan 17 2021 /boot/initramfs-4.18.0-240.10.1.el8_3.x86_64kdump.img -rw-------. 1 root root 27943270 Jan 17 2021 /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img -rw-------. 1 root root 22485474 Jan 17 2021 /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64kdump.img
Here, /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img image corresponds to 4.18.0-240.1.1.el8_3.x86_64 kernel.
To rebuild it with dracut, run:
dracut -f -v /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img 4.18.0-240.1.1.el8_3.x86_64
How to rebuild the initial ramdisk image in Red Hat Enterprise Linux
update-initramfs –u –k <kernel version>
Where <kernel version> is replaced with the kernel version for which the initramfs is being rebuilt.
mkinitrd
Because mkinitrd-suse is just a wrapper for dracut, dracut can be used for the same purpose as well. For more information, refer to RHEL/CentOS/Oracle Linux section above.
Alternate example using dracut:
dracut -f -v /boot/initrd-4.12.14-197.15-default 4.12.14-197.15-default
With the initramfs having been rebuilt, exit the chroot environment:
exit
umount /targetroot/dev
umount /targetroot/proc
umount /targetroot/sys
umount /targetroot/run
umount /targetroot/boot/efi
umount /targetroot/boot
umount /targetroot
Finally, the system can be rebooted.
During the next boot, select the image in the GRUB interface with the same version as the initramfs image that was rebuilt.
Your feedback has been received and will be reviewed.
Please try again later.
Please try select less.
This form is only for KB Feedback/Suggestions, if you need help with the software open a support case
Your feedback has been received and will be reviewed.