Thursday, March 21, 2024

Reinstalling grub on my Debian 12 LVM LuksCrypt dual-boot laptop

So, Microsoft's latest Windows 11 update decided to blow away my dual-boot config because Microsoft apparently hasn't been involved in an antitrust lawsuit recently enough.  (Seriously, I liken this to buying a Ford vehicle and then discovering that it actively disables any non-Ford vehicles also parked in your driveway.  Not cool, Microsoft.)

Anyhow, since I run Debian 12 with LVM and an encrypted root filesystem, recovering the grub bootloader was a very manual process.  I'm adding the steps I used here for my own future reference.  Yours will probably be different.  This assumes you know your way around Linux, hardware device mappings, &etc.  Please don't ask me for help recovering your own system unless you're also offering me $200/hr for my time.

1. Boot Debian 12 install media, Advanced Options, "Rescue Mode"

2. Follow the prompts but then "continue with no root filesystem", drop to an installer shell

3. The encrypted LVM logical volume should already be in /dev/mapper.  Open it with 

    cryptsetup luksOpen /dev/mapper/$LVNAME $LVNAME_crypt

4. mount /dev/mapper/$LVNAME_crypt /mnt

5. Double check /mnt/etc/fstab to make sure the root fs name you used in cryptsetup is the one also here.  If not, unmount /mnt, close the luksCrypt mapping, and go back to step 3 but use the correct root mount point name for the mapping.

6. fdisk -l /dev/nvme0n1  (or whatever your drive is) to find the /boot and /boot/EFI partitions

7. mount them under the new rootfs:

        mount /dev/nvme0n1p4 /mnt/boot

        mount /dev/nvme0n1p1 /mnt/boot/efi

8. Attach all the virtual filesystems needed to make everything function:

        mount --bind /proc /mnt/proc

        mount --bind /dev /mnt/dev

        mount --bind /dev/pts /mnt/dev/pts

        mount --bind /sys /mnt/sys

9. chroot /mnt

10. Mount efivarfs under efivars 

        mount -t efivarfs none /sys/firmware/efi/efivars

11. Reinstall grub on the drive (not on one of the partitions)

        grub-install /dev/nvme0n1  # or whatever drive is appropriate

12. exit chroot and reboot to get back into your orphaned Debian OS.

Note:  I wasn't able to get grub-prober to find the Windows boot manager in rescue mode, so this returns the system to being able to boot Debian but not to the original multiboot. 

13. Boot into Debian 12

14. Re-enable os-prober in /etc/default/grub

15. grub-mkconfig >/boot/grub/grub.cfg

16. grub-install

Now everything should be back to the way it was.  Bill, I'll send you an invoice for the two hours of my morning you just stole from me.


Saturday, January 13, 2024

That 1981 KROQ Doodle

Someone posted this notebook doodle in a Facebook group that I'm in.  It appears to be a transcription of the playlist on Los Angeles' famous KROQ station overnight from 10:15pm - 04:15am, one random night, long ago.  It's kind of captivating.  I set out to decode it and recreate it on a playlist, with pretty good success.

First - the doodle itself.  (Click for the original version as I found it.)


I don't know who created this, but I kind of love it.  It's like a time capsule into the broadcast FM punk & new wave scene of Los Angeles at the beginning of the 1980s.  Most of it was pretty straightforward, but there are some errors in it and some oddities.

First, though, here's the playlist as best I could recreate it.  Then I'll go into the challenges, guesses, and 
errors I came across trying to reconstruct it (noted as orange highlights below).

Youtube Music playlist:  KROQ Doodle

I don't have spotify, but if you recreate this playlist on Spotify (or other services) feel free to shoot me a link and I'll add it.)