Recover from Linux update disaster

=> home

Disaster just stroke me today. My Arch Linux laptop suddenly shutdown for no reason during system upgrade. - I'm 100% sure it's not a battery issue, I have like 23% left when I started upgrade - In any case. When I rebooted the system and got pass GRUB's boot screen. It just says "can't find linux-zen" and "kernel needs to be loaded". Shouldn't be a big deas as all my data are backed up. But still, RIP.

Fixing Linux with broken system files

I installed multiple kernels. And of my kernels are missing. Properbally there's a lot of writes that aren't synced to disk. Fortunatelly the situation is only seeming scary. The solution is easy. Get an Arch Live USB. arch-chroot into it. Reinstall all packages and pray documents are intact.

So I got another computer and made myself a Live USB. Booted my laptop with it. And arch-chroot into it. pacman complains libzstd is missing. Ohhh... Fine. pacman has a -r parameter to specsify an alternative root direcotry for this exact situation. Repairing broken pacman in my case is a simple command from the live system.

pacman -S pacman zstd -r /mnt --overwrite="*"

Then arch-chroot again. Nice now pacman works again. Now I'm ready to resinstall everything, replace all broken system files.

pacman -Qqn | pacman -Sy - --overwrite="*"

Done and reboot. I saw GRUB successfully loading the kernel and... Display Manager loaded! Nice! My system is back to live!

This kind of control is exactly why I love Linux. There's no chance I ccan fix a similar problrm with Mac or Windows.

Proxy Information
Original URL
gemini://clehaxze.tw/gemlog/2022/03-13-recovering-from-linux-update-disaster.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
1555.419622 milliseconds
Gemini-to-HTML Time
0.245723 milliseconds

This content has been proxied by September (ba2dc).