Migrating an SSD install to a new computer

I have my main install on a 1TB NVMe SSD on a Thinkpad and want to use it for a PC build.

Partitions:

  1. Home with LUKS (should have been LUKS2 but I had an issue with that and the bootloader and now am too lazy to change)

  2. Other LUKS partition (in /mnt/) that gets automatically decrypted and mounted when home is decrypted. Forgot how it works, but I followed a tutorial here or at least somewhere

  3. Unencrypted partition for game installs and other such stuff (also in /mnt/)

Can I just physically migrate the SSD and all will be well? I just want to move my install with the least hassle possible. EDIT: all are in BTRFS

Bonus question: I currently have specific Nvidia drivers manually stuck on user-made drivers to maintain older Pascal card support (GTX 1050; this was covered in Arch news of months past), however in this case I will be using a more recent GTX 3060. How do I smoothly transition back to normal drivers without breaking anything?

If your processor architectures (both machines have x86_64v3 for example) are similar, then you might be able to just boot up (at least if LUKS isn’t using TPM for storing the decrypting keys or something… not an expert on that front). After booting to OS, I think it should be juts a case of replacing Nvidia driver using Paru or equivalent.

Edit: I’d personally always reinstall the OS if machine specs change the slightest. That doesn’t mean you couldn’t mount your previous home partition afterwards, but how LUKS works in that case, I have only the faintest idea.

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.