[SOLVED] Slow boot - Kernel (not userspace)

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
ahlexcendre
Level 1
Level 1
Posts: 2
Joined: Tue Nov 13, 2018 10:45 pm

[SOLVED] Slow boot - Kernel (not userspace)

Post by ahlexcendre » Tue Nov 13, 2018 11:06 pm

Hello,

I tried to look on the forum for some solutions but couldn't find any topic regarding slow boot because of the kernel.

I tried to check it out with systemd-analyze and systemd-analyze blame:
alexandre@alexandre-Aspire-5736Z:~$ sudo systemd-analyze
[sudo] password for alexandre:
Startup finished in 40.304s (kernel) + 6.565s (userspace) = 46.869s
graphical.target reached after 6.533s in userspace
alexandre@alexandre-Aspire-5736Z:~$ sudo systemd-analyze blame
3.038s dev-sda1.device
1.070s systemd-udev-trigger.service
971ms upower.service
961ms lightdm.service
757ms ModemManager.service
736ms udisks2.service
713ms ufw.service
638ms bluetooth.service
596ms ubuntu-system-adjustments.service
585ms speech-dispatcher.service
567ms accounts-daemon.service
531ms gpu-manager.service
527ms apport.service
516ms rsyslog.service
516ms grub-common.service
479ms NetworkManager.service
416ms lm-sensors.service
412ms alsa-restore.service
404ms keyboard-setup.service
402ms tlp.service
377ms thermald.service
371ms zram-config.service
350ms systemd-logind.service
As you can see, the issue isn't with the userspace but with the kernel. I don't know how to look into it.
My guess is that apt-daily.service could be the reason because this service gave me trouble with the userspace boot time.

Below is my general config:

Code: Select all

System:    Host: alexandre-Aspire-5736Z Kernel: 4.15.0-38-generic x86_64
           bits: 64 gcc: 7.3.0
           Desktop: Xfce 4.12.3 (Gtk 2.24.31) Distro: Linux Mint 19 Tara
Machine:   Device: laptop System: Acer product: Aspire 5736Z v: V1.00 serial: N/A
           Mobo: Acer model: Aspire 5736Z v: V1.00 serial: N/A
           BIOS: Acer v: V1.00 date: 07/22/2010
Battery    BAT0: charge: 58.3 Wh 100.0% condition: 58.3/71.3 Wh (82%)
           model: PANASONIC AS10D51 status: Full
CPU:       Dual core Pentium T4500 (-MCP-) arch: Penryn rev.10 cache: 1024 KB
           flags: (lm nx sse sse2 sse3 ssse3) bmips: 9178
           clock speeds: max: 2300 MHz 1: 1596 MHz 2: 1596 MHz
Graphics:  Card: Intel Mobile 4 Series Integrated Graphics Controller
           bus-ID: 00:02.0
           Display Server: x11 (X.Org 1.19.6 )
           drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: 1366x768@59.97hz
           OpenGL: renderer: Mesa DRI Mobile Intel GM45 Express
           version: 2.1 Mesa 18.0.5 Direct Render: Yes
Audio:     Card Intel 82801I (ICH9 Family) HD Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.15.0-38-generic
Network:   Card-1: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter
           driver: wl bus-ID: 04:00.0
           IF: wlp4s0 state: up mac: 40:2c:f4:02:19:c0
           Card-2: Broadcom Limited NetLink BCM57780 Gigabit Ethernet PCIe
           driver: tg3 v: 3.137 bus-ID: 05:00.0
           IF: enp5s0 state: down mac: 88:ae:1d:76:02:24
Drives:    HDD Total Size: 250.1GB (14.5% used)
           ID-1: /dev/sda model: Samsung_SSD_860 size: 250.1GB
Partition: ID-1: / size: 38G used: 10G (29%) fs: ext4 dev: /dev/sda1
           ID-2: /home size: 190G used: 23G (13%) fs: ext4 dev: /dev/sda2
           ID-3: swap-1 size: 1.02GB used: 0.00GB (0%) fs: swap dev: /dev/zram0
           ID-4: swap-2 size: 1.02GB used: 0.00GB (0%) fs: swap dev: /dev/zram1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 46.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 173 Uptime: 17 min Memory: 1612.9/3875.4MB
           Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 
