0

I noticed my device is becoming slower at booting even when I have SSD so I tried to dig in it.

First I saw there was a bug in file resume to change it to resume=none. I saw a little boost.

Before changing the resume file(which did not exist at the beginning) the load time was 5 37s, which is bad.

now: 3min 14.290s for userspace.

   systemd-analyze time                                  892  11:00:03  
Startup finished in 7.298s (firmware) + 3.630s (loader) + 2.673s (kernel) + 3min 688ms (userspace) = 3min 14.290s
graphical.target reached after 1min 38.373s in userspace

I tried to see what is wrong in it, then I saw dev-loop devices. I didn't know how to deal with it, If I can stop them and if does it effect on my Laptop)

   systemd-analyze blame                                 893  11:00:10  
          7.517s plymouth-quit-wait.service
          6.558s NetworkManager-wait-online.service
          2.220s dev-sda6.device
          2.053s snapd.service
           891ms networkd-dispatcher.service
           658ms dev-loop8.device
           639ms dev-loop9.device
           631ms dev-loop11.device
           630ms dev-loop13.device
           629ms dev-loop12.device
           591ms dev-loop16.device
           590ms dev-loop15.device
           584ms dev-loop10.device
           579ms dev-loop14.device
           579ms dev-loop1.device
           575ms dev-loop4.device
           570ms dev-loop5.device
           565ms dev-loop2.device
           564ms dev-loop3.device
           560ms dev-loop0.device
           543ms snap-core18-1705.mount
           541ms snap-vlc-1397.mount
           540ms snap-heroku-3881.mount
           528ms dev-loop7.device
           526ms snap-gnome\x2dcharacters-399.mount
           522ms systemd-backlight@backlight:intel_backlight.service
           518ms dev-loop6.device
           493ms dev-loop22.device
           491ms dev-loop19.device
           490ms dev-loop20.device
           475ms dev-loop17.device
           462ms dev-loop21.device
           461ms snap-gtk\x2dcommon\x2dthemes-1440.mount
           459ms dev-loop18.device
           455ms systemd-logind.service
           445ms snap-postman-102.mount
           435ms udisks2.service
           402ms snap-gnome\x2dcalculator-544.mount
           393ms systemd-rfkill.service
           389ms apparmor.service
           351ms ModemManager.service
           328ms snap-skype-115.mount
           318ms upower.service
           303ms accounts-daemon.service
           293ms snap-core18-1668.mount
           291ms systemd-journal-flush.service
           287ms keyboard-setup.service
           278ms NetworkManager.service
           270ms snap-gnome\x2dcalculator-704.mount
           263ms snap-musixmatch-18.mount
           255ms snap-postman-103.mount
           247ms snap-gnome\x2dlogs-81.mount
           243ms grub-common.service
           241ms snap-gnome\x2dsystem\x2dmonitor-127.mount
           237ms snap-core-8689.mount
           236ms systemd-udev-trigger.service
           231ms plymouth-read-write.service
           208ms snap-skype-118.mount
           207ms fwupd.service
           203ms user@121.service
           201ms speech-dispatcher.service
           186ms bluetooth.service
           184ms snap-hello\x2dworld-29.mount
           175ms snap-gtk\x2dcommon\x2dthemes-1474.mount
           171ms systemd-journald.service
           171ms apport.service
           171ms gpu-manager.service
           168ms snap-gnome\x2d3\x2d28\x2d1804-116.mount
           156ms snap-core-8935.mount
           155ms snap-gnome\x2dcharacters-495.mount
           150ms wpa_supplicant.service
           141ms snap-gnome\x2dlogs-93.mount
           137ms snap-gnome\x2dsystem\x2dmonitor-135.mount
           117ms avahi-daemon.service
           114ms thermald.service
           102ms systemd-resolved.service
            99ms packagekit.service
            92ms systemd-udevd.service
            86ms systemd-timesyncd.service
            84ms user@1000.service
            80ms systemd-backlight@leds:dell::kbd_backlight.service
            77ms rsyslog.service
            76ms bolt.service
            74ms snapd.seeded.service
            73ms polkit.service
            73ms alsa-restore.service
            49ms systemd-modules-load.service
            49ms plymouth-start.service
            48ms gdm.service
            43ms systemd-fsck@dev-disk-by\x2duuid-105D\x2d71B7.service
            41ms networking.service
            40ms systemd-sysctl.service
            35ms colord.service
            35ms pppd-dns.service
            33ms dns-clean.service
            32ms systemd-tmpfiles-setup.service
            27ms dev-disk-by\x2duuid-606cd432\x2d01a6\x2d4c87\x2dbdcf\x2d22c1d60
            25ms dev-mqueue.mount
            24ms systemd-tmpfiles-setup-dev.service
            24ms systemd-remount-fs.service
            24ms kerneloops.service
            22ms kmod-static-nodes.service
            21ms ufw.service
            14ms boot-efi.mount
            14ms sys-fs-fuse-connections.mount
            13ms ureadahead-stop.service
            12ms sys-kernel-config.mount
            11ms systemd-update-utmp-runlevel.service
            11ms systemd-update-utmp.service
             9ms sys-kernel-debug.mount
             8ms dev-hugepages.mount
             8ms systemd-user-sessions.service
             8ms rtkit-daemon.service
             7ms console-setup.service
             7ms systemd-random-seed.service
             5ms setvtrgb.service
             2ms snapd.socket
