I cloned a rocky 9.2 install from SSD to M2 NVME (using Sabrent DS-UFNC). I set /etc/lvm/lvm.conf line “use_devicesfile = 0”. Clone from SSD to SSD works fine. The clone from the SSD to the M2 NVME boots to the grub page, but then stalls and reports many dracut-related errors - see:
Seems that the command:
dracut --regenerate-all --force
caused the grub boot menu (where one can select a kernel, etc.) to disappear. How would I get the grub menu on boot back again?
EDIT: since i am UEFI- the command:
grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg
brought the grub menu back.
Please let me know if this is needed (for any reason; as it was needed with Centos 7.9):
echo ‘add_drivers+=" nvme "’ > /etc/dracut.conf.d/nvme.conf
Sure, you can use dracut add_drivers. Running dracut --regenerate-all --force was not the call, however. You only need to run it for the current running kernel.
EDIT: since i am UEFI- the command:
grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg
brought the grub menu back.
it should be:
grub2-mkconfig -o /boot/grub2/grub.cfg
When new kernels are installed that is the path that will be used to update the grub menu. The grub.cfg in …/EFI/rocky should be a stub file that points to the /boot partition uuid and should llook like this:
where the characters after --set=dev are the uuid of /boot.
You now have a static menu that will not show new kernels after updates. So I suggest restoring that grub stub file in …/EFI/rocky to its original format and rerunning grub2-mkconfig pointing to the correct path.
If you are trying to add the nvme drivers after the fact, yes. add_drivers, just like you talked about doing in CentOS 7, does exactly as it sounds. It adds the drivers to the initramfs.
If you don’t do this, and you attempt to boot the system (as you explained in the original post with your errors), you will fail to boot. To get around this, you would need to boot into a recovery/rescue mode (preferably with the boot image of the exact Rocky Linux version you are using), and regenerate the initramfs.
Summary:
Either go down the add_drivers path as you alluded to earlier and regenerate your initramfs
Boot into rescue mode and regenerate your initramfs there
The instructions I gave for regenerating the initramfs were specifically for a running system, not the rescue media. The rescue media, as you have discovered, requires different steps.