Thanks a lot folks!
Last edited by Moem on Fri Nov 16, 2018 5:55 am, edited 2 times in total.
Reason: Marked this as [SOLVED] for you; please note that you can and should do this for your own topics. Thanks!

User avatar
catweazel
Level 17
Level 17
Posts: 7774
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Slow boot - Kernel (not userspace)

Post by catweazel » Thu Nov 15, 2018 12:36 am

ahlexcendre wrote:
Tue Nov 13, 2018 11:06 pm

Code: Select all

alexandre@alexandre-Aspire-5736Z:~$ sudo systemd-analyze blame
          3.038s dev-sda1.device

Code: Select all

Machine:   Device: laptop System: Acer product: Aspire 5736Z v: V1.00 serial: N/A
           Mobo: Acer model: Aspire 5736Z v: V1.00 serial: N/A
           BIOS: Acer v: V1.00 date: 07/22/2010
For that slow and old machine, your boot time is respectable. The only thing I would be concerned about is the machine taking 3 seconds to get your drive up and ready. It might be a harbinger of trouble to come.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Slow boot - Kernel (not userspace)

Post by all41 » Thu Nov 15, 2018 1:02 am

Seems a little slow. You have a much faster processor than this netbook. Here are my results for comparison:

Code: Select all

 $ inxi -Fxz
System:    Host: Netbook Kernel: 4.15.0-39-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: MATE 1.18.0 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.3 Sylvia
Machine:   System: Hewlett-Packard (portable) product: Compaq CQ58 Notebook PC v: 088F140003304010000620100
           Mobo: Hewlett-Packard model: 169A v: KBC Version 84.07
           Bios: Insyde v: F.63 date: 09/03/2012
CPU:       Dual core AMD C-60 APU with Radeon HD Graphics (-MCP-) cache: 1024 KB
           flags: (lm nx sse sse2 sse3 sse4a ssse3 svm) bmips: 3991
           clock speeds: max: 1000 MHz 1: 973 MHz 2: 823 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Wrestler [Radeon HD 6290]
           bus-ID: 00:01.0
           Display Server: X.Org 1.18.4 drivers: ati,radeon (unloaded: fbdev,vesa)
           Resolution: 1366x768@60.07hz
           GLX Renderer: AMD PALM (DRM 2.50.0 / 4.15.0-39-generic, LLVM 6.0.0)
           GLX Version: 3.0 Mesa 18.0.5 Direct Rendering: Yes
Audio:     Card Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel HDA)
           driver: snd_hda_intel bus-ID: 00:14.2
           Sound: Advanced Linux Sound Architecture v: k4.15.0-39-generic
Network:   Card-1: Realtek RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
           driver: r8169 v: 2.3LK-NAPI port: 2000 bus-ID: 02:00.0
           IF: enp2s0 state: down mac: <filter>
           Card-2: Ralink RT5390R 802.11bgn PCIe Wireless Network Adapter
           driver: rt2800pci v: 2.3.0 bus-ID: 06:00.0
           IF: wlo1 state: down mac: <filter>
Drives:    HDD Total Size: 120.0GB (8.8% used)
           ID-1: /dev/sda model: PNY_CS900_120GB size: 120.0GB
Partition: ID-1: / size: 21G used: 6.9G (36%) fs: ext4 dev: /dev/sda1
           ID-2: /home size: 78G used: 1.1G (2%) fs: ext4 dev: /dev/sda5
           ID-3: swap-1 size: 2.20GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 39.0C mobo: N/A gpu: 40.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 174 Uptime: 1 day Memory: 304.3/1586.1MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
uno@Netbook ~ $ systemd-analyze
Startup finished in 7.878s (kernel) + 5.795s (userspace) = 13.673s
uno@Netbook ~ $ systemd-analyze blame
          1.960s dev-sda1.device
          1.571s accounts-daemon.service
          1.305s networking.service
          1.222s systemd-logind.service
          1.128s loadcpufreq.service
           962ms irqbalance.service
           896ms NetworkManager.service
           853ms ntp.service
           848ms hddtemp.service
           815ms apparmor.service
           815ms speech-dispatcher.service
           811ms console-setup.service
           789ms ondemand.service
           767ms grub-common.service
           621ms lvm2-monitor.service
           612ms keyboard-setup.service
           581ms lm-sensors.service
           571ms console-kit-log-system-start.service
           540ms lightdm.service
           530ms systemd-user-sessions.service
           525ms pppd-dns.service
           488ms gpu-manager.service
           459ms rsyslog.service

