Stuck in Grub Recovery after installing Second OS to alternate Hard drive. How to recover?

Untested, assuming /dev/sda is your Qubes OS drive:

cryptsetup luksOpen /dev/sda2 luks-qubes
vgchange -ay
mkdir /mnt/qubes
mount /dev/qubes_dom0/root /mnt/qubes
cd /mnt/qubes
mount /dev/sda1 boot
# Backup the /boot partition
cp -r boot root/boot-backup
mount -t proc /proc proc
mount -t sysfs /sys sys
mount --rbind /dev dev
mount --rbind /run run
chroot .
grub-install /dev/sda

After running grub2-mkconfig command below you only will be able to boot into Qubes OS.
If you want to be able to boot into your second OS as well as Qubes OS you need to copy the menuentries for your second OS from root/boot-backup/grub2/grub.cfg to /etc/grub.d/40_custom by following this guide:

grub2-mkconfig -o /boot/grub2/grub.cfg
exit
reboot

If you formatted the /boot partition you may also need to regenerate initramfs (with dracut -vf --regenerate-all) and vmlinuz (reinstall the kernel package) files for your Qubes OS kernels in /lib/modules.

1 Like