15

A few months ago I set full disk encryption during installation of Ubuntu 17.10. Now, I've decided to upgrade. The upgrade ran to the end without any problems. However, after reboot I am not able to log into my encrypted disk.

Where can be the problem? I am 100% sure I press the "right keys" on the keyboard, but technically I don't know what I am writing because of "*" characters and maybe after upgrade my keyboard layout changed. I use some characters which might be somewhere else on the keyboard. What language is default after upgrade?

By the way, I've already tried Caps-lock, but still no luck.

Help will be really appreciated. I am not a fan of installing my system and all backups over and over again.

rcomblen
  • 275
M_Ryan
  • 171
  • have you tried to mount the drive from a USB Key? You can do it via GUI in the Drives application. – luisgonzalez May 02 '18 at 23:20
  • Thank you for reply. After few wrong attempts I got to initramfs - so in a command line. Cool. I've tested my charset (its ok), I've checked there is some key set via $ cryptsetup luksDump. So I tried to add new passphrase to my encrypted partition: $ cryptsetup luksAddKey /dev/sdb1 . But I am still getting error about wrong password. Its crazy, I know for 100% that this password was working before upgrade. – M_Ryan May 02 '18 at 23:49
  • 1
    So... To be absolutely sure its not a typo, I've booted live CD and I've spend some time trying different passwords with:

    $ echo -n "blahblah" | cryptsetup luksAddKey /dev/sdaX

    I know I AM writing right password, I've even tested same keyboard keys using UK and US layout + in combination with caps-lock. Just to be sure. Still "No key available with this passphrase".

    cryptsetup luksDump /dev/sdaX shows key slot 0 as enabled.

    Well, so it looks like "something happened" during Ubuntu 17.10 to 18.04 upgrade and my luks partition is locked-out. Anything like that ever happened to you?

    – M_Ryan May 03 '18 at 01:06
  • I upgraded from 16.04 to 18.04 and I'm having a different issue than yours. In my case it was a LUKS partition that shows another type of error. – luisgonzalez May 03 '18 at 03:30
  • If there is no more keys than the partition is lost, isn't it? – Christopher Perrin May 03 '18 at 16:22
  • Same problem here. Upgrade from 14.04 to 16.04 went well: chosen same user name and password of old profile, which worked for both login and encryption, while maintaning old \home directory, Upgrade from 16.04 to 18.03 is a disaster: not a problem of keyboard layout, since logging in from console (say tty2) is OK (caps lock is OK), and launching ls there shows indeed that the data have not been decrypted. I am absolutely sure of having used the same password all over. Encyption+ubuntu18.03=bug – XavierStuvw Aug 20 '19 at 21:46
  • I came across this problem when installing Ubuntu 18.04.3 LTS and maintaining an encrypted /home directory from previous releases, which read it seamlessly. In my case it is a stubborn problem which is not caused by the mismatch of keyboard layout. So I am afraid the issue can be bigger than that at least in some occasions – XavierStuvw Aug 21 '19 at 08:11
  • Continuing the comment above: it is a bigger issue indeed. The old tools to encrypt single directories have been discontinued in 18.04 and the conversion from the old to the new system is a source of bugs. For an informed post see https://askubuntu.com/questions/1030572/why-was-home-encryption-dropped-in-the-18-04-installer – XavierStuvw Aug 21 '19 at 08:30

2 Answers2

12

Got the same issue when I have upgraded my ubuntu from 17.10 to 18.04. After lot of testing I found a solution for my problem. I just changed the keyboard layout in US and typed my password in my nativ layout (azerty). So it seems that the cryptsetup prompt is now in my nativ layout and not in US anymore. And my password was never stored in azerty layout as I thought.

Hope my solution will help you, and excuse me for my poor English.

  • 1
    This was the solution for me. Password entered at cryptsetup (17.04) was actually in the U.S. keyboard layout, after upgrading it changes to native language; thus you now have different keys to press - e.g., if you pressed " you actually entered @ when typing the password, if you pressed £ you actually entered #. Map the symbols from the native layout to the corresponding U.S. symbols. – Vix May 17 '18 at 11:26
  • 1
    Same here. My passphrase, which I entered during installation and always thought was in sv_SE layout seems like it always was in en_US. Hence the characters that's on different keys between en_US and sv_SE needed to be typed where they would be for sv_SE. – mgor May 20 '18 at 14:36
  • I also lost access to my laptop after I upgraded. Even though I use US english layout, my password was not accepted at startup, but I could decrypt the disk from a livecd. I changed password several times using only ASCII characters, and it never worked until I tried a password consisting entirely of numbers! This is a really annoying bug. – Roman Kiselev Feb 06 '20 at 20:15
2

This appears to be caused by a bug in 17.10 which causes the layout to always be the standard US layout when entering your password even though you've set the layout to something else.

I use Dvorak, so I had it set to that when entering my password for encryption initially. Only it's not actually Dvorak while typing it in, it's really still the standard US layout.

For example, let's say your password is "hello". Typing "hello" and assuming Dvorak when the layout is really the standard US layout yields "jdpps". You assume your password is "hello" but its' actually being stored as "jdpps".

You never notice this, because when it prompts you, it's also standard US behind the scenes, so typing your password "hello" in Dvorak yields "jdpps" in reality, and you're in.

In 18.04 though, they seem to have fixed the bug. So now when you type "hello" in Dvorak, it's really "hello", and no longer matches your stored password.

To get back in you simply need to figure out what was actually stored, by seeing what would be output if you typed your password in your native layout while the actual layout is set to US English. I did this, and typed that password in, and it worked.

Hope this helps someone else, I struggled with this for a good few hours. I would say this is really one of the most perfect bugs I've ever come across.