Can't unlock disk sda5_crypt after upgrade to 18.04

12,832

Solution 1

I guess two approaches could be tried. I cannot guarantee they will work because I haven't tried them - I ended up reinstalling Ubuntu before trying these.

Approach 1 (if using a non-US keyboard layout)

Type your passphrase considering the following two scenarios if, for example, you were using a UK keyboard layout.

  1. Your passphrase was created using the US keyboard layout,
    but now the keyboard is in the UK layout.

  2. Your passphrase was created using the UK keyboard layout,
    but now the keyboard is in the US layout.


This approach is based on my guess from oroy's answer and also my experience while reinstalling Ubuntu 17.10 and upgrading it to version 18.04


Approach 2

Boot from a live USB stick or a CD and add a new passphrase to sda5_crypt (and also remove old passphrase if you want). For how to do this, see https://askubuntu.com/a/110195/828323.


This approach is based on xenoid's comment.

Solution 2

Thanks for mentioning the keyboard issue for sd5_crypt after upgrading to Ubuntu 18.04.

I tried that before but you made me look at it again with more scrutiny. For me it wasn't about UK vs US keyboard layouts but realizing that for sd5-crypt I was still on an english layout which I mixed with German layout.

Looking up the keyboard maps in Wikipedia: https://en.wikipedia.org/wiki/British_and_American_keyboards

I transposed my passphrase into english-layout string and it worked for me.

STRANGE THING that this problem did not occur with previous version Ubuntu 17.10

Share:
12,832

Related videos on Youtube

gknam
Author by

gknam

Updated on September 18, 2022

Comments

  • gknam
    gknam over 1 year

    After upgrading my Ubuntu MATE to 18.04, I can't login at the screen that says "Please unlock disk sda_crypt".

    When I switch to a console-like screen by pressing ESC, I see the following messages.


    Warning: Failed to connect to lvmetad. Falling back to device scanning.
    Volume group "ubuntu-mate-vg" not found
    Cannot process volume group ubuntu-mate-vg
    Please unlock disk sda5_crypt
    

    I suspect this may be keyboard layout issue because the password is still working - I could boot into UBUNTU 17.10 from a USB stick and open the hard drive from GUI using the password. I've been using UK layout, but perhaps the upgrade reset it to US one?

    But unfortunately I can't find a way to change the keyboard layout without getting past this screen first.

    Could anyone help?

    Update 1:

    I've checked the keyboard layout settings. They both indicate UK layout, which is what I need. Is there any other file I could check?

    Content of /etc/default/keyboard:

    # KEYBOARD CONFIGURATION FILE
    # Consult the keyboard(5) manual page.
    XKBMODEL="pc105"
    XKBLAYOUT="gb"
    XKBVARIANT=""
    XKBOPTIONS=""
    BACKSPACE="guess"
    

    Output of setxkbmap -query command:

    rules:      evdev
    model:      pc105
    layout:     gb
    

    Update 2:

    I've just reinstalled version 17.10 and upgraded it to 18.04. And I noticed that the upgrade changed the keyboard layout at the crypt unlocking screen from US to UK.

    So, contrary to what I thought, I guess my crypt password had been based on the US keyboard, and it didn't work after the upgrade because the keyboard layout switched to the UK one.

    • Felipe
      Felipe almost 6 years
      I'm assuming you have a UK keyboard and the system is using a US layout. I recommend that you print the current layout so you can have a guide and find the appropriate keys to type the password and then get into the OS and change it to what you need. If this is not a layout issue, I have no idea how to help you.
    • gknam
      gknam almost 6 years
      Thank you Felipe for your comment. I've updated the question with the current keyboard layout settings. I still can't unlock the cryptsetup (and therefore cannot login because login screen comes after that) so will it be possible to change the keyboard layout from a live session?
    • xenoid
      xenoid almost 6 years
      If you can open the disk with a live USB (or going back to the previous version) you can add a 2nd password entry with some layout- agnostic password, and use that until you have fixed everything.
    • gknam
      gknam almost 6 years
      Thank you for your suggestion, xenoid. That would have been a very good solution although this time I ended up reinstalling it. I'll try it with the next upgrade if the same thing happens.
  • gknam
    gknam almost 6 years
    Thank you very much for your comment, Oroy, and I'm sorry for not replying earlier. I'm kind of repeating what I said in my question, but that sounds similar to what happened to me. When I was reinstalling Ubuntu 17.10, the US keyboard layout was used for the crypt passphrase even though the on-screen keyboard (i.e. I could see what I was typing on screen) was a UK one. I realised this only after I upgraded to 18.04 again, when I had to type a US-to-UK-layout-converted passphrase to log in. Anyway, let's hope the next upgrade won't cause this.