Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Extremely slow boot with encrypted root

  1. #1
    Join Date
    Mar 2017
    Posts
    14

    Default Extremely slow boot with encrypted root

    I installed Tumbleweed on an encrypted ext4 root and recently it started booting very slowly.
    The only two leads I have is a UEFI upgrade in the meantime and a zypper dup. The system used to boot very quickly (as you'd expect from being installed on NVMe) for the first few times after installing. Windows 10 on the same machine on a SATA SSD boots quickly.

    Screenshot of boot messages (can I access this log after boot as well from within the system?):
    https://i.imgur.com/sVrUWRJ.jpg

    systemd-analyze blame:
    Code:
          2min 283ms dracut-initqueue.service         
             57.377s systemd-cryptsetup@cr_nvme\x2dSamsung_SSD_970_EVO_500GB_S466NX0K512950B\x2dpart2.service
             57.376s systemd-cryptsetup@cr_nvme\x2dSamsung_SSD_970_EVO_500GB_S466NX0K512950B\x2dpart3.service
             10.021s wicked.service
              7.699s backup-rpmdb.service
              2.293s logrotate.service
               882ms btrfsmaintenance-refresh.service
               710ms plymouth-quit-wait.service
               625ms postfix.service
               615ms systemd-logind.service
               586ms display-manager.service
               485ms vboxdrv.service
               450ms ca-certificates.service
               388ms apparmor.service
               254ms rsyslog.service
               251ms chronyd.service
               247ms kbdsettings.service
               199ms initrd-switch-root.service
               190ms udisks2.service
               160ms windows.mount
                63ms upower.service
                63ms initrd-parse-etc.service
                58ms dracut-cmdline.service
                47ms systemd-udev-trigger.service
                43ms mcelog.service
                39ms nscd.service
                37ms boot-efi.mount
                34ms backup-sysconfig.service
                30ms systemd-udevd.service
                29ms user@1000.service
                26ms systemd-vconsole-setup.service
                25ms systemd-fsck-root.service
                25ms autofs.service
                21ms iscsi.service
                19ms klog.service
                16ms auditd.service
                15ms systemd-journal-flush.service
                15ms plymouth-start.service
                14ms dracut-pre-udev.service
                13ms systemd-remount-fs.service
                13ms plymouth-read-write.service
                12ms plymouth-switch-root.service
                12ms systemd-tmpfiles-setup.service
                 8ms sys-kernel-debug.mount
                 8ms initrd-cleanup.service
                 7ms systemd-tmpfiles-setup-dev.service
                 7ms dracut-pre-trigger.service
                 7ms dev-disk-by\x2duuid-b938f2f8\x2d24b7\x2d4c76\x2dbfcf\x2df586611a9d18.swap
                 7ms kmod-static-nodes.service
                 6ms sysroot.mount
                 6ms systemd-journald.service
                 6ms systemd-sysctl.service
                 5ms rtkit-daemon.service
                 5ms wickedd-nanny.service
                 5ms systemd-update-utmp.service
                 5ms check-battery.service
                 4ms wickedd.service
                 4ms vboxes.service
                 4ms systemd-modules-load.service
                 4ms systemd-update-utmp-runlevel.service
                 4ms dev-hugepages.mount
                 3ms systemd-user-sessions.service
                 3ms systemd-random-seed.service
                 3ms initrd-udevadm-cleanup-db.service
                 3ms dracut-shutdown.service
                 2ms sys-fs-fuse-connections.mount
                 2ms dev-mqueue.mount
                 2ms ramdisk.mount

    The boot process hangs for a very long time at the two points "Reached target Basic System" and "A stop job is running for udev Kernel Device Manager" (2 min timeout...)
    Shutdown is painfully slow as well, likely related.

    Any help appreciated.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,026
    Blog Entries
    3

    Default Re: Extremely slow boot with encrypted root

    Quote Originally Posted by oxy View Post
    Code:
             57.377s systemd-cryptsetup@cr_nvme\x2dSamsung_SSD_970_EVO_500GB_S466NX0K512950B\x2dpart2.service
             57.376s systemd-cryptsetup@cr_nvme\x2dSamsung_SSD_970_EVO_500GB_S466NX0K512950B\x2dpart3.service
    Those two look slow. However, I suspect that they include the time it takes to type in the encryption key.

    Here are some comparisons:
    Code:
    6.520s systemd-cryptsetup@cr_twleap.service
    That one is on a VM (with Tumbleweed). However, it is setup to get the encryption key from a file, so there isn't any user interaction time.
    Code:
    10.838s systemd-cryptsetup@cr\x2dnwr2wdc2.service
    This one is for my main desktop sytem running Leap 15.0. I do enter the key at the keyboard on this one.

    On another computer, with Tumbleweed, I got around 14 seconds (again, I enter the key at the keyboard).

    I checked on my laptop (with Tumbleweed), with a really weird result:
    Code:
    # systemd-analyze blame
    Bootup is not yet finished. Please try again later.
    What's particularly weird, is that the computer has been up for almost 2 days and I have not seen any other indicators of problems. So I rebooted the laptop, and this time I got:
    Code:
    29.518s systemd-cryptsetup@cr_nlap2.service
    I was deliberately slow in typing in the encryption key for that reboot, and I think that's why the time is as long as it is.

    I'm not sure what the issue is in your case. You should know whether you were slow typing in the encryption key. Another possibility is that Plymouth is slow.

    Maybe I should mention that I'm not really using Plymouth here. Well, I guess I am, but not in the usual way. I have removed "splash=silent" from the boot command line, and I'm prompted at the command line for the encryption key (instead of being prompted in a graphic window). But I think it is still Plymouth prompting me at the command line and passing the key along to the kernel.
    openSUSE Leap 15.1; KDE Plasma 5;

  3. #3
    Join Date
    Mar 2017
    Posts
    14

    Default Re: Extremely slow boot with encrypted root

    It is a long key that I type manually, but booting takes a very long time after I already entered it, and it used to work quickly before.
    I already thought about reinstalling since there's not much on it yet, but I'm not even sure if this is a misconfiguration somewhere or a bug and if it was a bug, finding the cause would be useful.

  4. #4
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,026
    Blog Entries
    3

    Default Re: Extremely slow boot with encrypted root

    After you have entered the encryption key, and it appears to have been read (the box where you enter it is gone), try hitting ESC. You should get progress messages on the screen. Maybe those will hint at where the problem is.

    And you can also use ESC during shutdown, to see the shutdown messages.
    openSUSE Leap 15.1; KDE Plasma 5;

  5. #5
    Join Date
    Mar 2017
    Posts
    14

    Default Re: Extremely slow boot with encrypted root

    I already posted this.

    >Screenshot of boot messages (can I access this log after boot as well from within the system?):
    >https://i.imgur.com/sVrUWRJ.jpg

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,026
    Blog Entries
    3

    Default Re: Extremely slow boot with encrypted root

    Quote Originally Posted by oxy View Post
    >Screenshot of boot messages (can I access this log after boot as well from within the system?):
    >https://i.imgur.com/sVrUWRJ.jpg
    Oops. I missed that the first time through.

    I'm not seeing anything obvious there.

    You can also examine the output of "dmesg".

    What desktop environment do you use? And what displaymanager handles your login?
    openSUSE Leap 15.1; KDE Plasma 5;

  7. #7
    Join Date
    Mar 2017
    Posts
    14

    Default Re: Extremely slow boot with encrypted root

    I'm using Plasma 5 with sddm.

    One thing that stands out in dmesg is the long time between these:
    Code:
    [   32.581387] PM: Image not found (code -22)
    [  125.366781] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)
    [  246.018690] systemd-journald[255]: Received SIGTERM from PID 1 (systemd).

  8. #8
    Join Date
    Mar 2017
    Posts
    14

    Default Re: Extremely slow boot with encrypted root

    I have now reinstalled the system with btrfs and snapshots, and the same problem appears again.

    The slow boot curiously only happens after booting the system the second time after installing updates. I don't know whether openQA boots VMs multiple times in test runs, but if not, this might be why this error slipped through. Something must keep changing boot config here.

    Booting the "after installation" snapshot will boot the system rather quickly, but reboot is slow as well.

    systemd-analyze after updates and slow boot process:
    Code:
    Startup finished in 14.800s (firmware) + 24.914s (loader) + 5.201s (kernel) + 4min 1.785s (initrd) + 11.997s (userspace) = 4min 58.699s
    graphical target reached after 11.991s in userspace
    4 min spent in initrd looks like those two hanging points below, having a timeout of 2 + 2 = 4 minutes.

    The new btrfs installation now hangs at boot at "Reached target Initrd Root Device" instead of the previous "Basic System" with ext4, and at "A stop job is running for udev...". Both of these steps take minutes (2 min each apparently, according to systemd-analyze)

    I also found a Debian bug about it, maybe it's related?
    https://bugs.debian.org/cgi-bin/bugr...cgi?bug=867368

    Is there anything I could do to help debug this?

  9. #9
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,026
    Blog Entries
    3

    Default Re: Extremely slow boot with encrypted root

    Quote Originally Posted by oxy View Post
    I also found a Debian bug about it, maybe it's related?
    https://bugs.debian.org/cgi-bin/bugr...cgi?bug=867368
    That debian bug seems to involve one LVM being defined as part of another LVM. I don't think that situation applies to you.

    What is unclear, for your situation, is how much of that "initrd" time is just the time it takes you to type in the encryption key.
    openSUSE Leap 15.1; KDE Plasma 5;

  10. #10
    Join Date
    Mar 2017
    Posts
    14

    Default Re: Extremely slow boot with encrypted root

    Definitely not four minutes, and as I said before, the hangs happen *after* I already typed the key in both GRUB and Plymouth.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •