Say you, like my dumb ass from last night, just fucked up your boot when messing with your BIOS. You did one of those fancy LUKS/BTRFS setups with your fancy subvolumes and shit, Link to footnote 1 and as it turns out, every single boot repair ISO seems to think that’s some type of impossible wizardry, so you’re on your own. Here’s what you can do:
Boot into a live USB and get into a terminal. Ideally, it should have a distro that lets you obtain arch-chroot
, either built-in or through installing it. Mine wasn’t built in, but it ran on Debian so I could do some apt install
-type shit.
First, find your drive with lsblk -f
. You’re going to want to pay attention to whatever drive is obviously the one you run your OS on—if it’s LUKS encrypted, it will look like a single, big blob—and note the /dev/sdX
that it’s attached to.
Once you noted that, type in this shit, in order, replacing /dev/sdX
with whatever your actual drive is:
cryptsetup open /dev/sdaX luks
# put in your password, ofc
mkdir /tmp/temp_mnt
mount /dev/mapper/luks /tmp/temp_mnt
cat /tmp/temp_mnt/@/etc/fstab
If you did it right, you should see a bunch of shit relevant to how your setup previously was. (If your live USB includes an actual DE, you can also open /tmp/temp_mnt/@/etc/fstab
in a text editor.) With some stuff genericized, here’s an example of what a LUKS/BTRFS setup might look like:
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/luks
UUID=W0WNVMB3R5 / btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=256,subvol=/@ 0 0
# /dev/sda2
UUID=W0WNVMB3R5 /boot ext2 rw,relatime 0 2
# /dev/sda1
UUID=W0WNVMB3R5 /boot/EFI vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/mapper/luks
UUID=W0WNVMB3R5 /home btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=257,subvol=/@home 0 0
The relevant stuff is, in order from top-left-ish to bottom-right-ish of each entry, the device (looks either like /dev/mapper/luks
or /dev/sdaX
), the directory those are mapped to (/
, /boot
, etc), and your mount options, separated by commas (rw,relatime
, among other, much longer entry options). Using those three things, per-entry, you’ll be doing something similar to this:
mount [DEVICE] /mnt/[MOUNT DIRECTORY] -o [OPTIONS]
## EXAMPLE (using the fstab sample entry from above)
mount /dev/mapper/luks /mnt/ -o rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=256,subvol=/@
mount /dev/sda2 /mnt/boot -o rw,relatime
mount /dev/sda1 /mnt/boot/EFI -o rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro
mount /dev/mapper/luks /mnt/home -o rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvolid=257,subvol=/@home
Check first that you didn’t fuck it up, ideally by poking through it manually with a file manager. Only when you do that, and you know you did it all correctly, should you continue. (I take no responsibility for if you break anything!)
Assuming you have arch-chroot
(install it if necessary; when using a Debian liveboot, arch-install-scripts
will be the package you need to look for), all you need to do now is
arch-chroot /mnt
grub-install
grub-mkconfig -o /boot/grub/grub.cfg
Restart the computer, and it should just work. If it doesn’t, you either messed up a step, or your problem is way worse than a cooked bootloader.
That concludes the actual guide. If it sounded extremely general, it’s because I don’t know which specific LUKS/BTRFS setup you, specifically, use, but /etc/fstab
does, so it’s fine.
Okay, cool? Cool. I get to complain about Lenovo now.
So I got a replacement keyboard for my laptop; it works great, it has a backlight when my old one didn’t, I’m happy. For reasons I do not know, that keyboard’s down key suddenly stopped working. No other key, just the down key. This is not only not a rare event that comes from my specific new fancy-pants keyboard being broken, but an extremely known problem with my laptop, that, again, for reasons unexplained, is solved by resetting your BIOS.
Problem: I just reset my BIOS. I did not think about the why this would be a problem, but as it turns out, in not first turning off an extremely specific setting to make my laptop “Windows 8 Compatible”, Link to footnote 2 this means I have shot my bootloader directly in the fucking face. Apparently, in order to be compatible with Windows 8, it has to nuke all the shit that let me use UEFI on an Arch Linux build!
This option is on by default, and because resetting BIOS settings is bound to a hotkey, you can press it without ever knowing that the BIOS did, in fact, destroy your bootloader as a result.
So, effectively, I had to do all this, all in the name of a keyboard “fix” that shouldn’t even work in the first place, and because this shit’s always a proprietary black box, I don’t even get to know why. There is no logical reason why that should have fixed it, especially when I hadn’t gone into the BIOS at any point between me putting in the keyboard, with functioning arrow keys, and that one specific arrow key breaking, and because this proprietary shit’s always a black box, I never will.
Man. I wanted time to mess with some more stuff on this blog that night, too… There are like fifty billion guides on this, and none of them are the one that I seemed to have followed. I used some old github gist, and I’m pretty sure it got deleted some time since. Instead, I will arbitrarily link to this one, if you don’t know what such a setup looks like; I picked it not out of conciseness, or even if I know if it’s good, but because I deeply respect the aesthetic that blog has going on. Return to article via footnote 1 This laptop’s from 2016? Why is this for Windows 8 when Windows 10 was already out??? A continuous box of mysteries, this shit. Return to article via footnote 2