Migrating an SSD install to a new computer

That sounds like my setup, you probably got it here.

You’ll probably face a lot of friction if you try just transplanting the entire OS like that. You can try, but I would recommend reinstalling the OS partition.

Here’s what I would do:

  • Keep both /mnt partitions, but reinstall OS partition
  • Make a temporary “transfer” folder on encrypted /mnt partition
    • Copy anything you want to keep from OS partition
    • Copy /etc/crypttab and /etc/fstab, for reference
    • IMPORTANT: Find and copy crypt.keyfile (or whatever you called it, check /etc/crypttab for location). This unlocks your encrypted /mnt partition.
    • IMPORTANT: If you put the keyfile in the encrypted partition, you obviously can’t use it to unlock it. So make sure you remember your LUKS password for the /mnt partition. If not, copy the keyfile somewhere else, or use it to register a new password.
  • Transfer drive to new system, boot into LiveISO installer
  • Use gparted/kparted to delete OS partition
  • (optional) If wanting to try another bootloader, delete and create new EFI partition
  • Start install, pick “Replace Partition” option, point to empty space where OS used to be
  • On first boot, unlock encrypted /mnt partition with password
    • Copy keyfile to OS partition
    • Set up /etc/crypttab and /etc/fstab (don’t just replace! copy what needs copying)
  • Reboot, both /mnt partitions should work like they always did

No need to generate a new keyfile. No need to luksAddKey this one again. Just need to bring the keyfile along, and make sure /etc/crypttab on the new install points to it.

Protip: Make an install.md file somewhere obvious, and make a habit of always keeping notes of every change you make to your system. Especially big ones, like how you encrypted your drives. Future you will thank you for it.