Slow boot after Kernel update in 18.3 Sylvia [SOLVED]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
GRealesM
Level 1
Level 1
Posts: 4
Joined: Tue Jan 09, 2018 5:15 pm

Slow boot after Kernel update in 18.3 Sylvia [SOLVED]

Post by GRealesM » Tue Jan 09, 2018 6:00 pm

Hello everyone!
I recently entered the LM world by installing Sylvia in dual boot with W10 in my laptop, an Asus K541U with a i7-7500U processor, HDD and 12GB RAM. Everything seemed to be OK, and I started installing stuff and using it uneventfully.
However, I updated the kernel to 4.10.0-42-generic x86_64, and approximately since them LM is taking much longer to boot.
I searched in several sources (including this forum) and run the usual diagnostics:

Code: Select all

$ systemd-analyze blame
    1min 10.313s dev-sda6.device
         25.305s ufw.service
         24.898s systemd-udevd.service
         20.100s lvm2-monitor.service
          7.105s NetworkManager-wait-online.service
          5.488s systemd-backlight@backlight:intel_backlight.service
          3.562s systemd-journal-flush.service
          2.352s NetworkManager.service
          2.256s grub-common.service
          2.217s systemd-udev-trigger.service
          1.939s systemd-random-seed.service
			[...]

Code: Select all

 $ systemd-analyze critical-chain
graphical.target @1min 23.889s
└─multi-user.target @1min 23.889s
  └─ntp.service @1min 23.817s +71ms
    └─network-online.target @1min 23.773s
      └─NetworkManager-wait-online.service @1min 16.668s +7.105s
        └─NetworkManager.service @1min 14.315s +2.352s
          └─dbus.service @1min 14.053s
            └─basic.target @1min 14.044s
              └─sockets.target @1min 14.044s
                └─uuidd.socket @1min 14.044s
                  └─sysinit.target @1min 13.987s
                    └─apparmor.service @1min 13.679s +307ms
                      └─local-fs.target @1min 13.677s
                        └─run-cgmanager-fs.mount @1min 14.323s
                          └─local-fs-pre.target @29.864s
                            └─systemd-remount-fs.service @28.875s +651ms
                              └─system.slice @2.612s
                                └─-.slice @2.490s
I also checked /var/log/boot.log, and solved some issues, as well as some errors that appeared in the slow services in the critical chain.
The problem seems to be in dev-sda6, which is the partition in which the root is installed, which takes ages to mount.

Code: Select all

 $ journalctl  -b | grep sda6
 Jan 09 18:52:14 guille-X541UJ kernel:  sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7
Jan 09 18:52:14 guille-X541UJ kernel: EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
Jan 09 18:52:41 guille-X541UJ kernel: EXT4-fs (sda6): re-mounted. Opts: errors=remount-ro 
There's a gap in dmesg, I share it may it help:

Code: Select all

[    8.713253] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.750848] ppdev: user-space parallel port driver
[    9.052236] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[   11.618808] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   34.812642] EXT4-fs (sda6): re-mounted. Opts: errors=remount-ro
[   38.124715] systemd-journald[355]: Received request to flush runtime journal from PID 1
[   41.280091] input: Asus Wireless Radio Control as /devices/LNXSYSTM:00/LNXSYBUS:00/ATK4002:00/input/input8
[   41.289197] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[   42.441435] intel-lpss 0000:00:15.0: enabling device (0000 -> 0002)
[   42.874698] wmi: Mapper loaded
[   43.474677] tpm_crb MSFT0101:00: can't request region for resource [mem 0xfed40080-0xfed40fff]
[   43.474682] tpm_crb: probe of MSFT0101:00 failed with error -16
[   43.542049] Bluetooth: Core ver 2.22
[   43.542060] NET: Registered protocol family 31
[   43.542060] Bluetooth: HCI device and connection manager initialized
[...]
I checked the UUIDs at blkid and /etc/fstab/ and there is no mismatch between them.

Someone in a different forum told me that perhaps it's the kernel not liking me, and suggested to downgrade to see what happens. Still, I tried to boot using the old kernel (4.10.0-38-generic x86_64) and boot time barely changed.

I'd really appreciate some light, it's probably in front of my nose and I'm simply not seeing it.

Thank you! :)
Last edited by GRealesM on Fri Jan 12, 2018 2:34 pm, edited 1 time in total.

User avatar
thx-1138
Level 7
Level 7
Posts: 1923
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by thx-1138 » Tue Jan 09, 2018 6:34 pm

...some thoughts:
NetworkManager-wait-online.service is well-known for causing slowdowns, you could try disabling it.
lvm2-monitor.service is unneeded if you don't use LVM.
ntp.service could also be replaced with systemd-timesyncd...
apparmor.service...if you don't have a multi-user set up/ guest accounts enabled in lightdm, and aren't using it to restrict other apps, you could also avoid it...
tpm_crb, if you don't use Trusted Computing, you could also disable on your bios...

User avatar
michael louwe
Level 10
Level 10
Posts: 3300
Joined: Sun Sep 11, 2016 11:18 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by michael louwe » Wed Jan 10, 2018 2:19 am

@ GRealesM, .......
GRealesM wrote:...
.
You should revert to the previous stable kernel. About Update settings, please refer to ... https://sites.google.com/site/easylinux ... amon-first

You have a 7th-gen Kabylake processor. Seems, only kernel 4.13 and above has full support for it, ie give kernel 4.13 a try.

GRealesM
Level 1
Level 1
Posts: 4
Joined: Tue Jan 09, 2018 5:15 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by GRealesM » Wed Jan 10, 2018 8:16 am

[UPDATE]

Hi guys, I disabled NetworkManager-wait-online.service and uninstalled lvm2 (lvm2-monitor.service vanished but lvm2.service continues popping up), and got barely no improvement in boot time.
Right after I read michael's message, a kernel update to 4.13.0-26-generic x86_64 appeared on update manager. I installed it but it still takes a long minute to start.
I checked systemd-analyze plot (see below), and interestingly the firewall (ufw.service) and systemd.udev.service, together with persistent lvm2.service seem to be responsible for some of the delay. I understand that those are important packages, so I didn't do anything about them yet.
Overall plot view
Overall plot view
A closer look
A closer look
Hope this helps!

User avatar
thx-1138
Level 7
Level 7
Posts: 1923
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by thx-1138 » Thu Jan 11, 2018 4:30 am

GRealesM wrote:[UPDATE]
.....
I checked systemd-analyze plot (see below), and interestingly the firewall (ufw.service) and systemd.udev.service, together with persistent lvm2.service seem to be responsible for some of the delay. I understand that those are important packages, so I didn't do anything about them yet.
Hope this helps!
All lvm* services can be safely disabled if LVM is not used: you can verify if such is in use with the following ways. However this won't really shave off much time, maybe 1-2 seconds on an hdd. The same stands true for the majority of services as well. NetworkManager-wait-online.service i suggested simply because it's the no1 'suspect' to speak off, there's countless threads about it on the net (and here as well...)

Another probable cause for delays is the existence of huge (and/or corrupted) journal logs (eg. say 400mb). journalctl --verify & journalctl --disk-usage will show you if such is the case.

Yet another usual suspect is automatically set filesystem checks on start-up, eg. btrfs scanning, or fsck-ing your partitions etc. In your system, sudo tune2fs -l /dev/sda6, check last 'Last checked' & 'Maximum mount count' (1 means run on each boot). It wouldn't hurt checking the 6th column in your fstab as well.

Don't assume though that the services shown to be taking more time are necessary the culprit - it might be something else way much earlier in the boot sequence that delays them...

But i'm not really familiar with systemd's deeper internals, so hopefully others will chime in as well...

User avatar
Sir Charles
Level 7
Level 7
Posts: 1897
Joined: Thu Jan 04, 2018 1:00 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by Sir Charles » Thu Jan 11, 2018 5:23 am

Since the latest 4.13 kernel in the Update Manager, namely 4.13.0.26 comes with the mitigation against Meltdown vulnerability, maybe you could give that a shot. It might solve the problem of slow booting as well and hopefully it will not create other problems.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

GRealesM
Level 1
Level 1
Posts: 4
Joined: Tue Jan 09, 2018 5:15 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by GRealesM » Fri Jan 12, 2018 2:03 pm