lines 95-117/117 (END)

I removed the snap from ubuntu to see how much effect on booting.

 systemd-analyze blame                                 973  09:42:30  
     29.641s apt-daily.service
      8.675s plymouth-quit-wait.service
      7.869s fstrim.service
      6.578s NetworkManager-wait-online.service
      6.166s apt-daily-upgrade.service
      2.297s dev-sda6.device
       919ms motd-news.service
       722ms systemd-journal-flush.service
       711ms systemd-backlight@backlight:intel_backlight.service
       485ms upower.service
       478ms apparmor.service
       469ms networkd-dispatcher.service
       426ms packagekit.service
       409ms udisks2.service
       394ms systemd-logind.service
       380ms apport.service
       379ms plymouth-read-write.service
       348ms grub-common.service
       316ms systemd-udevd.service
       298ms systemd-rfkill.service
       287ms speech-dispatcher.service
       265ms ModemManager.service
       252ms NetworkManager.service
       245ms keyboard-setup.service
       212ms fwupd.service
       202ms systemd-udev-trigger.service
       200ms user@121.service
       191ms bluetooth.service
       157ms systemd-journald.service
       143ms avahi-daemon.service
       137ms thermald.service
       133ms alsa-restore.service
       127ms bolt.service
       118ms rng-tools.service
       118ms accounts-daemon.service
       105ms gpu-manager.service
       100ms gdm.service
        95ms pppd-dns.service
        92ms plymouth-start.service
        89ms systemd-timesyncd.service
        85ms user@1000.service
        81ms wpa_supplicant.service
        67ms systemd-resolved.service
        66ms colord.service
        59ms systemd-modules-load.service
        55ms systemd-tmpfiles-setup-dev.service
        54ms kerneloops.service
        48ms systemd-fsck@dev-disk-by\x2duuid-105D\x2d71B7.service
        48ms systemd-backlight@leds:dell::kbd_backlight.service
        45ms dns-clean.service
        44ms rsyslog.service
        40ms networking.service
        38ms dev-disk-by\x2duuid-606cd432\x2d01a6\x2d4c87\x2dbdcf\x2d22c1d60
        35ms systemd-random-seed.service
        34ms polkit.service
        28ms systemd-remount-fs.service
        26ms systemd-sysctl.service
        26ms systemd-tmpfiles-setup.service
        20ms systemd-user-sessions.service
        20ms dev-mqueue.mount
        19ms kmod-static-nodes.service
        18ms ufw.service
        17ms systemd-update-utmp.service
        16ms dev-hugepages.mount
        16ms ureadahead-stop.service
        13ms sys-kernel-debug.mount
        13ms sys-fs-fuse-connections.mount
        12ms systemd-update-utmp-runlevel.service
        11ms boot-efi.mount
         9ms sys-kernel-config.mount
         7ms console-setup.service
         5ms rtkit-daemon.service
         4ms setvtrgb.service



    systemd-analyze critical-chain                        975  09:44:43  
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 39.346s
└─multi-user.target @1min 39.346s
  └─kerneloops.service @1min 37.195s +54ms
    └─network-online.target @1min 37.193s
      └─NetworkManager-wait-online.service @1min 30.614s +6.578s
        └─NetworkManager.service @1min 30.354s +252ms
          └─dbus.service @1min 30.310s
            └─basic.target @1min 30.238s
              └─sockets.target @1min 30.238s
                └─dbus.socket @1min 30.235s
                  └─sysinit.target @1min 30.229s
                    └─apparmor.service @2.594s +478ms
                      └─local-fs.target @2.585s
                        └─run-user-1000-gvfs.mount @1min 56.316s
                          └─run-user-1000.mount @1min 55.465s
                            └─local-fs-pre.target @454ms
                              └─keyboard-setup.service @209ms +245ms
                                └─systemd-journald.socket @196ms
                                  └─system.slice @195ms
                                    └─-.slice @192ms

1 Answers1

0

As more digging in this issue, I remembered deleting a partition swap(since I have 2 partitions for swapping.) and after following this Instruction, my issue solved.

The problem was when booting

Linux tries to mount swap but fails, which dramatically increases your boot time.

Solution:

In your /etc/fstab you declare 4 partitions o be mounted as swap, but your 'lsblk' shows that only 2 are mounted. I believe 'sdb' is your HDD and 'sda' your SSD. In that case you are indeed using the swap from the HDD, but I believe Linux is still trying to load the swap from the SSD, but can't since you deleted that partition.

First of all, keep it simple: Use 1 swap partition. I am not entirely sure why your drives are formatted as they are (do you have a dual boot?), but you are currently using a 8 GB partition (sdb2) and a 16 GB partiton (sdb5) as swap. Decide on 1 partiton you would like as swap (sdb2 and sdb5 are already correctly formatted for that). Then use 'lsblk -f' to get the UUID of the partition you would like to use as swap and write that down. Now open /etc/fstab/ in your preferred text editor as root. Delete all swap related lines, but be careful not to edit the lines for your root and home partitions. Now add a new line to the file like the following:

Code:

UUID=00000000-0000-0000-0000-000000000000    none     swap      sw                   0         0

But replace the empty UUID I used as an example with the one you wrote down. Save that file, close the text editor and restart. Now only one swap partition should be mounted on boot and your startup time should be back to normal. LINK Credits goes to leon.p