LUKS encryption doesn't work properly

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
linnie
Level 1
Level 1
Posts: 31
Joined: Thu Jul 30, 2015 4:32 am

LUKS encryption doesn't work properly

Post by linnie »

Hi,

I have a notebook with a German keyboard and two internal SSDs, the main SSD has Linux Mint 19.3 + data and the second SSD is for data backups. Both SSDs are encrpyted with LUKS. The main SSD was encrypted while I was installing Linux Mint, that means I had already changed to the German keyboard settings, when I set the passphrase. Once LM was fully installed, I encrypted the second SSD, which also means in this case the German keyboard settings were used.

Now my notebook doesn't boot up anymore, it doesn't even come to the boot screen (it tries to start up and then stops again with no avail - which can be heard by the ventilation going on and off. This can go on for hours). I couldn't find the cause for this. I even changed the CMOS battery. One workaround, however, was to wait for two days, then try again and it would usually work. But the last time waiting 2 days didn't work either.

To continue to work I took the two SSDs out of my notebook and hooked them to another notebook with a German keyboard and Linux Mint 20.3 version configured for German keyboard settings. To my surprise the passphrases wouldn't unlock either SSD. The error message was that the passphrase is wrong. (I even tried the passphrase as if it had been set by a US keyboard, but as expected that didn't work).

To conclude, I have two SSDs with two different passphrases and I cannot access my data anymore because my passphrases are not accepted. I really don't know what the reason for not booting up is and I am even more confused on why my passphrases don't work with LUKS once they are connected to another computer with the same OS (although two different versions - 19.3 versus 20.3). Does anyone have a clue what I can do?

Thanks,
Linnie
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
t42
Level 11
Level 11
Posts: 3708
Joined: Mon Jan 20, 2014 6:48 pm

Re: LUKS encryption doesn't work properly

Post by t42 »

You can mount your encrypted LUKS devices from another working Linux system or from live USB. You can find some articles describing how to do that from command line on Debian / Ubuntu based systems.
-=t42=-
User avatar
SMG
Level 25
Level 25
Posts: 31310
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: LUKS encryption doesn't work properly

Post by SMG »

linnie wrote: Fri Jun 24, 2022 12:54 pmI have a notebook with a German keyboard and two internal SSDs, the main SSD has Linux Mint 19.3 + data and the second SSD is for data backups. Both SSDs are encrpyted with LUKS. The main SSD was encrypted while I was installing Linux Mint, that means I had already changed to the German keyboard settings, when I set the passphrase. Once LM was fully installed, I encrypted the second SSD, which also means in this case the German keyboard settings were used.
The second SSD is just data?

