Recursos simbólicos para la Praxis cotidiana.

Re-install Debian over a previous encrypted (LUKS) scheme

This is what I did to make a clean upgrade (a re-install) to Debian 10, formatting and re-installing the system over the root partition but keeping home data intact. Of course, the prerequisite is to have a dedicated partition for the home mount point.

I followed this post:
But, as I did a few things differently, I decided to write this new contribution.

1. Save your current crypttab file outside /etc, because you’re gonna wipe that out. For instance, I made a copy into /home (partition which I intended to keep).

2. Boot into Debian ISO and select Expert Install, and start the process normally.

3. Now, before running the task called Detecting Disks, switch to a different console (CTRL + ALT + F2) and manually open the LUKS partition. Something like this (“sda5_crypt” is an arbitrary label):

# anna-install cryptsetup-udeb partman-crypto-dm
# depmod -a
# cryptsetup luksOpen /dev/sda5 sda5_crypt

If you don’t know which partition holds your LUKS volume (in my case /dev/sda5), you can load fdisk and list all partitions (from all disks):

# anna-install fdisk-udeb
# fdisk -l

4. Once you’ve done that, get back to the installer (CTRL + ALT + F1) and run the task Detect Disks. You should see the partitions inside LUKS volume, including home and root. Follow the installation normally.

5. Before running the task Install the GRUB boot loader, switch again to the console and copy the crypttab you’ve saved in step 1 to the target etc directory (in my case was /target/etc). You’ll have to override the default file.

6. That’s all. Finish the installation normally and reboot. You’ll be prompted for the LUKS volume password when Debian starts.

Good luck!

Buy Me A Coffee

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.