5

I decided to reformat my hard drive and install a clean copy of the newly released Ubuntu 14.04.2 with full disk encryption (incl. LVM) and I chose a strong password with special characters which works out fine every single time I play around with it during the Ubuntu installation.

However once the installation was finished and my desktop computer rebooted for the first time, it was all black, not going anywhere passed the motherboard boot screen?

I hit the "reset" button on my case to double check, rebooted once more, only this time I was greeted with an GNU GRUB menu with four options and I chose "Ubuntu", then the much anticipated Ubuntu-logo and a text telling me to "enter passphrase" in order for me to unlock my disk with my chosen encryption password came up; however despite knowing that I had typed the correct password at least a hundred times (checked if caps lock or numpad was causing this, which it wasn’t) it still refuses to decrypt on login with the following error message: "cryptsetup: cryptsetup failed, bad password or options?".

What's going on here? Why is it that my password work every single time when I play around with it during the installation, but whenever I try to actually decrypt and login to Ubuntu it fails?

Are there any characters (super characters) that aren't allowed in the encryption password or could this be a bug because of my Swedish keyboard layout?

Mathias
  • 67

4 Answers4

6

Unfortunately, the keyboard layout DOES matter. :(

On bootup, you start with the US Keyboard layout. As your filesystem is decrypted (entering the correct password), any settings changing keyboard layout (such as you changing it to Swedish Keyboard Layout) will be applied.

What I suggest is the following:

  1. Do a fresh install again. (sorry)
  2. When installing Ubuntu, just leave the keyboard layout alone (leave it to US).
  3. AFTER successfully installing Ubuntu and decrypting your filesystem on the first boot, THEN you can change the keyboard layout.

See this Unix Stack Exchange post for more details.

  • 1
    I choose not to change my keyboard layout from "English" to "Swedish" and now I'm able to decrypt my hard drive with my desired password (crypt) and login to Ubuntu (despite having to type my password during that awful black screen again but other than that works flawlessly) thank you! – Mathias Feb 20 '15 at 23:20
  • No problem! Anytime! :) –  Feb 20 '15 at 23:21
  • When I changed back to my native keyboard layout and restarted my computer, I was once again unable to decrypt my hard drive and login to Ubuntu.

    However I found a workaround tested by another user http://askubuntu.com/questions/321268/cryptsetup-does-not-accept-passphrase-after-installation

    – Mathias Feb 21 '15 at 00:45
  • 1
    all I had to do was to run Ubuntu from a "live-cd" (in my case USB) and while in Ubuntu's live session I changed my keyboard layout under "text entry" (in the top right cornet) to my native language and removed all the remainders from the list, hit the "install ubuntu 14.04.2" desktop shortcut, followed the on screen instruction (choose my native keyboard layout and language) entered my desired passphrase, once finished and rebooted I entered my passphrase and was surprised to see the following message "cryptsetup: sda5_crypt set up successfull" it actually works. – Mathias Feb 21 '15 at 00:46
  • Ah! I didn't know that. And that's awesome that it works now! :) –  Feb 21 '15 at 00:53
  • 1
    @Fabby he was kind enough to help me out, but I thought that since his solution didn't help me other than to broaden my mind (what could be the cause of error) and I was forced to run a live-cd (usb) and manually set my keyboard layout (language) prior to installation and creating my encryption passphrase that I necessary didn't have to put it as "accept this answer" however I did that just now simply for him helping me out to begin with (read my above solution; it works). – Mathias Feb 22 '15 at 13:26
2

I had this same problem as I had written my password at setup with my Portuguese keyboard thinking I'd be writing it with the Portuguese keyboard layout; since during the setup the keyboard layout is in US my password turned out to be something else. The way I was able to decrypt the disk was by changing the layout on another computer to US and writing my password as if the Portuguese layout was the one in use, this writes up the password as it was stored.

For example, for me the key combinations for | generated a ~.

After writing the password with the US Keyboard Layout as if I was using my layout I get the character sequence I have to write to decrypt the disk and it's solved.

1

I had this problem too and while it still exists for me I have identified a workaround that enables my system to boot. My issue was to do with cryptsetup not accepting my password. This prevents me for booting and fixing system issues.

Turns out that my password included a special character '@' as in P@ssword. At the prompt pressing RIGHT SHIFT and key 2 does not generate a '@' instead a '2' is generated. This can be confirmed by switching over to another TTY and typing in the password (CTRL + ALT + F1). I noted that using LEFT SHIFT and key 2 generated the '@' control character. Thus if LEFT SHIFT is used in complex password it will be typed correctly and cryptsetup will be able to decrypt the volume.

Note the Ubuntu install program rates user password with Poor, Fair, or Good thus encouraging the use of special characters leading to this scenario in the ubuntu recovery mode.

seabase
  • 21
0

The Point is that at the time someone set the password for cryptsetup during install, the keyboard layout is english. therefore your password is set in english. and that means only a few keystrokes are wrong. when the install is complete the keyboard layout during startup already is in the language you selected during install. But your password is wrong because set in english keyboard layout. Why dont simply correct the password? Startup with the twisted password, login, and change it! There is a tool called "gnome-disk-utility". Install it and you have a nice tool where you can manage your partitions, create imges of them and... change encryption passwords! If you are using your prefered layout inside kde gnome or whatever now you can correct your password. There is NO need to install the system again.