Tuesday, April 30, 2024

Things I learned Reinstalling My Ubuntu

I did not want to wait for Ubuntu Studio 24.04 to be offered as an update to 23.10, so I got the installer and tried it.  Also, I thought I would try repartitioning the disk as UEFI.

Brief notes:

  • I did not feel in control of manual partitioning
  • I found out one of my USB sticks is bad, thanks to F3…
  • …and no thanks to the Startup Disk Creator!
  • If the X11 window manager crashes/doesn’t start, goofy things happen
  • Wayland+KWin still don’t support sticky keys, smh
  • snap remove pops up the audio device overlay… sometimes repeatedly
  • I depend on a surprising amount of configuration actually

Partitioning

I chose manual partitioning, because I have a disk that’s laid out in 3 partitions, and I definitely didn’t want to break Debian:

[ Ubuntu Studio ][ swap ][ Debian 12 ]

It was easy to request the installer to treat the first partition as ext4 and mount it as /, at which point it automatically toggled the “format” checkbox on. I wasn’t explicitly given that option, which makes sense, because not formatting is probably wrong; however, that did not give me the confidence that I could add the swap partition without formatting it.  (Debian’s fstab has the UUID in it.  I learned on another trip that reformatting the swap will change the UUID and delay boot.)

I manually configured swap (by UUID) in fstab later, and deleted /swap.img.

The Bad USB Stick

A long, long time ago, I received a Corsair Flash Voyager as a gift.  When I started having access to USB 3.2 Gen 1 hardware (fka USB 3.0), I gifted myself a Corsair Flash Voyager GT 3.0 that was four times the capacity.  For the most part, I’ve been dumping images to the GT 3.0, and installing the system from them.  But this time… it wouldn’t boot.

UEFI had a black screen and I couldn’t see anything.  BIOS mode would start up, then show an error, something about “zstd compressed data corrupted - system halted.”

The Startup Disk Creator has a ‘verify’ function, but it is apparently for verifying the download, and it also would never un-ghost the Verify button. (Did I need the public key in my keyring…?) Regardless, I got the checksum verified from the command line; my installer image was good.  I just didn’t know how to tell if it was properly dumped to the USB drive.

Ultimately, this led me to F3 (Fight Flash Fraud) so I checked over the two Flash Voyagers.  A while later, I had an answer: 250-350 of the 2M sectors of each file f3write had made on the GT were reported as overwritten by f3read.  At least, for the files it read before the device was like, “AUGH” and decided to fall off the bus.

The older, plain Flash Voyager was fine.  It didn’t generate any I/O errors or device resets in dmesg while f3write/f3read worked.  I patiently dumped the installer image (remember, the point was to install Ubuntu Studio) to it at 0.5 GiB/min, rebooted, and got into the installer.  UEFI still didn’t work, but BIOS mode managed to run the whole installation process.

Weird KWin Crash

When I got logged in after rebooting, and stuff, KWin crashed.  It’s been such a long time since I’ve seen X11 without a window manager that I didn’t realize what was happening.  For instance, this is the future, and we have client-side decorations in GTK/Gnome… allowing Firefox to draw a particularly convincing UI. It had buttons, it had borders.  They (minimize/maximize and the borders) just didn’t do anything.

With multiple windows, I had mouse focus—whichever window the mouse was over, gained input focus.  But I couldn’t click-to-raise.

The other serious issue was that Firefox was at (0,0), and Ubuntu Studio puts their main launchers/taskbar up there as well.  Firefox was blocking access to being able to open other stuff and poke around, but at first I thought I had a Firefox problem, so I wanted it open to search the Web.

The problem finally dawned on me when I got Konsole open, and noticed it didn’t have a title bar, just a menu bar and the terminal.  As an experiment, I ran kwin in it, and things started being usable again.

The crash has never repeated itself.  But, I thought, “Might as well try Wayland while I’m here.”

Wayland Hates Users

I had thought KWin picked up support for Sticky Keys (new-ish in Wayland) in August 2023, so I had expected it to land in 24.04.  It did not.  RIP Wayland and all the fanboys.

How important are Sticky Keys?  They are so important that I am willing to use them on Linux, where there is no UI feedback, neither the lovely macOS overlay nor the “minimum viable” systray-based thing offered by Windows, under any desktop I have ever experienced.  When my brain and computer get out of sync, I have to randomly bang keys to see if I can figure out what combo is set/locked and get it cleared again.  It’s abysmal.

Wayland doesn’t even reach up to that level.

(Am I being unfair?  Well, it works on X11, so Wayland is the variable here.)

Uninstalling Snaps

I have been watching Canonical for a long time.  The first Kubuntu I ran was “Feisty Fawn” (7.04) and it has been on my radar since; on my desktop until 2012 (instead of Precise Pangolin, I changed to Windows 7), and on servers at work since Saucy.

So I have been around for Unity, Upstart, Mir, and Snap.  What they have in common is the attempt to monopolize Linux in some way, while spitting in the face of the vast community (Debian and all its upstreams) that enabled them to even attempt that.

If Ubuntu Studio weren’t the best-of-breed distribution for the work I want to do, I absolutely would not use Ubuntu.  In the meantime, I de-monopolize it as best as I can.

So anyway, that’s how I noticed that uninstalling snaps pops up a (no-op) change to the audio device during the process.

Configuration

Prior to this, I thought I had a minimal amount of configuration, well-documented.  I had been relatively careful to keep all changes to files in /etc mirrored in ~/Documents/linux-edits.  But, as it turns out, there is a lot of configuration on a modern Linux.

I had those files, sure.  But I hadn’t saved a copy of ~/.config, so most app and desktop customization got blown away.  Like auto-mount settings for removable media; my Plasma widgets to track various temperatures and memory usage; Konsole profiles (i can haz light mode?); favorite apps in the launcher menu and taskbar; keyboard and mouse settings; Night Color; wallpaper; everything. (The only thing that stayed was Flatpaks’ configurations, since I had backed up ~/.var/app.)

A special note about Plasma 5: it is a real pain to get widgets in/out of the notification area, because they have inconsistent names.  Notably, the one that appears like “🔆 Power Management” is instead called “🔋 Battery and Brightness” in the actual Settings → Entries screen.  I’m looking for quick access to power profiles and “prevent sleep”; I have neither a battery nor software control of the screen brightness on my desktop.  So of course I turned the latter off—but that was completely wrong.

I thought I had “a little” installed outside the package manager, but after getting P3X OneNote, GitHub CLI, PhpStorm, and distrobox installed, I realized I would have to rebuild the distroboxes (node, php, and ares.) There were also the Flatpaks, but their app IDs are directories in ~/.var/app, so I used those to reinstall from.

I forgot to back up any virtual machines, so I lost a Debian 12 image with VeraCrypt and KeePassXC on it.  (Fortunately, not the data.  It was shared.) I lost anything I’ve done to WinXP since the last reinstall, but at least I still have that snapshot to work from.

Conclusion

This sort of exercise is valuable to subject myself to, once in a while.  It points me toward places to improve and streamline the experience, in case of emergency reinstallation.  I think, this trip, the focus points are:

  1. Back up ~/.config, even if I don’t choose restore it en masse
  2. Automatically (re)export virtual machines
  3. Create build scripts to run inside / customize each distrobox

There’s an infinite number of things I could do, but that’s probably an overly ambitious list as it is.

No comments: