Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Ubuntu 22.04 booting too slow (27.88 seconds)

  1. #1
    Join Date
    Sep 2012
    Beans
    7

    Ubuntu 22.04 booting too slow (27.88 seconds)

    Hallo everyone,

    My Ubuntu 22.04 is booting very slow, it takes around 28 seconds in total. It shouldn't be any hardware problem, because I consider my PC to be powerful. Meaning, i5 12400 CPU, RX 6600XT GPU and 16 GB RAM.
    Any chance to get it to start within seconds?
    By the way, I started counting only from the GRUB menu. After Ubuntu being chosen, I started the the timer. If anybody wants, I could record it with my phone.

  2. #2
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,826
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Maybe this will give some lead:
    Code:
    systemd-analyze blame
    Also, what kind of harddrive have you got? On a modern SDD, you should be able to boot faster than that, but if your Ubuntu is installed on a spinning hard drive, 27 seconds isn't too bad. It won't get as fast as Windows 8+ with standard settings, as that doesn't really boot. It's more like restoring from hibernation. Boot time on Ubuntu should be shorter than an actual boot on Windows.

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Do you have SSD or only HDD?
    Boot is a lot faster with SSD. I changed from SSD to NVMe type SSD and it is a bit faster my older system. But person at keyboard still seems to be bottleneck, and if anything getting slower?

    Some settings you can review. Older post on 20.04, but still applies to newer versions.
    https://ubuntuforums.org/showthread....9#post13932499
    https://askubuntu.com/questions/1284...04-boot-faster

    I now have Kubuntu on NVMe type SSD. I do not allow any snaps. Same set of adjustments as above:
    Code:
    fred@Z170-jammy:~$ sudo systemd-analyze 
    Startup finished in 4.022s (kernel) + 5.381s (userspace) = 9.404s  
    graphical.target reached after 5.352s in userspace
    
    
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    Sep 2012
    Beans
    7

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Code:
    systemd-analyze blame
    Code:
    4.426s e2scrub_reap.service[/COLOR]
    4.183s mysql.service
    2.359s snapd.service
    1.948s waydroid-container.service
    1.873s winbind.service
    1.640s libvirtd.service
    1.501s systemd-journal-flush.service
    1.476s dev-sda2.device
    1.446s cups.service
    1.402s networkd-dispatcher.service
    1.380s snapd.seeded.service
    1.272s udisks2.service
    1.244s apache2.service
    1.180s ModemManager.service
    1.155s lxc-net.service
    1.051s dev-loop19.device
    1.041s dev-loop17.device
    1.036s dev-loop16.device
    1.031s dev-loop15.device
    1.017s dev-loop14.device
    1.007s dev-loop21.device
     999ms dev-loop20.device
     981ms dev-loop13.device
     975ms dev-loop18.device
     975ms dev-loop8.device
     961ms dev-loop12.device
     958ms dev-loop11.device
     950ms dev-loop9.device
     945ms dev-loop2.device
     944ms dev-loop10.device
     944ms dev-loop7.device
     908ms dev-loop1.device
     846ms accounts-daemon.service
    Code:
    alex@B660-GAMING-X-DDR4-i5-12400-RX6600XT:~$ sudo systemd-analyze  
    [sudo] password for alex:  
    Startup finished in 18.106s (firmware) + 6.215s (loader) + 7.851s (kernel) + 7.971s (userspace) = 40.144s  
    graphical.target reached after 7.926s in userspace
    
    I bought Samsung 980 EVO SSD 1TB last year, so, it should be faster.
    Last edited by ajgreeny; 4 Weeks Ago at 11:46 PM. Reason: Code tags repaired

  5. #5
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    ??? 28 seconds is not bad.

    I have a whole lot going on, is 2nd Gen Intel i7, with 3 SSD's, and mine is this:
    Code:
    mafoelffen@Mikes-ThinkPad-T520:~$ sudo systemd-analyze
    Startup finished in 8.572s (kernel) + 12.012s (userspace) = 20.585s 
    graphical.target reached after 11.968s in userspace
    
    mafoelffen@Mikes-ThinkPad-T520:~$ lsblk -o model | grep -v -e '^$'
    MODEL
    Samsung SSD 870 QVO 2TB
    Samsung SSD 870 QVO 2TB
    Dogfish SSD 2TB
    It would be less without NetworkManager (using networkd):
    Code:
    mafoelffen@Mikes-ThinkPad-T520:~$ sudo systemd-analyze critical-chain
    The time when unit became active or started is printed after the "@" character.
    The time the unit took to start is printed after the "+" character.
    
    graphical.target @11.968s
    └─multi-user.target @11.967s
      └─smbd.service @11.795s +138ms
        └─nmbd.service @11.624s +136ms
          └─network-online.target @11.584s
            └─NetworkManager-wait-online.service @4.568s +7.015s
              └─NetworkManager.service @4.295s +264ms
                └─dbus.service @4.290s
                  └─basic.target @4.274s
                    └─sockets.target @4.274s
                      └─cockpit.socket @4.244s +29ms
                        └─sysinit.target @4.208s
                          └─snapd.apparmor.service @3.955s +252ms
                            └─apparmor.service @3.700s +210ms
                              └─local-fs.target @3.698s
                                └─run-snapd-ns-snapd\x2ddesktop\x2dintegration.mnt.>
                                  └─run-snapd-ns.mount @6.794s
                                    └─swap.target @2.086s
                                      └─dev-mapper-swap.swap @2.069s +15ms
                                        └─dev-mapper-swap.device @2.067s
    lines 1-23/23 (END)
    Last edited by MAFoElffen; 4 Weeks Ago at 11:28 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  6. #6
    Join Date
    Sep 2012
    Beans
    7

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    My 40.144s compared to your 20.585s is almost two times longer. Plus, my 28 secs is the time I start counting after I've chosen Ubuntu from the Grub menu.
    Compared to other OS, I'd say it's pretty slow. Doesn't mean my expectations. Otherwise I have no complaints, Ubuntu 22.04 works flawlessly, any task is done very fast.
    But the booting time? It's just slow.

    Thank you for the links, @odlfred.
    What I've done so far:
    changed "quiet splash" to "noplymouth". No effect.
    disabled fast boot and secure boot disabled, or switched to "other OS".
    Disabled (systemctl mask ...) a few services:

    Code:
    4.183s mysql.service
    2.359s snapd.service
    1.948s waydroid-container.service
    1.873s winbind.service
    1.640s libvirtd.service
    apache2.service
    

    And also the "network waiting service" (forgot the name).
    Literally, no changes, still counting around 28 seconds.



  7. #7
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Disabling libvirtd will break KVM. That is what it uses to visualize it's VM's...

    For Network connection waiting during boot (I see you use networkd)... I add "optional: yes" to each connection. That skips the wait for a connection at boot.

    If a machine is using NetworkManager, then I disable NetworkManager-wait-online.service and mask it. (I just did that on this laptop and saved 7 seconds.)
    Code:
    sudo systemctl disable NetworkManager.service
    sudo systemctl mask NetworkManager.service
    I have lxd and libvirtd, which I need, so I live with.

    e2scrub_reap.service removes old stale snapshots at boot. It removes them since they are a waste of storage. But if you do not have LVM installed, then it is doing nothing, but a futile search for something that is not there (it is installed by default).
    Code:
    sudo systemctl disable e2scrub_reap.service
    sudo systemctl mask e2scrub_reap.service
    plymouth-quit-wait.service waits for all services are ready before leaving the splash screen. If you are not using plymouth, then it is not doing anything.
    Code:
    sudo systemctl disable plymouth-quit-wait.service 
    sudo systemctl mask plymouth-quit-wait.service
    I check and update my firmware myself, so I remove the autmated step in the boot process
    Code:
    sudo systemctl disable fwupdate.service
    sudo systemctl mask fwupd.service
    The avahi-daemon service is used to discover local network resources. If you do not need any quick search for local network resources, such as printers & scanners, then you can disable it
    Code:
    sudo systemctl disable avahi-daemon.service
    sudo systemctl diable avahi-daemon.service
    ModemManager service automatically sets up and connects 2G/3G/4G/5G modems and provides a high level of abstraction when interacting with modems. If ou are not using a WAN Card, you don't need that
    Code:
    sudo systemctl disable ModemManager.service
    sudo systemctl mask ModemManager.service
    Those are a few things off the top of my head to recommend.
    Last edited by MAFoElffen; 4 Weeks Ago at 06:20 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  8. #8
    Join Date
    Sep 2012
    Beans
    7

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    I'm using two SSD's, so I don't know, if I'm using LVM. That's why I didn't disable the e2scrub_reap.service.
    After disabling and masking the "
    NetworkManager.service", I no longer had the internet connection.
    I also left the
    avahi-daemon.service, cause I'm using the HP Printer, wirelessly connected.

    Code:
    alex@B660-GAMING-X-DDR4-i5-12400-RX6600XT:~$ systemd-analyze  
    Startup finished in 19.272s (firmware) + 15.340s (loader) + 8.132s (kernel) + 5.999s (userspace) = 48.744s  
    graphical.target reached after 5.974s in userspace
    alex@B660-GAMING-X-DDR4-i5-12400-RX6600XT:~$ 
    
    I'm stucked with the 48.744s.

    Code:
    alex@B660-GAMING-X-DDR4-i5-12400-RX6600XT:~$ systemd-analyze critical-chain
    The time when unit became active or started is printed after the "@" character.
    The time the unit took to start is printed after the "+" character.
    
    graphical.target @5.974s
    └─multi-user.target @4.560s
      └─winbind.service @3.492s +1.065s
        └─network.target @3.408s
          └─NetworkManager.service @3.028s +378ms
            └─dbus.service @3.026s
              └─basic.target @2.988s
                └─sockets.target @2.987s
                  └─virtlogd-admin.socket @2.987s
                    └─virtlogd.socket @2.987s
                      └─sysinit.target @2.971s
                        └─snapd.apparmor.service @2.813s +157ms
                          └─apparmor.service @2.649s +161ms
                            └─local-fs.target @2.648s
                              └─var-lib-lxcfs.mount @3.246s
                                └─local-fs-pre.target @1.291s
                                  └─systemd-tmpfiles-setup-dev.service @1.223s +66ms
                                    └─systemd-sysusers.service @1.192s +29ms
                                      └─systemd-remount-fs.service @1.127s +62ms
                                        └─systemd-journald.socket @1.098s
                                          └─-.mount @1.057s
                                            └─-.slice @1.057s
    alex@B660-GAMING-X-DDR4-i5-12400-RX6600XT:~$ 
    


    On the other hand, I have IdeaPad Flex 5 CB, which originally (as a Chromebook) came with the ChromeOS, but I uninstalled it and installed Manjaro. From pushing the start button (or just opening the lid) till full booted, you'd never guess, around 18 seconds.

    Any other ideas? Could it also be the consequence of me updating the 20.04 to the 22.04?

  9. #9
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Please show the output of these
    Code:
    grep . /etc/netplan/*.yaml
    lsblk -e7 -o name,size,fstype,type,mountpoint
    sudo lvs -o name,copy_percent,size,segtype,uuid,devices
    sudo lvs -o lv_name,lv_attr --separator='|' --noheadings -S "lv_attr=~[^s.*]"
    The first command to see what is there and what renderer is actually being used. Your blame shows both NetworkManager and netwrokd services running(?) Usually that is one or the other, not both concurrently.

    If the second command has no lvm, vg<something> or lv<something>, then there is no need to do anything further. If you have LVM installed as a Volume Manager, and the last command is blank, then you have never done any snapshots.

    But thinking that is you do not know if you have LVM2, then you probably haven't made any LVM snapshot, so then the check for old stale snapshots is not needed.
    Last edited by MAFoElffen; 4 Weeks Ago at 08:23 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  10. #10
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Ubuntu 22.04 booting too slow (27.88 seconds)

    Be happy:
    Code:
    $ systemd-analyze
    Startup finished in 25.901s (firmware) + 2.635s (loader) + 7.169s (kernel) + 2min 28.329s (userspace) = 3min 4.036s 
    graphical.target reached after 2min 27.753s in userspace
    And on another physical machine:
    Code:
    $ systemd-analyze
    Startup finished in 10.185s (firmware) + 2.845s (loader) + 5.081s (kernel) + 16.177s (userspace) = 34.290s 
    graphical.target reached after 14.210s in userspace
    These are nearly identical systems, except one has 6 more HDDs connected. USB Peripherals make booting slower. If the system has lots of USB ports, perhaps using an added front-panel with a 35-in-5 card reader, 4 USB2 ports, 2 USB3 ports, audio jacks and 1 eSATA port, if those are all enabled, the boot time can become 5+ minutes. I ended up disconnecting all the USB2 things on my front-panel to prevent the ludicrous boot times. Basically the opposite of "they've gone plaid". Hopefully, everyone will get that reference.

    If you want it to be faster, stop rebooting all the time, learn to boot and get coffee like the rest of the world does. Or use the time for mediation to find your happy place.

    If you want a really fast boot, use the 30MB TinyCore http://tinycorelinux.net/downloads.html

    Just providing options.

    I've already tuned my boot to remove all sorts of slow things that I'll never use - things like network-manager or ZFS checks or GUI things I just don't need, like the snap subsystem.
    Code:
    $ systemd-analyze critical-chain 
    The time when unit became active or started is printed after the "@" character.
    The time the unit took to start is printed after the "+" character.
    
    graphical.target @14.210s
    └─udisks2.service @5.371s +8.838s
      └─basic.target @5.303s
        └─sockets.target @5.302s
          └─libvirtd-ro.socket @5.301s
            └─libvirtd.socket @5.285s +11ms
              └─sysinit.target @5.277s
                └─systemd-sysctl.service @5.469s +3ms
                  └─systemd-modules-load.service @385ms +36ms
                    └─systemd-journald.socket @335ms
                      └─-.mount @297ms
                        └─system.slice @297ms
                          └─-.slice @297ms
    That's the entire critical chain on 1 system. I need to look at removing udisks. It used to be useless for my needs.

    On the slower booting system,
    Code:
    $ systemd-analyze critical-chain
    The time when unit became active or started is printed after the "@" character.
    The time the unit took to start is printed after the "+" character.
    
    graphical.target @2min 27.753s
    └─multi-user.target @2min 27.753s
      └─zfs.target @2min 27.753s
        └─zfs-share.service @2min 27.722s +30ms
          └─nfs-server.service @5.950s +2min 21.771s
            └─rpc-statd.service @2min 18.783s +15ms
              └─nss-lookup.target @2min 18.780s
    I use LXD, which requires snaps and ZFS. The other things are related to NFS, which I use extensively.

    The worst offender on the slow booting system is NFS:
    Code:
    2min 21.771s nfs-server.service
         12.048s snap.lxd.activate.service                                                     >
          7.889s smartmontools.service                                                         >
          7.740s udisks2.service                                                               >
          7.129s snapd.service                                                                 >
          6.303s apt-daily.service                                                             >
          4.095s fstrim.service                                                                >
          3.029s systemd-networkd-wait-online.service                                          >
          1.324s apt-daily-upgrade.service                                                     >
          1.239s man-db.service                                                                >
          1.174s fwupd-refresh.service                                                        
    ...
    Slow disks, connected via USB is my initial guess.

    I generally reboot every 2-3 weeks, when a new kernel is provided.

    On a virtual machine, running on the slower booting system, with Linux Mint 21.2, but a minimal GUI, I see this:
    Code:
    $ systemd-analyze 
    Startup finished in 6.402s (kernel) + 7.401s (userspace) = 13.804s 
    graphical.target reached after 7.391s in userspace
    Plenty fast.
    Code:
    $ systemd-analyze blame
    4.008s plocate-updatedb.service
    3.748s postfix@-.service
    1.810s munin-node.service
    1.788s systemd-udev-settle.service
    1.670s input-remapper-daemon.service
    1.267s fwupd-refresh.service
     858ms x2goserver.service
    ...
    That's my primary desktop system.

    BTW, sudo isn't needed for systemd-analyze.
    Last edited by TheFu; 4 Weeks Ago at 05:03 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •