Why is password requested repetitively to mount encrypted USB drive?
I have a USB drive, encrypted with LUKS cryptsetup, that I use for regular backups.
When I plug in the drive, I am prompted for a password, just as expected. But then the drive gets mounted, an icon appears on my desktop, and a second password dialogue is shown.
The message in the dialogue – “A passphrase is needed to access …” is wrong. I can ignore the second dialogue, or cancel it, and I am able to access the drive.
See the screen-shot, which shows the drive icon (unlocked), files on it in Nemo, and the second password dialogue.i.sstatic.net/19TQtA73.png
It gets weirder: if I enter my password again, it is rejected and the dialogue reappears. This seems to happen infinitely, until I Cancel the dialogue.
Is this a bug, or am I doing something wrong?
Here is the lsblk output (sda is the USB drive):
I am using Linux Mint 22.1 Cinnamon.
There are similar questions but they refer to boot problems. e.g. askubuntu.com/questions/1106136/prompte...despite-separate-unencrypted-boot-part.
Edit - Answers to early comments.
I don’t have KDE, it’s not even in the Mint distro.
I tried running ps -fu ME at various stages:
All of which leads me to assume the dialogues are part of Cinnamon, and not a separate process.
• * Edit - Answers to @waltinator **
No output at all from sudo journalctl --follow |tail -f. It was started before the drive was plugged in, and left running through both dialogues.
Here are my notes from when the drive was encrypted. It was brand-new so had nothing to save.
To use the GUI: Launch Disks to get access to the encryption utility. Plug in your memory stick and look for it in the list of available disks. Create a temporary folder and copy out all of the files you have on the stick. Next, you choose to format the external drive, specifying the encryption option. Remember, this action will mean that you will only be able to access the files on Linux computers that also have cryptsetup installed. If you don’t want to encrypt the entire memory stick, partition it first. This action can also be performed in the Disks utility.
You specify a password when the Format procedure launches. The formatting process offers you the option to not overwrite existing data. However, this doesn’t work and you will lose all of your files on the memory stick during the formatting process. That’s why you need to copy them over to a temporary folder before you start the encryption process. Once the formatting finishes, copy your files back over.
A drive that has been protected by encryption is flagged in the Disks display by a padlock icon. Henceforth, when you click on that drive to access it, a popup window will appear to prompt you for the password. Options in the popup specify whether the computer should store the password for future access, whether it should forget the password immediately, or whether it should forget the password once the USB stick is removed from the computer.
Clues from Disks app
This is still a problem, even though I am now using Mint 22.3, so I tried this:
Insert the USB drive, but cancel the password dialogue.
Run the Mint Disks GUI app.
Disks initially shows a single partition of type LUKS, not mounted.
Click the Unlock (open padlock) item, then enter the password.
A second partition is now shown, of type Ext4 and name as configured.
Click the Mount icon, the second partition is mounted without prompting for a password.
I wonder if this is helpful to anybody out there?