Rescue Arch
My desktop computer occasionally crashes after a system upgrade and I haven’t had the time to figure out why yet, but I do have to rescue it so I can continue studying.
Identification: Link to heading
Error messages when booting:
[FAILED] Failed to start CLI Netfilter Manager.
[FAILED] Failed to mount /efi.
[DEPEND] Dependency failed for Local File Systems.
You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, or "exit" to continue bootup.
Enter root password for system maintenance
(or press Control-D to continue)
Symptoms:
- incomplete system upgrade due to segfaults during upgrade (invalid free()) messages in yay/pacman output) - why? TODO investigate more or fresh install
yay -Syu
exits early (without finishing the system upgrade), then further invocations says nothing to upgrade- I think ‘oh maybe a restart will help’
- Since (to my knowledge) the kernel is the last package to upgrade, these steps lead to the error above, where the /efi partition cannot be mounted.
Recovery Steps: Link to heading
Most of this information is covered in the Arch Wiki and this helpful blog post. I’ve annotated/expanded on some steps for my understanding
1. Boot into live USB Link to heading
I don’t believe my current monitor displays anything fast enough (I never see the GRUB page to select “Advanced options” and enter BIOS), so the setting the boot order (at least the first time) required borrowing an additional external monitor :|
- plug in USB
- wait long enough
2. Mount root and efi partitions Link to heading
root@archiso ~ # lsblk
root@archiso ~ # fdisk -l
...
# identify root partition, listed as device with type "Linux filesystem"
# also identify efi partition, on the same disk as root, with type "EFI System"
root@archiso ~ # mnt /dev/<device> /mnt
root@archiso ~ # cat /mnt/etc/fstab # check for where efi partition is usually mounted (relative to root)
root@archiso ~ # mount /dev/<device> /mnt/efi
root@archiso ~ # mount
# check 2 /dev/<device> are mounted on /mnt and /mnt/efi
3. Chroot into the system and re-install Link to heading
root@archiso ~ # arch-chroot /mnt
[root@archiso /]# pacman -Syu mkinitcpio systemd linux
...
# re-install the kernel, which includes rebuilding the initramfs
[root@archiso /]# exit
root@archiso ~ # umount /mnt/efi
root@archiso ~ # umount /mnt
root@archiso ~ # reboot
TODO:
- investigate swap error messages during a different system crash