This has a low end ssd. 35 seconds from power-on to full desktop
Proud to be a supporter and monthly contributor to Mint.

User avatar
karlchen
Level 19
Level 19
Posts: 9519
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Slow boot - Kernel (not userspace)

Post by karlchen » Thu Nov 15, 2018 10:34 am

Hi, ahlexcendre.
catweazel wrote:
Thu Nov 15, 2018 12:36 am
For that slow and old machine, your boot time is respectable.
I would agree in case the times for kernel and userspace were swapped:

Code: Select all

alexandre@alexandre-Aspire-5736Z:~$ sudo systemd-analyze
[sudo] password for alexandre:
Startup finished in 40.304s (kernel) + 6.565s (userspace) = 46.869s
graphical.target reached after 6.533s in userspace 
6.5 seconds for kernel would be great and 40.3 seconds for userspace would be good.
But 40.3 sec. for kernel is roughly 4 times as long as on my Acer Spire One D260. :?

One more confusing detail:

Code: Select all

Drives:    HDD Total Size: 250.1GB (14.5% used)
           ID-1: /dev/sda model: Samsung_SSD_860 size: 250.1GB
Does the SSD in the disk model name really suggest that this is an SSD?
In case if it is this raises even more question marks as to why the kernel might need 40.3 seconds to load.

Which ports is the Samsung device connected to? Could it be treated like a USB 1 device until the kernel has been loaded and hence the proper support for the device has been started?

Regards,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

User avatar
Pjotr
Level 20
Level 20
Posts: 11064
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Slow boot - Kernel (not userspace)

Post by Pjotr » Thu Nov 15, 2018 10:36 am

Don't use sudo for systemd-analyze. Quite unnecessary, and may even have negative side effects.
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

ahlexcendre
Level 1
Level 1
Posts: 2
Joined: Tue Nov 13, 2018 10:45 pm

Re: Slow boot - Kernel (not userspace)

Post by ahlexcendre » Thu Nov 15, 2018 6:00 pm

Problem solved. I disabled the quiet splash on the grub to see the culprit. Something was looking for the swap partition (which I don't have) and was stopping for 30 seconds. I don't exactly remembered the message but it was about Btfrs.
Thanks guys for the answers anyway.

Cheers!

User avatar
Moem
Level 17
Level 17
Posts: 7230
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Slow boot - Kernel (not userspace)

Post by Moem » Thu Nov 15, 2018 7:02 pm

ahlexcendre wrote:
Thu Nov 15, 2018 6:00 pm
Problem solved.
Excellent! Then please mark the thread as solved by editing the first post, and adding [SOLVED] to the title. Thanks!
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

User avatar
catweazel
Level 17
Level 17
Posts: 7774
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Slow boot - Kernel (not userspace)

Post by catweazel » Fri Nov 16, 2018 12:25 am

Pjotr wrote:
Thu Nov 15, 2018 10:36 am
Don't use sudo for systemd-analyze. Quite unnecessary, and may even have negative side effects.
Why is it so?
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
Pjotr
Level 20
Level 20
Posts: 11064
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Slow boot - Kernel (not userspace)

Post by Pjotr » Fri Nov 16, 2018 5:27 am

catweazel wrote:
Fri Nov 16, 2018 12:25 am
Pjotr wrote:
Thu Nov 15, 2018 10:36 am
Don't use sudo for systemd-analyze. Quite unnecessary, and may even have negative side effects.
Why is it so?
Because systemd-analyze also works without sudo, and because unnecessarily running an application with root authority always carries the risk of messing up file permissions. :wink:
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
catweazel
Level 17
Level 17
Posts: 7774
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Slow boot - Kernel (not userspace)

Post by catweazel » Fri Nov 16, 2018 5:39 am

Pjotr wrote:
Fri Nov 16, 2018 5:27 am
catweazel wrote:
Fri Nov 16, 2018 12:25 am
Pjotr wrote:
Thu Nov 15, 2018 10:36 am
Don't use sudo for systemd-analyze. Quite unnecessary, and may even have negative side effects.
Why is it so?
Because systemd-analyze also works without sudo, and because unnecessarily running an application with root authority always carries the risk of messing up file permissions. :wink:
Ah. Thank you.

Cheers.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

Post Reply

Return to “Newbie Questions”