So I modified my /etc/crypttab and /etc/fstab to add a LUKS-encrypted external SSD to my main laptop, messed up one of the options, and the system would no longer boot. I'm writing this guide in case I'm ever in that position again.

The solution was quite simple:

  • Boot from a Live USB.
  • Open a terminal and run the following commands:
    # Unlock the drive - if unsure of the correct device, keep trying until one
    # can be unlocked with cryptsetup.
    sudo cryptsetup open --type luks /dev/nvme0n1p3 nvme
    
    # Mount the drive.
    sudo mkdir -p /mnt/nvme
    sudo mount -t btrfs /dev/mapper/nvme /mnt/nvme
    
  • We can now navigate the file system to edit and fix the broken /etc/fstab by either finding what's causing the failure or by simply removing the recently added lines and booting up again.