[pkg-cryptsetup-devel] Bug#807600: Bug#807600: Boot hangs

John Talbut jt at dpets.co.uk
Sat Dec 19 07:22:30 UTC 2015


Hi Jonas

On 18/12/15 21:29, Jonas Meurer wrote:
> Am 17.12.2015 um 17:02 schrieb John Talbut:
>> On 17/12/15 11:22, Jonas Meurer wrote:
>>>> Is there anything else I can do to help diagnose the problem?
>>>
>>> In the initramfs emergency shell that starts, please run the following
>>> commands and send us the result:
>>>
>>> # ls -al /dev/mapper/
>> # No such file or directory
>>
>> But
>> # ls /dev/mapper/
>>
>> drwxr-xr-x  2 0 0     60 .
>> drwxr-xr-x 13 0 0   3060 ..
>> crw-------  1 0 0 10,236 control
>>
>>> # dmsetup table
>> # No devices found
>
> Ok, so during initramfs stage, no device-mapper device is created until
> the point that it drops into the emergency shell.
>
>>> # sed -i -e 's#/bin/sh#/bin/sh -x#g' /scripts/local-top/cryptroot
>>> # /scripts/local-top/cryptroot>
>> # Syntax error: newline unexpected
>>
>> but if I put a file name (on a mounted data stick) after this, the file
>> contained:
>
> The sed command is supposed to append a '-x' to the shebang (first line)
> of the script /scripts/local-top/cryptroot, so that it becomes
> '#!/bin/sh -x'. This enables the debug mode in the shell script.
>
> The second command had a typo at the end: The '>' was not supposed to be
> there. *If* you want to redirect output of the script to a file, you'll
> need to redirect STDOUT *and* STDERR:
>
> # /scripts/local-top/cryptroot >/mnt/initramfs_cryptroot.log 2>&1

Log attached
>
>>    Reading all physical volumes.  This may take a while...
>> Begin: Waiting for encrypted source device... ...   Reading all physical
>> volumes.  This may take a while...
>> [...]
>
> Unfortunately, this is only the STDOUT output of the script, without the
> debug logs to STDERR. But see below.
>
>>    Reading all physical volumes.  This may take a while...
<snip>
>>    Reading all physical volumes.  This may take a while...
>> done.
>>    ALERT! /dev/disk/by-uuid/48537739-1f62-4c12-8bf1-9d662d8cc74f does not
>> exist.
>>      Check cryptopts=source= bootarg: cat /proc/cmdline
>>      or missing modules, devices: cat /proc/modules; ls /dev
>> -r Dropping to a shell. Will skip
>> /dev/disk/by-uuid/48537739-1f62-4c12-8bf1-9d662d8cc74f if you can't fix.
>
> Your sda2_crypt device is not unlocked by the cryptroot script in
> initramfs stage for a simple reason: The UUID that you defined as the
> UUID for the source device is not found.
>
> Your /etc/crypttab contains the following:
>
> sda2_crypt UUID=48537739-1f62-4c12-8bf1-9d662d8cc74f none luks
>
> This means, that the initramfs cryptroot script will search for a device
> with UUID '48537739-1f62-4c12-8bf1-9d662d8cc74f' and try to unlock it.
> Obviously, that device does not exist (at least not initramfs stage).
>
> What do the following commands in the initramfs emergency shell give:
>
> # cat /conf/conf.d/cryptroot

target=sda2_crypt,source=UUID=48537739-1f62-4c12-8bf1-9d662d8cc74f,key=none,rootdev,lvm=dk-rt
target=sda2_crypt,source=UUID=48537739-1f62-4c12-8bf1-9d662d8cc74f,key=none,lvm=dk-sw

> # ls /dev/disk/by-uuid/
drwxr-xr-x 2 0 0  60 .
drwxr-xr-x 6 0 0 120 ..
lrwxrwxrwx 1 0 0  10 e74eac1a-df14-4706-bcc5-1f870278f075 -> ../../sdc1
> # ls /dev/sd*
brw------- 1 0 0 8, 0 /dev/sda
brw------- 1 0 0 8,16 /dev/sdb
brw------- 1 0 0 8,17 /dev/sdb1
brw------- 1 0 0 8,32 /dev/sdc
brw------- 1 0 0 8,33 /dev/sdc1
> # blkid /dev/sd*
/dev/sdb: PTUUID="25169f0a-30ad-47e5-81a9-d74ae8286776" PTTYPE="gpt"
/dev/sdc: PTUUID="c3072e18" PTTYPE="dos"
/dev/sdc1: LABEL="Dmesg" UUID="e74eac1a-df14-4706-bcc5-1f870278f075" 
TYPE="ext3" PARTUUID="c3072e18-01"

But, of course, these were confused by me having a memory stick in, 
/dev/sdc.  Noting the results after removing the memory stick I got:

 > # ls /dev/disk/by-uuid/
This folder no longer existed.  /dev/disk only contained by-path and by-id
 > # ls /dev/sd*
listed /dev/sda, /dev/sdb, /dev/sdb1
 > # blkid /dev/sd*
/dev/sdb: PTUUID="25169f0a-30ad-47e5-81a9-d74ae8286776" PTTYPE="gpt"

With the system booted using a stock kernel:
blkid /dev/sd*
/dev/sda: PTUUID="25169f0a-30ad-47e5-81a9-d74ae8286776" PTTYPE="gpt"
/dev/sda1: PARTUUID="1e4484e1-1499-4f9a-bd2f-e0f4d61e9920"
/dev/sda2: UUID="48537739-1f62-4c12-8bf1-9d662d8cc74f" 
TYPE="crypto_LUKS" PARTLABEL="dk" 
PARTUUID="6b5c5648-1b4b-4be5-83d7-7c47eb8b53a6"
/dev/sda3: UUID="bf028ceb-d1fa-4f62-b41f-d9d44adbe65a" TYPE="ext4" 
PARTUUID="5970fa70-34fa-4eca-aaf7-f085c9b55a27"

 From fdisk -l:

Device       Start       End   Sectors   Size Type
/dev/sda1     2048    391167    389120   190M BIOS boot
/dev/sda2  1050624 625141759 624091136 297.6G Linux filesystem
/dev/sda3   391168   1050623    659456   322M Linux filesystem

sda3 is the boot partition.

>
> My current guess is, that your problem is simply a wrong UUID defined in
> crypttab. Most likely, correcting the UUID in /etc/crypttab and
> recreating the initramfs afterwards will fix your issue.
>
> Also, as a sidenode: it seems like you have the same line repeated three
> times in /etc/crypttab. You can safely remove all but one.

Hmm, how does /etc/crypttab get created?  It is not a file I have ever 
set up (apart from I have now removed the extra 2 lines).

John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initramfs_cryptroot.log
Type: text/x-log
Size: 251648 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20151219/b24cbd84/attachment.bin>


More information about the pkg-cryptsetup-devel mailing list