Fixing a Linux Boot - ionathanch/ionathanch.github.io GitHub Wiki
These instructions are for fixing the Manjaro boot of a Windows–Manjaro dual boot using rEFInd.
- At startup, press F12 (may vary) to enter the boot menu.
- Boot into Windows, which hopefully still works.
- Burn a Manjaro ISO onto a USB drive using e.g. Rufus.
- Reboot into Manjaro on the USB drive and connect to the internet.
- Open a terminal and run
manjaro-chroot -a
to automatically mount the Manjaro partition and EFI boot partition.
- Try running
pacman
. If it works, skip to the next step. - Otherwise, get a statically-compiled
pacman
:curl https://pkgbuild.com/~morganamilo/pacman-static/x86_64/bin/pacman-static -o pacman-static chmod +x pacman-static
- If
curl
could not resolve host, copy/etc/resolv.conf
from the ISO image to the mounted partition. - If
pacman
errored loading shared librarieslibicu*.so
, install./pacman-static -Syu icu
.
- Check
/boot
for avmlinuz-*
file. If found, skip to 3. - Install a Linux kernel with
pacman -Syu linux
. kernel.org lists the available kernels; since this is Manjaro, I picked the latest stable. - If
initramfs
had failed to be built correctly after a kernel update, runmkinitcpio -p linux*
with kernel version from/boot
.
- Backup and remove old rEFInd files at
/boot/efi/EFI/refind/
. - Run
pacman -Syu refind
andrefind-install
to reinstall rEFInd. - If a new
/boot/refind_linux.conf
file is generated, it will be incorrect, because the installation is being run from a live boot. Replace the contents with the following:"Boot with standard options" "root=/dev/XXX rw add_efi_memmap" "Boot to single-user mode" "root=/dev/XXX rw add_efi_memmap single" "Boot with minimal options" "ro root=/dev/nvme0n1p5"
XXX
is the device name, usuallysdX
ornvme0nXpX
, which can be found usingfdisk -l
.rw
andro
indicate read-write or read-only modes, respectively. This file can also be regenerated usingmkrlconf
after you have booted in. - rEFInd should now be the first boot loader in the boot order given by
efibootmgr
. To remove an extraneous boot loader with boot numberXXXX
, runefibootmgr -b XXXX -B
.