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.

Step 0: Live USB to the Rescue

  1. At startup, press F12 (may vary) to enter the boot menu.
  2. Boot into Windows, which hopefully still works.
  3. Burn a Manjaro ISO onto a USB drive using e.g. Rufus.
  4. Reboot into Manjaro on the USB drive and connect to the internet.
  5. Open a terminal and run manjaro-chroot -a to automatically mount the Manjaro partition and EFI boot partition.

Step 1: Can you run Pacman?

  1. Try running pacman. If it works, skip to the next step.
  2. 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
  3. If curl could not resolve host, copy /etc/resolv.conf from the ISO image to the mounted partition.
  4. If pacman errored loading shared libraries libicu*.so, install ./pacman-static -Syu icu.

Step 2: Do you have a Kernel?

  1. Check /boot for a vmlinuz-* file. If found, skip to 3.
  2. Install a Linux kernel with pacman -Syu linux. kernel.org lists the available kernels; since this is Manjaro, I picked the latest stable.
  3. If initramfs had failed to be built correctly after a kernel update, run mkinitcpio -p linux* with kernel version from /boot.

Step 4: Reinstall rEFInd

  1. Backup and remove old rEFInd files at /boot/efi/EFI/refind/.
  2. Run pacman -Syu refind and refind-install to reinstall rEFInd.
  3. 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, usually sdX or nvme0nXpX, which can be found using fdisk -l. rw and ro indicate read-write or read-only modes, respectively. This file can also be regenerated using mkrlconf after you have booted in.
  4. rEFInd should now be the first boot loader in the boot order given by efibootmgr. To remove an extraneous boot loader with boot number XXXX, run efibootmgr -b XXXX -B.
⚠️ **GitHub.com Fallback** ⚠️