.. title: Don't worry, be happy
.. slug: dont-worry-be-happy
.. date: 2023-07-29 13:12:40 UTC
.. tags: linux, archlinux, thoughts
.. category: 
.. link: 
.. description: 
.. type: text

It's Friday evening, 18:30. My fourth video meeting in a row has just concluded. Now I could finally work on the revision of a manuscript I wanted to get resubmitted during the weekend. This last revision was purely technical: the production editor requested that we move the present addresses of the authors to the back of the manuscript, instead of leaving them  beneath the list of authors on the title page as destined by the LaTeX class from the publisher. Now, any such request that forces me to work around or against the journal style provided by the publisher means that the reputation of the journal (`ACS Appl. Nano Mater. <https://pubs.acs.org/journal/aanmf6>`_, in case you are curious) takes a steep dive. But anyway, I had to do it, and I was looking into the ``footmisc`` package to get all ``footnotemarks`` I needed when I realized that I hadn't done my ritual update in the morning for the lack of time. Starting it, I only peripherally noticed that the update involved TeXLive and brought a new kernel. In any case, this information didn't stop me from compiling the manuscript I was working on during the update. Repeatedly. Incessantly. 

At a certain point, the build command of Sublime Text didn't produce any reaction. No error message, nothing. I began to have a bad feeling. Indeed, while I could still move the mouse around, the entire Window system was unresponsive, and the update process – which was just about to build the fmt files – was hanging. I started to suspect that I had just committed the greatest blunder of this year, and indeed, when I rebooted, the system greeted me with the message that the kernel could not be found:

::

	Loading Linux linux...
	error file /boot/vmlinuz-linux not found
	loading initial ramdisk
	error: you need to load the kernel first 

Well, I knew that this SNAFU looked worse than it actually is. But since I was suddenly very tired, I decided to call it a day and do the repair on Saturday morning.

On Saturday, I first needed a live Arch installation on a USB stick. The `ISO <https://archlinux.org/download/>`_ ist just 813 MB (as of release 2023.07.01) and downloaded in 30 s. There are `several options to write the ISO to the stick <https://wiki.archlinux.org/title/USB_flash_installation_medium>`_, but I prefer ``dd``:         

::

	dd bs=4M if=archlinux-archlinux-2023.07.01-x86_64.iso of=/dev/sdd conv=fsync oflag=direct status=progress
	
Note that the stick must not be mounted, and one writes to the stick (sdd), not a partition (sdd1).

After booting from the thus created live media, I was just `a few commands away <https://wiki.archlinux.org/title/pacman#Pacman_crashes_during_an_upgrade>`_ from a restored system. I first wanted to have my WiFi working:  

::

	iwctl --passphrase PASSPHRASE station DEVICE connect SSID

After that, I just needed to mount my drives (have a look with ``lsblk`` before), delete the stale lock file from the previous failed update, and do an update in the mounted root directory:

::
	
	mount /dev/nvme01p2 /mnt
	mount /dev/nvme01p1 /mnt/boot
	mount -t proc /proc /mnt/proc
	mount --rbind /sys /mnt/sys
	mount --rbind /dev /mnt/dev

	rm /var/lib/pacman/db.lck

	pacman --sysroot /mnt -Syu

Took all in all half an hour, but I would still have preferred to avoid this situation altogether. The lesson is: avoid working on the system when you're all stressed out. Particularly `on Friday night <https://www.opsview.com/resources/system-administrator/blog/3-reasons-not-make-major-it-changes-fridays>`_.