Maybe something in this link will help you access your data How to mount and de-encrypt a LUKS encrypted partition to recover files [closed].
linnie wrote: Fri Jun 24, 2022 12:54 pmNow my notebook doesn't boot up anymore, it doesn't even come to the boot screen (it tries to start up and then stops again with no avail - which can be heard by the ventilation going on and off.
Did you try restoring to a Timeshift snapshot using an install usb and using Timeshift on the live session?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
axrusar
Level 6
Level 6
Posts: 1435
Joined: Sat Jan 30, 2021 5:30 pm

Re: LUKS encryption doesn't work properly

Post by axrusar »

very long shot.... but let me suggest something..
maybe the password you set had numbers, and you used the numeric pad on the keyboard with the num lock off?
try typing the passwords with the numbers on the keyboard disabled if you used numbers.. maybe you get lucky.
Linux Mint Una Cinnamon 20.3 Kernel: 5.15.x | Quad Core I7 4.2Ghz | 24GB Ram | 1TB NVMe | Intel Graphics
Image
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: LUKS encryption doesn't work properly

Post by Cosmo. »

I have to tell you something, what you most likely do not want to hear, but anybody must tell you, before you do possibly the same mistake in the future again:

A system can in case of an unsolvable problem get newly installed, the problem are the user data. The old rule says, that not backed up data is superfluous data. In case of encryption the importance of a backup increases to powers. So what about your backup?

Besides that: You described, that the total breakdown came after a kind of announcement. Did you at last during this period make a backup? I fear, that I know the answer.

Perhaps you have very much luck, otherwise you have made a learning experience on the hard way.
linnie
Level 1
Level 1
Posts: 31
Joined: Thu Jul 30, 2015 4:32 am

Re: LUKS encryption doesn't work properly

Post by linnie »

The second SSD is just data?
Yes
Maybe something in this link will help you access your data How to mount and de-encrypt a LUKS encrypted partition to recover files [closed].
Thanks, I will have a look at it when I am back. That means I cannot open the disks Utilities and decrypt a LVM/LUKS partition with disks? That's what I tried. If I understood correctly, that would only work through the command line.
Did you try restoring to a Timeshift snapshot using an install usb and using Timeshift on the live session?
I can't do a live session because the notebook doesn't even come to the point where I can choose the boot-up medium.
linnie
Level 1
Level 1
Posts: 31
Joined: Thu Jul 30, 2015 4:32 am

Re: LUKS encryption doesn't work properly

Post by linnie »

Cosmo. wrote: Fri Jun 24, 2022 4:04 pm I have to tell you something, what you most likely do not want to hear, but anybody must tell you, before you do possibly the same mistake in the future again:

A system can in case of an unsolvable problem get newly installed, the problem are the user data. The old rule says, that not backed up data is superfluous data. In case of encryption the importance of a backup increases to powers. So what about your backup?

Besides that: You described, that the total breakdown came after a kind of announcement. Did you at last during this period make a backup? I fear, that I know the answer.

Perhaps you have very much luck, otherwise you have made a learning experience on the hard way.
I have a backup, but that is about a week old. The daily backup is the second SSD (which would be the second best option after the main SSD), but I cannot access it. Plus, I do the weekly backup with copying the files through Nemo. I didn't have on the radar that the hidden files need to be copied as well. I thought I had a good backup concept, but only a real problem like this one will tell you whether it works in reality. Yes, this learning the hard way.
linnie
Level 1
Level 1
Posts: 31
Joined: Thu Jul 30, 2015 4:32 am

Re: LUKS encryption doesn't work properly

Post by linnie »

axrusar wrote: Fri Jun 24, 2022 2:14 pm very long shot.... but let me suggest something..
maybe the password you set had numbers, and you used the numeric pad on the keyboard with the num lock off?
try typing the passwords with the numbers on the keyboard disabled if you used numbers.. maybe you get lucky.
Thanks, but I didn't use the numeric pad.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: LUKS encryption doesn't work properly

Post by Cosmo. »

linnie wrote: Sat Jun 25, 2022 3:48 pm I have a backup, but that is about a week old.
Especially in case of encryption too few. And even worse, as you got this announcement. A daily backup would be the minimum, dependent from your usage even every few hours.
When you are back in business you should think about a reliable and automatic backup solution. (At the moment too early.)
User avatar
SMG
Level 25
Level 25
Posts: 31310
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: LUKS encryption doesn't work properly

Post by SMG »

linnie wrote: Sat Jun 25, 2022 3:45 pmThat means I cannot open the disks Utilities and decrypt a LVM/LUKS partition with disks?
I do not believe so. If there is a way of doing it through the Disks app, I am not aware of it.
linnie wrote: Sat Jun 25, 2022 3:45 pmI can't do a live session because the notebook doesn't even come to the point where I can choose the boot-up medium.
I thought you moved the drives to another notebook where you have them attached. Are you not able to boot to a live session on the second laptop either? Or do you not have enough usb ports to be able to do that?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
dave0808
Level 5
Level 5
Posts: 973
Joined: Sat May 16, 2015 1:02 pm

Re: LUKS encryption doesn't work properly

Post by dave0808 »

SMG wrote: Sat Jun 25, 2022 4:11 pm
linnie wrote: Sat Jun 25, 2022 3:45 pmThat means I cannot open the disks Utilities and decrypt a LVM/LUKS partition with disks?
I do not believe so. If there is a way of doing it through the Disks app, I am not aware of it.
Yes, this is possible. The Disks app shows the partition as "LUKS" and will have a closed padlock symbol in the corner. One can click on the partition and underneath, in the row of icon buttons there are: "open padlock" (unlock), "dash" (delete), and "gears" (config). Clicking on the open padlock will prompt for the passphrase and upon being entered correctly, the inner partition is displayed.

I have just once experienced the situation where my passphrase was not accepted on boot, and after 3 times I was dropped into a "new" desktop configuration. I rebooted and tried again, and my passphrase was accepted. Logic told me that I got it wrong 3 times and right after the reboot, but I just found it hard to believe.
User avatar
SMG
Level 25
Level 25
Posts: 31310
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: LUKS encryption doesn't work properly

Post by SMG »

dave0808 wrote: Sun Jun 26, 2022 8:59 am Yes, this is possible. The Disks app shows the partition as "LUKS" and will have a closed padlock symbol in the corner. One can click on the partition and underneath, in the row of icon buttons there are: "open padlock" (unlock), "dash" (delete), and "gears" (config). Clicking on the open padlock will prompt for the passphrase and upon being entered correctly, the inner partition is displayed.
Thanks for the info. Did you have to do anything special for it to mount? OP says they tried using Disks and it did not work, but they did not specify the specific steps they used which failed for them.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
t42
Level 11
Level 11
Posts: 3708
Joined: Mon Jan 20, 2014 6:48 pm

Re: LUKS encryption doesn't work properly

Post by t42 »

dave0808 wrote: Sun Jun 26, 2022 8:59 am Logic told me that I got it wrong 3 times and right after the reboot, but I just found it hard to believe.
Input error are more than possible despite the passphrase entered is correct. Users are unaware that the dm-crypt keyboard input repeat rate is too fast. Considering accompanying excitement you can make even five errors in a row and get wrong ideas about your system.
-=t42=-
dave0808
Level 5
Level 5
Posts: 973
Joined: Sat May 16, 2015 1:02 pm

Re: LUKS encryption doesn't work properly

Post by dave0808 »

SMG wrote: Sun Jun 26, 2022 9:33 am Did you have to do anything special for it to mount? OP says they tried using Disks and it did not work, but they did not specify the specific steps they used which failed for them.
Yes, the partition is then mounted in the normal way.

So to clarify, here are the exact steps required for unlocking and mounting, and unmounting and locking using the Disks application...
1) Click on LUKS partition
2) Click on padlock (unlock) icon below the displayed volumes
3) Enter passphrase and click the unlock button
4) On successful decryption, the displayed partition splits with the unlocked LUKS above and the Ext4 partition below
5) Click on the newly shown ext4 partition
6) Click on the "play" (mount) icon and the "Contents" below will indicate where the partition has been mounted

To reverse:-
1) Click on the mounted ext4 partition and click the "stop" (unmount) icon
2) Click on the LUKS partition and click the "closed padlock" (lock) icon
dave0808
Level 5
Level 5
Posts: 973
Joined: Sat May 16, 2015 1:02 pm

Re: LUKS encryption doesn't work properly

Post by dave0808 »

t42 wrote: Sun Jun 26, 2022 10:14 am Users are unaware that the dm-crypt keyboard input repeat rate is too fast.
So the slower and more carefully you type it in, the more chance there is for a key to repeat? That's some kind of irony. :lol:
User avatar
axrusar
Level 6
Level 6
Posts: 1435
Joined: Sat Jan 30, 2021 5:30 pm

Re: LUKS encryption doesn't work properly

Post by axrusar »

As with many other languages, there are different sets and variations of keyboards;

Image

I have no clue about the differences in the Germanic keyboards, but may be you used a different variation during setup?
Just install a bunch of them and try the same password over and over, maybe you get lucky.
Linux Mint Una Cinnamon 20.3 Kernel: 5.15.x | Quad Core I7 4.2Ghz | 24GB Ram | 1TB NVMe | Intel Graphics
Image
Locked

Return to “Software & Applications”