I started to trying optymalize my boot time. When I put command systemd-analyze plot >bootup.svg
, I saw that swap.target
continues for more than 1 min. So what can I do with that?
EDIT:
grep swap /etc/fstab
output:
# swap was on /dev/sda4 during installation
UUID=6b06a63a-e66b-489c-834d-04b5ab909160 none swap sw 0 0
sudo blkid | grep swap
output:
/dev/sda4: UUID="8fb26a5f-62fc-4c3a-8df5-421f884844b7" TYPE="swap" PARTUUID="d9fa2484-04"
'dmesg' part of output:
[ 3.605617] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card1/input8
[ 3.605710] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card1/input9
[ 4.687101] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 4.697746] input: HDA Intel HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/sound/card0/input10
[ 4.697822] input: HDA Intel HDMI HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/sound/card0/input11
[ 4.697895] input: HDA Intel HDMI HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/sound/card0/input12
[ 4.697962] input: HDA Intel HDMI HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.0/sound/card0/input13
[ 4.698027] input: HDA Intel HDMI HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:03.0/sound/card0/input14
[ 92.575975] audit: type=1400 audit(1597581223.535:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=669 comm="apparmor_parser"
[ 92.577822] audit: type=1400 audit(1597581223.539:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=668 comm="apparmor_parser"
[ 92.577827] audit: type=1400 audit(1597581223.539:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=668 comm="apparmor_parser"
[ 92.580091] audit: type=1400 audit(1597581223.539:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=672 comm="apparmor_parser"
[ 92.583043] audit: type=1400 audit(1597581223.543:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=673 comm="apparmor_parser"
[ 92.583046] audit: type=1400 audit(1597581223.543:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=673 comm="apparmor_parser"
[ 92.583048] audit: type=1400 audit(1597581223.543:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=673 comm="apparmor_parser"
[ 92.583483] audit: type=1400 audit(1597581223.543:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cups-browsed" pid=671 comm="apparmor_parser"
[ 92.585361] audit: type=1400 audit(1597581223.543:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lsb_release" pid=674 comm="apparmor_parser"
[ 92.591057] audit: type=1400 audit(1597581223.551:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ippusbxd" pid=677 comm="apparmor_parser"
[ 93.306091] nfc: nfc_init: NFC Core ver 0.1
[ 93.306112] NET: Registered protocol family 39
See how your two UUIDs are different? They should be the same. Your swap has changed.
At boot, your system reads the swap UUID in /etc/fstab and tries to mount it. But it doesn't exist, so the mounting fails. The system retries, and fails again. So the system starts looking for available swap that it can use. Eventually, your system locates the new swap partition and mounts it. That whole process takes about a full minute (or more) during boot, slowing down the boot.
Fix the problem easily by simply telling your system the correct UUID of your swap: Edit /etc/fstab and replace that old UUID with the correct UUID. You learned the correct UUID when you ran
sudo blkid
.Then reboot to enjoy your faster boot.