thx-1138 wrote: All lvm* services can be safely disabled if LVM is not used: you can verify if such is in use with the following ways. However this won't really shave off much time, maybe 1-2 seconds on an hdd. The same stands true for the majority of services as well. NetworkManager-wait-online.service i suggested simply because it's the no1 'suspect' to speak off, there's countless threads about it on the net (and here as well...)

Another probable cause for delays is the existence of huge (and/or corrupted) journal logs (eg. say 400mb). journalctl --verify & journalctl --disk-usage will show you if such is the case.

Yet another usual suspect is automatically set filesystem checks on start-up, eg. btrfs scanning, or fsck-ing your partitions etc. In your system, sudo tune2fs -l /dev/sda6, check last 'Last checked' & 'Maximum mount count' (1 means run on each boot). It wouldn't hurt checking the 6th column in your fstab as well.
Answering to this: My journalctl takes up 8 MB in my system, and it passed verify command. Regarding tune2fs, Last checked was the day I installed the system on the computer, so I can rule off that it's performing a fsck-check (It's strange because I read many people complaining that it was on by default, and other people saying that they were better off like that), and the maximum mount count was "-1". About /etc/fstab/, the line for this device reads: UUID=95c73e88-dd45-420e-8583-b53d0d065f3b / ext4 errors=remount-ro 0 1, so <pass> = 1 in my case.
Marziano wrote:Since the latest 4.13 kernel in the Update Manager, namely 4.13.0.26 comes with the mitigation against Meltdown vulnerability, maybe you could give that a shot. It might solve the problem of slow booting as well and hopefully it will not create other problems.
I don't know if I get what you mean...If you suggested that I update the kernel to 4.13.0.26, I already did by the time I wrote this with no improvement =(.

A related question, if you don't mind: When I updated the kernel, the system seemed to lose track of the Nvidia drivers, as the green applet vanished from the pannel, and a "Active graphics card: unknown" appeared instead...Other than that (and the slow boot) everything works fine. I read somewhere that I probably need to re-install Nvidia drivers to fix this...should I?

Thanks a lot guys, I really appreciate your help! Have a nice weekend.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1897
Joined: Thu Jan 04, 2018 1:00 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by Sir Charles » Fri Jan 12, 2018 2:26 pm

GRealesM wrote:
Marziano wrote:Since the latest 4.13 kernel in the Update Manager, namely 4.13.0.26 comes with the mitigation against Meltdown vulnerability, maybe you could give that a shot. It might solve the problem of slow booting as well and hopefully it will not create other problems.
I don't know if I get what you mean...If you suggested that I update the kernel to 4.13.0.26, I already did by the time I wrote this with no improvement =(.
You are right, I'm sorry. I missed those lines.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

GRealesM
Level 1
Level 1
Posts: 4
Joined: Tue Jan 09, 2018 5:15 pm

Re: Slow boot after Kernel update in 18.3 Sylvia

Post by GRealesM » Fri Jan 12, 2018 2:33 pm

Hi guys! Seems like I fixed it!

Code: Select all

$ systemd-analyze blame
         12.384s gpu-manager.service
          8.301s grub-common.service
          6.794s dev-sda6.device
          6.403s plymouth-quit-wait.service
          6.261s ufw.service
          6.001s networking.service
          5.931s ModemManager.service
          5.840s accounts-daemon.service
          5.838s warsaw.service
          3.978s NetworkManager.service
          3.976s loadcpufreq.service
          3.316s apport.service
          3.250s polkitd.service
          2.978s irqbalance.service
          2.588s systemd-logind.service
          2.577s ondemand.service
          2.396s ntp.service
          2.321s speech-dispatcher.service
          2.119s systemd-rfkill.service
          1.915s console-kit-log-system-start.service
          1.863s alsa-restore.service
          1.863s lm-sensors.service
          1.862s rsyslog.service
Apparently there's some serious conflict between kernels and Nvidia drivers going on these days. In case it's useful for somebody, this is what I did:

1) Driver manager -> Switched from nvidia-387 to open-source Nouveau
2) $ sudo apt remove --purge nvidia*
3) Restart
4) Driver manager -> Switch from Nouveau to nvidia-387 in order to reinstall the drivers.
5) Restart again.

Solved!

User avatar
j8a
Level 1
Level 1
Posts: 24
Joined: Mon Dec 11, 2017 10:58 am

Re: Slow boot after Kernel update in 18.3 Sylvia [SOLVED]

