I’m a new Linux/Fedora KDE user, been using it for the past couple of months.
Today, after I tried logging into my Fedora 37 system, all of a sudden it will not accept the passcode to unlock the LUKS-secured drive where my Linux installation and files are located. I ran dnf-update yesterday so I’m not sure if that affected anything. Otherwise, nothing else has changed.
What I have tried to fix it
I have spent a couple of hours trying to fix this and found some odd things.
Firstly I booted Fedora off a USB to try to access the drive. I tried unlocking it with the passcode but no luck.
Then I rebooted again into the same USB system. I tried a couple more times to unlock the drive and they all failed. Then on about the 4th or 5th try, all of a sudden the passcode worked and I was into the drive. I had a look and all of my files were still there and the drive seemed fine.
All good, right? Well not after I rebooted again. Now it’s back to what it was and I can’t unlock the drive.
After a lot of forum searching, one of the solutions I have tried is running testdisk and it has found no errors in the partitions or drive. I can see the three partitions created in KDE Partition Manager.
I am 110% sure that this is the correct passphrase. I checked my keyboard layout and it has not changed.
There has been no hardware change.
System specs and relevant info
2TB WD Black SN770 (Linux)
1TB SPCC (Windows 10)
2TB WD Blue HDD (large file storage)
Prime B650-Plus Motherboard
Dual boot Windows 10 and Fedora 37 KDE on separate SSDs (as above)
As I mentioned I’m new to Linux and not experienced with this OS so any help or points would be greatly appreciated.
I booted a Fedora 37 live image and tested that out. I got the error No key available with this passphrase.
Although, again strangely, after a couple of attempts trying to unlock it just through Dolphin, it successfully unlocked it just once. All of the other 10-15 subsequent times that I’ve tried have all failed, including trying to add additional passkeys via sudo cryptsetup luksAddKey.
I should have mentioned that I tried booting into all older kernels, including the recovery one, all with the same result.
Now that I’m in I am making another backup of all of my files on the drive. But I would still like to understand what has happened here.
Some follow up for another thing that I have now tried.
I have run cryptsetup isLuks on the relevant partition and it shows up as yes. I have also run cryptsetup luksDump and it shows what looks like a standard header (from what I can tell).
If I understand correctly, /dev/nvme0n1 should be your physical drive.
Then something like /dev/nvme0n1p3 should be your LUKS partition.
And Btrfs should be inside the decrypted LUKS volume.
So, it is confusing why you run filesystem check on the physical drive.
Be aware, that careless use of this kind of command is dangerous.
In the worst case, it can irreversibly corrupt your LUKS volume.
This is still wrong and dangerous.
You can only run filesystem check on a decrypted LUKS volume.
It should be /dev/mapper/DECRYPTED_VOLUME_NAME.
Never run filesystem check on an encrypted LUKS volume.
Once again I was randomly able to log in to the drive when logging into Fedora 37 as usual. But when I go to run cryptsetup luksAddKey or execute other commands requiring a passcode, the same errors as before come up.
It don’t understand why my passcode only works ~sometimes~ If it never worked, I’d assume something has corrupted or whatever, but this is making no sense whatsoever.
EDIT:
Today I have also run:
sudo smartctl -H /dev/nvme0n1p3
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.2.7-200.fc37.x86_64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
I also noticed that an update for Upgrade to new version 2:1.34-6.fc37 Release notes: Fix for CVE-2022-48303 has not been installed. When I try to install it I get this error: <html>Internal error:<br/><br/>Error running transaction: package tar-2:1.34-6.fc37.x86_64 is already installed</html>
Not sure if any of this is relevant or not just putting it here just in case.
I would try changing the passphrase just to see what happens, and at the same time use characters not present in current passphrase just to rule out the physical keyboard.
It looks more like a hardware failure, probably the keyboard or the disk.
Keyboard related issues can be isolated by reading the passphrase from a file.
Disk related issues require to analyze SMART diagnostics and run the relevant tests.
Turns out that after most of a day deconstructing my entire PC and removing, isolating and troubleshooting each individual component, I had a faulty RAM stick. As soon as I removed this, everything started working fine and I could unlock the drive with no issues.
I have no idea how faulty RAM affects whether or not I can unlock a SSD but there you go.