Linux machine has booted into grub prompt

From AcrodusWiki

This occurred when installing ARCH for the first time. On boot, i was presented with the grub shell. If prompted with grub> then this means grub loaded normally. If prompted with grub rescue> this is worse, and at the time of writing this i have not been in this situation.

In my situation a separate boot partition was present, with the rootfs and swap on lvm logical volumes. There was a kernel image and initrd.img present on the /boot.

The ls command showed me my two partitions that was promising, although it could not interpret the rootfs, maybe because it is on a logical volume?

I ran the below commands to successfully boot.

set root=(hd0,gpt1)
linux (hd0,gpt2)/vmlinuz-linux root=/dev/vg0/rootfs
initrd (hd0,gpt2)/initramfs-linux.img
boot

This successfully booted.

To make these changes persistent you can use the update-grub command. However this was not configured on the machine, so i added the script myself.

#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"