Remember to plug your AC into your Laptop during system update

English version below


Hallo,

heute hatte ich wohl etwas, was nach Murphy's Law wohl alle paar Wochen vorkommen sollte, aber nach realistischer Wahrscheinlichkeitsabschätzung wohl eher hoffentlich gar nicht. Jedenfalls:

Meine Wahrnehmung

Ich fahre den Laptop hoch, um darauf einen Film mit Freunden zu schauen. Denke mir, ich hab' den jetzt paar Tage nicht benutzt, mache ich lieber mal ein Sysupdate. Während ich dem Update-Prozess zuschaue und in einen Tagtraum gleite, wird auf einmal der Bildschirm schwarz. Panisch drücke ich also Ctrl-Alt-F1 bis F7, um zu schauen, ob nur der Window Manager hängt. Keine Reaktion. Meine Vermutung: Akku leer, obwohl auf über 30%, weil Batterie kacke (ich muss die dringend ersetzen), also fährt mein Notebook brav in den Ruhemodus. Puh Schweiß abwisch, kann also eigentlich nichts passiert sein.

Fahre also wieder hoch, nach dem Bootmenü begrüßt mich ein fröhliches

/boot/vmlinuz-5.10-x86_64 not found. Dropping to emergency shell.

(so oder so ähnlich)


Was (wahrscheinlich) wirklich geschah

Nach näherer Inspektion fehlem meinem Bootmenü ALLE Kernel bis auf 5.10, welches der LTS Kernel der 5er Reihe ist. Daher, und daher, dass die Boot-Dateien auf /boot verschwunden sind (also die initramfs's und die vmlinuz's) schlussfolgere ich, dass ich das unglaubliche Glück hatte, dass sich mein Notebook genau beim Neubauen der initialen Ramdisk heruntergefahren hat. Es hat also einen schätzungsweise 2-5 Sekunden langen Zeitslot innerhalb der mehrmenütigen Updateprozedur getroffen, in dem das System tatsächlich in einem nicht bootbaren Zustand zurückbleibt.

Witzig eigentlich.


Ich habe dann ein Live-System gebootet, und mir dann gedacht "Hey du bist doch schlau. Installiere einfach Kernel 5.10 im Livesystem und dann cp initramfs_hier initramfs_da zackbumm fertig." Aber da Hochmut bekanntlich vor dem Fall kommt, habe ich nach dem Kopieren ca eine Stunde damit verbracht, mich durch die GRUB-Config zu wühlen, weil meine verschlüsselte Systempartition nicht mehr gemountet wurde beim Boot. So lange, bis ich endlich darauf kam, dass im Initramfs vom Live-System vermutlich die Krypto-Erweiterung nicht reingebaut wird. Oof.

Dann war mir das Ganze doch zu heikel, und ich habe durch Recherchen herausgefunden, dass ich einfach in dem Live-System die Systempartition mounten und den Kernel reinstallen kann, um das abgebrochene Prozedere wieder anzustoßen. Tatsächlich hätte ich daran denken können, so im Nachhinein weiß ich nicht mehr genau, warum ich da Angst vor hatte, vermutlich, weil ich vergessen hatte, dass Arch-Distros mit arch-chroot ein hervorragendes Tool zum In-die-Installation-hinein-chrooten mitbringt. Dieser Artikel (https://bbs.archlinux.org/viewtopic.php?id=253341) hat mir das alles übrigens wieder nahegebracht.

Wunderbar, klappt alles, nur muss ich nach dem erfolgreichen Booten feststellen, dass meine Systempartition massive Fehler wirft, und auch ein fsck nichts daran ändert, dass wohl wichtige Systemdateien fehlen. Hätte also gleich das machen können, was mir ein Bekannter empfohlen hat, nämlich wegschmeißen, neuinstallieren.

Deswegen auch: Da meine /home auf einer Extrapartition liegt, kann ich einfach (ohne größeren Aufwand) neuinstallieren.

Habe mir trotzdem die Partition gesichert, und /etc und die installierten Packages rausgeschrieben.
Evtl fange ich auch mal mit BtrFS und Timeshift an, wenn ich eh neu aufsetze. Aber naja, irgendwie der Klassiker heute.


English version


Hello,

today I had something that should happen every few weeks according to Murphy's Law, but hopefully not at all according to realistic probability estimation. Anyway:

My perception

I boot up the laptop to watch a movie on it with friends. I think to myself, I haven't used it for a few days, I'd better do a system update. While I watch the update process and slip into a daydream, the screen suddenly goes black. Panic-stricken, I press Ctrl-Alt-F1 to F7 to see if only the window manager hangs. No reaction. My guess: Battery empty, although at over 30%, because battery is crap (I need to replace it urgently), so my notebook dutifully goes into sleep mode. Phew wipe sweat, so nothing can actually have happened.

So I boot up again, after the boot menu I am greeted by a cheerful

/boot/vmlinuz-5.10-x86_64 not found. Dropping to emergency shell.

(something like this or something like that)


What (probably) really happened

After closer inspection, my boot menu is missing ALL kernels except 5.10, which is the LTS kernel of the 5 series. Because of this, and because the boot files on /boot disappeared (i.e. the initramfs's and the vmlinuz's) I conclude that I had the incredible luck that my notebook shut down exactly when the initial ramdisk was rebuilt. So it hit an estimated 2-5 second time slot within the multi-menu update procedure where the system is actually left in a non-bootable state.

Funny actually.


I then booted a live system, and then thought to myself "Hey you're smart. Just install kernel 5.10 in the live system and then cp initramfs_here initramfs_there bang boom done." But since pride comes before a fall, I spent about an hour after copying, digging through the GRUB config because my encrypted system partition wasn't mounted at boot. So long, until I finally figured out that in the initramfs of the live system probably the crypto extension is not built in. Oof.

Then the whole thing was too tricky for me, and I found out through research that I can simply mount the system partition in the live system and reinstall the kernel to restart the aborted procedure. In fact, I could have thought of that, so in retrospect I'm not sure why I was afraid of it, probably because I forgot that Arch-Distros comes with arch-chroot, an excellent tool for in-installation-chrooting. By the way, this article (https://bbs.archlinux.org/viewtopic.php?id=253341) brought it all back to me.

Wonderful, everything works, only I have to realize after the successful boot that my system partition throws massive errors, and even a fsck does not change the fact that probably important system files are missing. So I could have done what an acquaintance recommended, namely *throw away, reinstall.

Therefore also: Since my /home is on an extra partition, I can simply (without larger expenditure) reinstall.

I saved the partition anyway, and wrote out /etc and the installed packages.
Maybe I'll start with BtrFS and Timeshift, if I rebuild anyway. But well, somehow the classic today.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now