Ubuntu – What name to use in activation of encrypted root partition

bootboot-repairencryptionkubuntuluks

I am trying to run the Boot Repair tool on a Kubuntu 16.04 system with an encrypted (LUKS) root partition. This post tells me to "activate the encrypted drive using the correct name". That name should be given by /etc/crypttab in the live system.

My /etc/crypttab in the live system has no entries. The live system is also Kubuntu 16.04.

How can I identify/find the name I need?

Best Answer

How to identify the name originally assigned to LUKS partition?

Identify your root partition in the broken system when booted to Live USB

We will assume the encrypted partition is /dev/sdXY where X is a letter and Y is a number.

Decrypt the root partition so we can look inside

Open a terminal by pressing Ctrl+Alt+T and enter:

sudo cryptsetup luksOpen /dev/sdXY temp_name

First, you will be asked for your sudo password. Type the password and press Enter. Next it will say:

Enter passphrase for /dev/sdXY:

Type the passphrase and press Enter. Neither the password nor the passphrase will show and the cursor will not move. This is normal. This will create /dev/mapper/temp_name

Mount the decrypted partition and see whats inside

sudo mkdir /mnt/temp_dir
sudo mount /dev/mapper/temp_name /mnt/temp_dir
sudo cat /mnt/temp_dir/etc/crypttab

The last line should show you the contents of the crypttab file which should look like:

correct_name UUID=78base79-8463-4046-a2b1-3a36b14cf42d none luks,timeout=30

Write down the correct_name to continue with the tutorial.

Undo all the steps

Type the following commands to return everything as they were before:

sudo umount /mnt/temp_dir            # Un-mounts /dev/mapper/temp_name
sudo rmdir /mnt/temp_dir             # Deletes the temp_dir
sudo cryptsetup luksClose temp_name  # Un-maps the LUKS partition from tem_name

Hope this helps