running linux after installing a new motherboard
#author_luna #sysadmin-notes #linux #uefi
my motherboard broke, so i bought a new one and had issues getting my pre existing linux ssd to boot in it, attempted all sorts of weird BIOS settings until eviee gave me an idea:
bootloader entry is probably not installed into nvram and the bootloader itself wasnt installed as "portable"
use efi shell to run the efi executable directly
i don't really know how to get an efi shell onto a usb drive, but i do know that grub-install may have done that on the old motherboard, as i never had to worry about that before (the old motherboard was when i installed void linux on), so i continued:
what would be the idea if i get linux booting though?
will grub just slap itself into the mobo nvram afterwards?
re-run grub install
and yeah
it'll throw itself onto nvram again
maybe i could do this from voidiso??
probably
i'll experiment l8r
brain expand
the process #
- i use Ventoy on an usb drive, but it turns out the guest ISOs that it boots won't run in UEFI mode, you must have a linux livecd burned directly into the usb drive
- if you attempt to follow this while inside Ventoy,
grub-install
will stop you, claiming no EFI variables are available
- if you attempt to follow this while inside Ventoy,
- once inside voidiso
mkdir /media/root
mount /dev/... /media/root
mount /dev/... /media/root/boot/efi
- mount devfs, procfs, sysfs into the chroot
- required so that the chroot knows which disks do what
- taken from https://github.com/void-linux/void-mklive/blob/f80794ace0c8753edfd791bd1b79df2f83c88856/lib.sh#L79
mount -r --rbind /dev /media/root/dev --make-rslave
mount -r --rbind /proc /media/root/proc --make-rslave
mount -r --rbind /sys /media/root/sys --make-rslave
- we're ready to chroot into the existing linux disk
chroot /media/root
- once inside,
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=void_grub --recheck
- reboot, and for my case, the motherboard sees the
void_grub
boot option