Post by j8a » Tue Feb 27, 2018 5:21 pm

Hi, I have no Nvidia drivers and I also have noticed a slow boot time after Kernel update in Sylvia 18.3
inxi -Fx
System: Host: pcjochoa Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0)
Desktop: Xfce 4.12.3 (Gtk 2.24.28) Distro: Linux Mint 18.3 Sylvia
Machine: System: Dell product: Inspiron 1501
Mobo: Dell model: 0UW744?????? Bios: Dell v: 2.6.1 date: 08/23/2006
CPU: Single core AMD Turion 64 Mobile MK-36 (-UP-) cache: 512 KB
flags: (lm nx sse sse2 sse3 svm) bmips: 3191 speed/max: 1600/2000 MHz
Graphics: Card: Advanced Micro Devices [AMD/ATI] RS482M [Mobility Radeon Xpress 200]
The problem is in the following output, I could not understand what can I do.
systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 38.463s
└─multi-user.target @1min 38.450s
└─getty.target @1min 38.439s
└─getty@tty1.service @1min 38.420s
└─rc-local.service @1min 38.300s +16ms
└─network-online.target @1min 38.295s
└─NetworkManager-wait-online.service @1min 31.448s +6.846s
└─NetworkManager.service @1min 30.682s +687ms
└─dbus.service @1min 30.535s
└─basic.target @1min 30.253s
└─sockets.target @1min 30.253s
└─dbus.socket @1min 30.252s
└─sysinit.target @1min 30.235s
└─brltty.service @3.374s
└─systemd-journald.socket @213ms
└─-.slice @191ms

I also have checked what you were saying
systemd-analyze blame
6.846s NetworkManager-wait-online.service
2.584s dev-sda1.device
1.338s ModemManager.service
1.332s accounts-daemon.service
1.046s console-setup.service
1.006s loadcpufreq.service
975ms systemd-logind.service
961ms systemd-udev-trigger.service
901ms apparmor.service
737ms ntp.service
726ms irqbalance.service
716ms lvm2-monitor.service
687ms NetworkManager.service
666ms upower.service
655ms speech-dispatcher.service
638ms grub-common.service
568ms console-kit-log-system-start.service
545ms rsyslog.service
545ms ondemand.service
542ms dictd.service
535ms hddtemp.service
517ms alsa-restore.service
479ms lightdm.service
477ms virtualbox-guest-utils.service
463ms thermald.service
442ms keyboard-setup.service
404ms avahi-daemon.service
400ms binfmt-support.service
391ms udisks2.service
385ms systemd-journald.service
383ms gpu-manager.service
381ms iio-sensor-proxy.service
355ms cpufrequtils.service
355ms lm-sensors.service
322ms systemd-rfkill.service
304ms networking.service
281ms colord.service
243ms systemd-update-utmp.service
208ms polkitd.service
183ms systemd-modules-load.service
181ms dev-hugepages.mount
173ms kmod-static-nodes.service
159ms ufw.service
150ms sys-kernel-debug.mount
141ms openvpn.service
140ms systemd-udevd.service
138ms systemd-user-sessions.service
119ms proc-sys-fs-binfmt_misc.mount
104ms user@1000.service
96ms dns-clean.service
94ms resolvconf.service
94ms dev-mqueue.mount
86ms systemd-tmpfiles-setup.service
83ms systemd-tmpfiles-setup-dev.service
82ms pppd-dns.service
72ms systemd-journal-flush.service
69ms systemd-update-utmp-runlevel.service
61ms plymouth-start.service
61ms setvtrgb.service
57ms systemd-sysctl.service
55ms wpa_supplicant.service
50ms sys-fs-fuse-connections.mount
31ms flatpak-system-helper.service
29ms plymouth-read-write.service
20ms plymouth-quit-wait.service
19ms systemd-random-seed.service
18ms systemd-remount-fs.service
16ms rc-local.service
14ms ureadahead-stop.service
13ms rtkit-daemon.service
12ms systemd-backlight@backlight:acpi_video0.service

jochoa@pcjochoa ~ $ journalctl --verify & journalctl --disk-usage
[1] 2930
Archived and active journals take up 7.0M on disk.

I will appreciate any comments. Thanks.

Post Reply

Return to “Installation & Boot”