0

I notice how my Ubuntu 18 boots very slow, so much slower than Windows that previously installed on the same machine. I don't use dual-boot, my machine is :

Ubuntu 18.04.3 LTS
Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 
64-bit, NVIDIA GeForce GTX 950M

NVIDIA was quite problematic and causing boot issues, so I had to put some kernel boot parameters. Now it looks like this :

 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi pci=noaer
 acpi_enforce_resources=lax intel_pstate=disable acpi_osi=!Windows
 2012"

The default booting time is : 47s.

enter image description here

I followed suggestion from this post : How to diagnose/fix very slow boot on Ubuntu 18.04, while some answers helped other people, it doesn't work on me.

What I have tried :

  1. Added noresume parameter in kernel boot. Literally from the post above, someone cut booting time by 31s !

    I upgraded to 18.04 yesterday and I had the same problem (it took 52 seconds to boot). After setting the "noresume" parameter, it took 21 seconds.

    Result : (sorry forgot to take a screenshot): 57s (10s slower). Why ?

  2. Decrease time process for Network and configuring the timeout for Start Job and Stop Jobs by changing :

    /etc/systemd/system/network-online.target.wants/networking.service
    

    Change TimeoutStartSec=5min to TimeoutStartSec=5s.

    Also,

    /etc/systemd/system.conf  
    

    change :

    DefaultTimeoutStartSec=5s
    DefaultTimeoutStopSec=5s
    

    Result : Failed to boot. (Stuck at booting screen)

  3. Disable Networking during booting :

    systemctl disable NetworkManager-wait-online.service
    

    Result : Booting time was 51s (4s slower).

enter image description here

Why did I miss from steps above ? How did my machine ended up booting slower ?
Why did noresume which was supposed to prevent resume partition makes it slower instead ? Any other advice to decrease booting time ?

UPDATE

Following suggestion from WinEunuuchs2Unix, I tried :

  1. Disable networking as in step (3), and remove the journal flush service and vacuum it by changing :

    nano /etc/systemd/journald.conf
    

    change

    Storage=auto
    SystemMaxUse=50M
    SystemMaxFileSize=1G
    SystemMaxFiles=5
    

    My original journal disk usage was 2G, now it's down to 200MB. But system-journal-flush.service time doesn't seem to get faster, it's still 11s.
    Also, before changing its settings, flushing time was 3.xx s. Now it's 10.xx s instead.

enter image description here

Result, booting time : 52s (5s slower).

enter image description here

  1. Disabling tor-service :

    /etc/default/tor    
    

    change to RUN_DAEMON="no" and run

    sudo systemctl disable tor.service
    

    Then added video=SVIDEO-1:d parameter to the boot kernel (following solution from : Long Kernel Boot Segment in 18.04).
    And masked systemd-journal-flush.service and the keyboard-setup.service (following solution from : Long boot time Ubuntu 18.04).

Result. Booting time : 45s. (2s faster), but I believe it can be improved.
On the second trial : 47s (no improvement).
I really thought disabling tor-service would give me 5~7s faster booting time since it originally took 10-13s in booting time.

enter image description here

Still confused at how noresume parameter, disabling networking and vacuum logs from journal lead to slower booting time instead. Further suggestions will be appreciated !

UPDATE 2

  1. Install haveged. Booting time : 49s (2s slower)

enter image description here

Just why.

raisa_
  • 391

1 Answers1

0

You can probably disable network waiting altogether:

Remove the journal flush service and vacuum it instead:

Slow snapd times can be sped up by jiggling your mouse at boot time: