Very slow boot related to encryption with kernel 4.9.8

I have one encrypted partition (for /home etc.) and it’s taking nearly 2 minutes to boot (should be a few seconds) a HP Spectre x360 13-w023dx. The content from /var/log/boot.log seems odd (though I don’t know much about what I’m looking at) because it references both “part6” of the drive (which is the encrypted partition) and part8, which is a 980 MiB NTFS partition with label “Windows RE Tools”. Why is it doing anything with part8?

Partial content from /var/log/boot.log:

OK ] Started Cryptography Setup for cr_nvme-eui.002538ba61b1a071-part6.

  • ] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (12s / 1min 30s)
    

** ] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (13s / 1min 30s)
*** ] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (13s / 1min 30s)
*** ] (2 of 4) A start job is running for dev-mapper-cr_nvme\x2d2002538ba61b1a071\x2dpart8.device (12s / no limit)
*** ] (2 of 4) A start job is running for dev-mapper-cr_nvme\x2d2002538ba61b1a071\x2dpart8.device (13s / no limit)
***] (2 of 4) A start job is running for dev-mapper-cr_nvme\x2d2002538ba61b1a071\x2dpart8.device (14s / no limit)
**] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (14s / no limit)
*] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (15s / no limit)
**] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (15s / no limit)
***] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (17s / 1min 30s)
*** ] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (18s / 1min 30s)
*** ] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (18s / 1min 30s)

*** ] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (1min 23s / no limit)
** ] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (1min 24s / no limit)

  • ] (3 of 4) A start job is running for dev-mapper-cr_encrypted.device (1min 24s / no limit)
    

** ] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (1min 26s / 1min 30s)
*** ] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (1min 27s / 1min 30s)
*** ] (4 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device (1min 27s / 1min 30s)
*** ] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (1min 28s / 1min 30s)
***] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (1min 28s / 1min 30s)
**] (1 of 4) A start job is running for dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device (1min 29s / 1min 30s)
*] (2 of 4) A start job is running for dev-mapper-cr_nvme\x2d2002538ba61b1a071\x2dpart8.device (1min 28s / no limit)
TIME ] Timed out waiting for device dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart6.device.
[DEPEND] Dependency failed for Cryptography Setup for cr_encrypted.
[DEPEND] Dependency failed for dev-mapper-cr_encrypted.device.
[DEPEND] Dependency failed for Encrypted Volumes.
TIME ] Timed out waiting for device dev-disk-by\x2did-nvme\x2d2002538ba61b1a071\x2dpart8.device.
[DEPEND] Dependency failed for Cryptography Setup for cr_nvme-2002538ba61b1a071-part8.
[DEPEND] Dependency failed for dev-mapper-cr_nvme\x2d2002538ba61b1a071\x2dpart8.device.
Starting Activation of LVM2 logical volumes…
OK ] Started Activation of LVM2 logical volumes.

The encrypted partition seems fine once it finally finished booting. Any suggestions?
Thanks, Bill.

I should have noted that this huge delay and pile of messages occurs after I entered the password for the encrypted partition. The delay is not caused by it waiting for me to enter the password – the password prompt comes up early on, I replied to it, then it sticks on the screen with the infinity logo for a long time (hitting ESC reveals the warnings shown from /var/log/boot.log).

Your own words seem to mention only one encrypted partition.

The log messages seem to mention at least two encrypted partitions.

Maybe check “/etc/crypttab” to see what is listed there.

I’m not sure what is going on. But one possibility is a failing disk with errors reading the underlying physical disk. It might be useful to run some tests (with “smartctl”).

nrickert,

Thank you very much for the suggestion – I got it fixed! /etc/crypttab looked like this:

cr_nvme-2002538ba61b1a071-part8 /dev/disk/by-id/nvme-2002538ba61b1a071-part8 none none
cr_encrypted /dev/disk/by-id/nvme-2002538ba61b1a071-part6 none none
cr_nvme-eui.002538ba61b1a071-part6 /dev/disk/by-id/nvme-eui.002538ba61b1a071-part6 none none

My first guess was to comment out the first and last lines since the 2nd looks most similar to the /etc/crypttab from my old computer with older OpenSUSE, but that caused it to not prompt for the password and still hang for 1.5 minutes during boot, coming up without the encrypted partition mounted. My second attempt was to comment out everything but the last line and that worked perfectly.

Regarding SMART, this is a new laptop with a NVM SSD, so I’m not sure what to expect from it (new to SSDs), but “smartctl -a /dev/nvme0n1” gives:

SMART overall-health self-assessment test result: PASSED

Power On Hours: 57
Unsafe Shutdowns: 11
Media and Data Integrity Errors: 0
Error Information Log Entries: 70

