Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  111] [ 0]  / answers: 1 / hits: 181262  / 2 Years ago, wed, december 1, 2021, 2:27:49

I installed Ubuntu 11.10 with the alternate CD and encrypted the whole system (except boot) with the encrypted LVM. Update 2020: Encrypted LVM can be selected at the Installation type step of the Ubuntu install, click on Advanced features and choose Use LVM and Encrypt ...

Everything works great as before, but I would like to change the password of the encrypted LVM. I tried to follow the Tips and Tricks of this article, but it does not work.
After typing:

sudo cryptsetup luksDump /dev/sda5

It says: "Device /dev/sd5 doesn't exist or access denied."
I thought the encrypted partition is /dev/sda5.
Any help how to change the password?

More From » password


Using the Disks application:

In Ubuntu 18.04 or newer there is the possibility of using (Gnome) Disks. Thanks for the hint, Greg Lever, after clicking around I found what Greg mentioned:

  1. Open Gnome Disks.

  2. Choose/Click on the main physical hard drive in the left panel.

  3. Click on the LUKS encrypted partition, in this example it is Partition 3:
    Screenshot Gnome Disks

  4. Click on the edit icon (cogs, gear wheels) and choose "Change Passphrase".

If you get an error, close GNOME Disks and open it in a terminal: sudo gnome-disks

(This helped @ScriptAutomate, thank you for the tip.)

Or using the command-line:

Here is the answer that worked for me, after Hamish helped me to realize my typo.

WARNING (for older Ubuntu versions, newer (e.g. 19.04) should be bug-fixed but be careful anyway): If you only have one key and remove it before adding another, you will render your disk inaccessible after rebooting! This also means you can not add a new key anymore afterwards. Thanks waffl and khaimovmr for these helpful comments.

First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5 (default on Ubuntu LVM), sdX2, ...:

cat /etc/crypttab

To add a new password, use luksAddKey:

sudo cryptsetup luksAddKey /dev/sda3

To remove an existing password, use luksRemoveKey, by typing the passphrase to remove:

sudo cryptsetup luksRemoveKey /dev/sda3

View currently used slots of the encrypted partition (make sure at least one slot is shown):

sudo cryptsetup luksDump /dev/sda3

Cited from this blog. Thanks.

Be aware: Flimm experienced that Ubuntu's system keyboard layout changed from Dvorak to Qwerty. You cannot see which keyboard layout you are using (bug #1862656) and you cannot choose to display the password (bug #1862654). Also, you only get three tries before being forced to wait for 60 seconds (bug #1862660). Thanks flimm for the helpful comment!

[#40048] Thursday, December 2, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 1
Total Questions: 112
Total Answers: 114

Location: Lesotho
Member since Wed, Jun 2, 2021
2 Years ago
girdleas questions
Fri, Jun 18, 21, 04:41, 2 Years ago
Thu, Mar 10, 22, 00:17, 2 Years ago
Wed, May 18, 22, 22:02, 1 Year ago