Try looking for any initrd-related messages:
journalctl -b | grep -i initrd
My output, for example:
Aug 05 07:01:56 rig kernel: Freeing initrd memory: 17416K
Aug 05 07:01:57 rig systemd[1]: Reached target Initrd Root Device.
Aug 05 07:01:57 rig systemd[1]: Reached target Initrd Root File System.
Aug 05 07:01:57 rig systemd[1]: Reached target Initrd File Systems.
Aug 05 07:01:57 rig systemd[1]: Reached target Initrd Default Target.
Aug 05 07:01:57 rig systemd[1]: Stopped target Initrd Default Target.
Aug 05 07:01:57 rig systemd[1]: Stopped target Initrd Root Device.
Aug 05 07:01:58 rig systemd[1]: Startup finished in 1.347s (kernel) + 878ms (initrd) + 632ms (userspace) = 2.858s.
It could be further worthwile to have a closer look at the kernel messages that occured during the relevant time interval (07:01:56 to 07:01:58 in my case):
dmesg -dT
What does your kernel report during that critical time? Looking forward to your posts.
[HR][/HR]
As you guys are interested in short boot times, so have I been from the time on I built my first Linux rig with an actual SSD. I managed to achieve boots in under 2.2s until a few months ago when those Meltdown and Spectre patches added over a second to my openSUSE Leap 42.3 boot times. Now upgraded to Leap 15.0, I’m just under 3 seconds. Here are the speed boosts I’ve used:
- use a fast SSD (I still think this may been the greatest improvement to any system with moderate mass storage requirements)
- use one common ext4 boot+root partition (I have no use for btrfs)
- use one swap partition (I dabbled with swap-less systems, had problems hibernating though)
- if SSD-based, use partitions strictly aligned to SSD memory blocks (mind those 2048KiB boundaries — good for speed and good for SSD health)
- disable Plymouth (unnecessary eye candy)
- disable AppArmor (arguably no evidence of additional security)
- use kdm as a display manager (fastest initialisation time compared to gdm and sddm)
- use exim (postfix takes a while to initialize)
- use NetworkManager (I don’t need wicked’s complexity and slow boot-time initialisations)
- disable SuSEfirewall and other iptables-based filters if you have a separate firewall
- in YaST’s »Services Manager«, disable as many services as you are comfortable with, for example smartd, ModemManager, iscsi, nmb+Samba and — again — Plymouth.
- customize your initrd with dracut, e.g. issuing as root user something like:
dracut --hostonly --force --omit "img-lib cifs fcoe fcoe-uefi multipath iscsi qemu lvm mdraid dm dmraid pollcdrom plymouth btrfs"
(caution! Your needs may differ from mine)
- make the kernel just write warnings or errors during boot onto the screen, nothing else; relevant kernel parameters:
loglevel=4 systemd.show_status=auto
My current outputs of »systemd-analyze blame« …
712ms dev-sda1.device
176ms initrd-switch-root.service
120ms systemd-journal-flush.service
114ms upower.service
110ms display-manager.service
88ms NetworkManager.service
77ms systemd-udevd.service
76ms polkit.service
60ms systemd-tmpfiles-clean.service
48ms initrd-parse-etc.service
40ms systemd-tmpfiles-setup.service
33ms backup-sysconfig.service
32ms systemd-udev-trigger.service
29ms dracut-cmdline.service
28ms klog.service
28ms systemd-update-utmp.service
24ms systemd-tmpfiles-setup-dev.service
23ms user@1000.service
22ms logrotate.service
17ms rtkit-daemon.service
17ms initrd-cleanup.service
16ms udisks2.service
13ms sys-kernel-debug.mount
12ms dev-hugepages.mount
12ms systemd-fsck-root.service
12ms dev-mqueue.mount
10ms systemd-remount-fs.service
10ms check-battery.service
9ms systemd-sysctl.service
8ms dracut-pre-trigger.service
7ms sysroot.mount
7ms systemd-logind.service
6ms dev-disk-by\x2duuid-f4481d3c\x2d1a74\x2d40a7\x2d9cb2\x2dda5e32db08ff.swap
5ms systemd-user-sessions.service
5ms systemd-journald.service
4ms kmod-static-nodes.service
4ms systemd-update-utmp-runlevel.service
4ms dracut-shutdown.service
4ms systemd-modules-load.service
3ms systemd-random-seed.service
1ms initrd-udevadm-cleanup-db.service
… and of »systemd-analyze critical-chain«:
graphical.target @621ms
└─display-manager.service @510ms +110ms
└─systemd-user-sessions.service @504ms +5ms
└─network.target @503ms
└─NetworkManager.service @414ms +88ms
└─dbus.service @384ms
└─basic.target @384ms
└─sockets.target @384ms
└─iscsid.socket @384ms
└─sysinit.target @383ms
└─swap.target @383ms
└─dev-disk-by\x2duuid-f4481d3c\x2d1a74\x2d40a7\x2d9cb2\x2dda5e32db08ff.swap @376ms +6ms
└─dev-disk-by\x2duuid-f4481d3c\x2d1a74\x2d40a7\x2d9cb2\x2dda5e32db08ff.device @374m
Caveats: I am sure this list is incomplete and I’ve forgot something. Will post any further tricks I might remember here. Obviously, some of my »improvements« are a bit more tricky and dangerous as others, so you should experiment with a fresh installation where no personal data is in danger.
Happy optimizing!