Error Information (NVMe Log 0x01, max 64 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS
0 70 0 0x0016 0x4004 0x02c 0 0 -
1 69 0 0x0015 0x4004 0x02c 0 0 -
2 68 0 0x0016 0x4004 0x02c 0 0 -
3 67 0 0x0015 0x4004 0x02c 0 0 -

I’m guessing there’s nothing significant there, but I could be wrong. If there’s additional testing that can be done, I’m not sure how to do it ("-t long" doesn’t seem to do anything).

In case it provides any insight to anyone, I’m inclined to think it was a bad configuration caused by an installer/yast2 bug. I didn’t (before today) do any hand editing of config files – just install and yast2, and I certainly never told it to encrypt part8, so it’s hard for me to see how the weird stuff got in /etc/crypttab due to anything other than a bug. When I first installed Tumbleweed I think it was at kernel 4.9.5 (Snapshot20170127). Sometimes it would boot fine, and sometimes it would appear to get hung (maybe doing the same “A start job is running” stuff but not reporting it on the console) and I would Alt-PrtScrn-reisub it and eventually get it to boot quickly with the encrypted partition showing up. After updating to kernel 4.9.8 it didn’t prompt for the password when booting and didn’t mount the encrypted partition. I went into the yast2 partitioner, saw that part6 didn’t show a mount point or file system type, re-entered the mount point and then it did boot but with all of the warnings/delay that I reported originally (but did come up with the encrypted partition working).

It looks as if you have found the problem in “crypttab”.

The second and third lines appear to be for the same partition. And that probably caused a conflict (attempting to access a partition that is already busy).

The third line – the one that you kept – is probably the one that is referenced in “/etc/fstab” (a reference to “/dev/mapper/cr_***”). If the first line is also referenced, maybe uncomment that again. If it is not referenced, then leave in commented out at least for the present.

That’s right, the third line is referenced in /etc/fstab. The first line is not referenced in /etc/fstab. Thanks again.

I just went through the same routine with another computer (virtually the same hardware), so I’m writing out the experience here in somewhat clearer detail in case it helps someone:

  1. Installed from the same old Tumbleweed ISO that I used previously (on USB stick). Created an encrypted partition during setup.

  2. Booted the computer after install. It prompted for the password for the encrypted partition and mounted it fine.

  3. Did a software update. Rebooted. This left me back in the “long delay” during boot and the encrypted partition not being mounted (never got a password prompt for it). At this point the /etc/crypttab contained just one line:
    cr_encrypted /dev/disk/by-id/nvme-2002538bb61b5cd3c-part8 none none

  4. Invoked the Partitioner from yast2. It did not show a mount point for the encrypted partition, so I added one. That added a line to /etc/crypttab, so it then contained:
    cr_encrypted /dev/disk/by-id/nvme-2002538bb61b5cd3c-part8 none none
    cr_encrypted /dev/disk/by-id/-SAMSUNG_MZVLW512HMJP-000H1_S36ENX0HB47557-part8 none none

  5. Rebooted, but it still got stuck during boot and didn’t prompt for the password or mount the encrypted partition. I deleted the first line from /etc/crypttab and it then worked fine when I rebooted.

On an unrelated note, another problem that I’ve experienced when doing a software update (both old and new laptop) is that Windows disappears from the list of options on the boot menu. Going into the Boot Loader tool in yast2 and exiting out so that it rewrites the boot data (without actually having changed anything) seems to fix that problem.

If that happens again, try hitting “CTRL-ALT-F7”.

There’s some sort of bug, where you don’t see the plymouth boot splash screen unless you use CTRL-ALT-F7. And since the prompt for encryption key is on that boot splash screen, it could be the problem that you are seeing.

I was seeing the screen (with the “infinity symbol”) but no password input area. Just to give it a try, I reverted /etc/crypttab to the broken version and rebooted, then did CTRL-ALT-F7, but it did nothing. If I hit ESC I see it spewing messages similar to the problem with my previous laptop. From /var/log/boot.log:

  • ] (1 of 2) A start job is running for dev-disk-by\x2did-nvme\x2d2002538bb61b5cd3c\x2dpart8.device (6s / 1min 30s)
    

** ] (1 of 2) A start job is running for dev-disk-by\x2did-nvme\x2d2002538bb61b5cd3c\x2dpart8.device (7s / 1min 30s)
*** ] (1 of 2) A start job is running for dev-disk-by\x2did-nvme\x2d2002538bb61b5cd3c\x2dpart8.device (7s / 1min 30s)
*** ] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (7s / no limit)
*** ] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (7s / no limit)
***] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (8s / no limit)
**] (1 of 2) A start job is running for dev-disk-by\x2did-nvme\x2d2002538bb61b5cd3c\x2dpart8.device (10s / 1min 30s)

** ] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (1min 27s / no limit)

  • ] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (1min 28s / no limit)
    

** ] (2 of 2) A start job is running for dev-mapper-cr_encrypted.device (1min 28s / no limit)
TIME ] Timed out waiting for device dev-disk-by\x2did-nvme\x2d2002538bb61b5cd3c\x2dpart8.device.
[DEPEND] Dependency failed for Cryptography Setup for cr_encrypted.
[DEPEND] Dependency failed for dev-mapper-cr_encrypted.device.
[DEPEND] Dependency failed for /encrypted.
[DEPEND] Dependency failed for File System Check on /dev/mapper/cr_encrypted.
[DEPEND] Dependency failed for Encrypted Volumes.
OK ] Reached target System Initialization.