You are not logged in.

#1 2011-08-12 08:09:14

joshdmiller
Member
From: California
Registered: 2010-04-25
Posts: 51
Website

[solved] crypttab partitions will not mount without "ASK"

I have three LUKS partitions on a hard drive (root, home, and swap) where the second two are controlled through /etc/crypttab. Boot fails on fsck because the home partition has not been mounted; if I change the crypttab entry from the password to "ASK" I am prompted for the password prior to fsck and the system boots fine. I obviously don't want to have to enter three passwords on boot, so I want the correct entries in crypttab.

What am I doing incorrectly?

Last edited by joshdmiller (2011-08-12 20:08:22)

Offline

#2 2011-08-12 09:35:30

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: [solved] crypttab partitions will not mount without "ASK"

Maybe you provided incorrect passwords. Or did you use accented characters?

Offline

#3 2011-08-12 16:24:05

joshdmiller
Member
From: California
Registered: 2010-04-25
Posts: 51
Website

Re: [solved] crypttab partitions will not mount without "ASK"

siriusb wrote:

Maybe you provided incorrect passwords. Or did you use accented characters?

LOL. No, the password is correct and there are no accented characters, but there are plenty of symbols and it is 32 characters long. I tried with quotes and without.

Offline

#4 2011-08-12 16:41:37

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: [solved] crypttab partitions will not mount without "ASK"

We have to rule out the most evident possibilities. It's always my first step big_smile

Well, with all those symbols it can be an encoding problem, don't you think?

Offline

#5 2011-08-12 18:10:02

joshdmiller
Member
From: California
Registered: 2010-04-25
Posts: 51
Website

Re: [solved] crypttab partitions will not mount without "ASK"

siriusb wrote:

We have to rule out the most evident possibilities. It's always my first step big_smile

Indeed!

siriusb wrote:

Well, with all those symbols it can be an encoding problem, don't you think?

They are standard symbols and follow the rules of bash quoting. As there is an asterisk, I tried single quotes as well but with no success. In either event, it always works when prompted.

Offline

#6 2011-08-12 18:47:54

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: [solved] crypttab partitions will not mount without "ASK"

Since LUKS provides the management of multiple password why don't you add one more simple key without any fancy character? Just to be sure that this isn't about your password. And other than that I can't think of anything else smile

Offline

#7 2011-08-12 20:08:02

joshdmiller
Member
From: California
Registered: 2010-04-25
Posts: 51
Website

Re: [solved] crypttab partitions will not mount without "ASK"

siriusb wrote:

Since LUKS provides the management of multiple password why don't you add one more simple key without any fancy character? Just to be sure that this isn't about your password. And other than that I can't think of anything else smile

I do not have any extra hard disks and the partition is in use, so I just reformatted my swap partition as a test with a simple "password", which worked flawlessly. So the problem is obviously the characters in the password. Thanks your help.

After further manual investigation (running read_crypttab from rc.sysinit) it appears that passwords cannot contain hash marks or the remaining part of the line is considered a comment - I think this is due to the use of eval in read_crypttab - and bash complains about an unexpected EOF due to a missing matching double quote. That is

swap     /dev/sda2     "password#hash"

is evalled as

swap     /dev/sda2     "password

which obviously can't work. But the double-quotes should take care of this; the top of the crypttab file says "to use special characters, surround it by quotes, the usual bash quoting rules apply".

And wouldn't you know it - I found a corresponding bug report. And the patch does fix the issue. Wonder why this hasn't been fixed yet...

Offline

Board footer

Powered by FluxBB