How to troubleshoot slow booting

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version |
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=7
G_DIETPI_VERSION_RC=1
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
  • Distro version | bookworm
  • Kernel version | Linux hostname 6.10.11+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.10.11-1~bpo12+1 (2024-10-03) x86_64 GNU/Linux
  • Architecture | amd64
  • SBC model | Native PC (x86_64)
  • Power supply used | N/A
  • SD card used | N/A

Extra details

Actually this is not a real bug, but rather an issue I’m having (and I’m having issues debugging it).
The boot got significantly slower, but I did not notice when it became slower. The boot time was rougly 15 seconds and now it is more than one minute.

This is the dmesg output of the part I consider the most interesting:

[    5.474607] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-19-0-3.ddc
[    5.477081] Bluetooth: hci0: Applying Intel DDC parameters completed
[    5.478056] Bluetooth: hci0: Firmware revision 0.3 build 15 week 45 2022
[    5.479955] Bluetooth: hci0: HCI LE Coded PHY feature bit is set, but its usage is not supported.
[    8.710950] wlan0: authenticate with <other mac address> (local address=<local mac address>)
[    8.712109] wlan0: send auth to <other mac address> (try 1/3)
[    8.739791] wlan0: authenticated
[    8.741010] wlan0: associate with <other mac address> (try 1/3)
[    8.742816] wlan0: RX AssocResp from <other mac address> (capab=0x1011 status=0 aid=4)
[    8.753558] wlan0: associated
[    8.823158] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by <other mac address>
[   67.106596] EXT4-fs (dm-0): mounted filesystem <uuid of external ssd> r/w with ordered data mode. Quota mode: none.
[   67.468804] evm: overlay not supported
[   68.985765] Initializing XFRM netlink socket
[   69.027438] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[   70.041535] docker0: port 1(veth835e0ac) entered blocking state
[   70.041543] docker0: port 1(veth835e0ac) entered disabled state

As you can see, between connecting to the wifi and the mounting of the external SSD drive there is a significant delay.

For your information, the partition that gets mounted at 67.106596 is the one with the dietpi userdata folder.

However from the dmesg output I cannot understand why the system idles for roughly one minute, so my questions are:

  • Is the mounting process the real cause for the delay or there is/may be something else?
  • How can I get additional info so that I can fully understand what is blocking the boot process?
  • Is there any way to find a workaround (e.g. reduce a retry timeout to make it happen faster)?

I know there are probably not enough information to answer the specific question in this post, but actually I’m looking for ways to troubleshoot and to gather additional info rather than a specific fix.

There are a couple of commands you can use to analyse the situation

systemd-analyze blame
systemd-analyze critical-chain
systemd-analyze plot > /tmp/blame.svg

Last one will create a picture that can download to your desktop computer.

So useful. Thanks. From blame it seems that is because of eth0, which is currently unused (since device is connected on WiFi)

1min 1.630s ifup@eth0.service
     6.350s ifup@wlan0.service
     1.418s ifupdown-pre.service
      593ms dev-sdb2.device
      501ms smartmontools.service

I disabled eth0 through dietpi-config and now boot time went down to 30 seconds :grin: thank you so much