Score:1

Ubuntu 22.04 booting very slowly

cn flag

I have an HP Z420 workstation, and I need to wait about 2 minutes while I get the login screen.

There are nothing special in boot.log

------------ Mon May 01 14:09:40 CEST 2023 ------------
[[0;32m  OK  [0m] Listening on [0;1;39mLoad/Save RF Kill Switch Status /dev/rfkill Watch[0m.
[[0;32m  OK  [0m] Started [0;1;39mShow Plymouth Boot Screen[0m.
[[0;32m  OK  [0m] Started [0;1;39mForward Password Requests to Plymouth Directory Watch[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mLocal Encrypted Volumes[0m.
[[0;32m  OK  [0m] Found device [0;1;39mWDC_WD5000AAKX-75U6AA0 EFI\x20system\x20partition[0m.
         Starting [0;1;39mFile System Check on /dev/disk/by-uuid/BC5C-95FE[0m...
[[0;32m  OK  [0m] Started [0;1;39mFile System Check Daemon to report status[0m.
[[0;32m  OK  [0m] Finished [0;1;39mFlush Journal to Persistent Storage[0m.
         Starting [0;1;39mLoad Kernel Module chromeos_pstore[0m...
         Starting [0;1;39mLoad Kernel Module efi_pstore[0m...
         Starting [0;1;39mLoad Kernel Module pstore_blk[0m...
         Starting [0;1;39mLoad Kernel Module pstore_zone[0m...
         Starting [0;1;39mLoad Kernel Module ramoops[0m...
[[0;32m  OK  [0m] Finished [0;1;39mFile System Check on /dev/disk/by-uuid/BC5C-95FE[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad Kernel Module efi_pstore[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad Kernel Module pstore_blk[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad Kernel Module pstore_zone[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad Kernel Module ramoops[0m.
         Mounting [0;1;39m/boot/efi[0m...
[[0;32m  OK  [0m] Finished [0;1;39mLoad Kernel Module chromeos_pstore[0m.
[[0;32m  OK  [0m] Mounted [0;1;39m/boot/efi[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mLocal File Systems[0m.
         Starting [0;1;39mLoad AppArmor profiles[0m...
         Starting [0;1;39mSet console font and keymap[0m...
         Starting [0;1;39mClean up any mess left by 0dns-up[0m...
         Starting [0;1;39mTell Plymouth To Write Out Runtime Data[0m...
         Starting [0;1;39mCreate Volatile Files and Directories[0m...
         Starting [0;1;39mUncomplicated firewall[0m...
[[0;32m  OK  [0m] Finished [0;1;39mSet console font and keymap[0m.
[[0;32m  OK  [0m] Finished [0;1;39mTell Plymouth To Write Out Runtime Data[0m.
[[0;32m  OK  [0m] Finished [0;1;39mUncomplicated firewall[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mPreparation for Network[0m.
[[0;32m  OK  [0m] Finished [0;1;39mClean up any mess left by 0dns-up[0m.
[[0;32m  OK  [0m] Finished [0;1;39mCreate Volatile Files and Directories[0m.
         Starting [0;1;39mUserspace Out-Of-Memory (OOM) Killer[0m...
         Starting [0;1;39mNetwork Name Resolution[0m...
         Starting [0;1;39mNetwork Time Synchronization[0m...
         Starting [0;1;39mRecord System Boot/Shutdown in UTMP[0m...
[[0;32m  OK  [0m] Finished [0;1;39mRecord System Boot/Shutdown in UTMP[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad AppArmor profiles[0m.
         Starting [0;1;39mRaise network interfaces[0m...
         Starting [0;1;39mLoad AppArmor profiles managed internally by snapd[0m...
         Mounting [0;1;39mArbitrary Executable File Formats File System[0m...
[[0;32m  OK  [0m] Started [0;1;39mNetwork Time Synchronization[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mSystem Time Set[0m.
[[0;32m  OK  [0m] Started [0;1;39mUserspace Out-Of-Memory (OOM) Killer[0m.
[[0;32m  OK  [0m] Mounted [0;1;39mArbitrary Executable File Formats File System[0m.
[[0;32m  OK  [0m] Started [0;1;39mNetwork Name Resolution[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mHost and Network Name Lookups[0m.
[[0;32m  OK  [0m] Finished [0;1;39mLoad AppArmor profiles managed internally by snapd[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mSystem Initialization[0m.
[[0;32m  OK  [0m] Started [0;1;39mACPI Events Check[0m.
[[0;32m  OK  [0m] Started [0;1;39mProcess error reports when automatic reporting is enabled (file watch)[0m.
[[0;32m  OK  [0m] Started [0;1;39mCUPS Scheduler[0m.
[[0;32m  OK  [0m] Started [0;1;39mTrigger anacron every hour[0m.
[[0;32m  OK  [0m] Started [0;1;39mProcess error reports when automatic reporting is enabled (timer based)[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily apt download activities[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily apt upgrade and clean activities[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily dpkg database backup timer[0m.
[[0;32m  OK  [0m] Started [0;1;39mPeriodic ext4 Online Metadata Check for All Filesystems[0m.
[[0;32m  OK  [0m] Started [0;1;39mDiscard unused blocks once a week[0m.
[[0;32m  OK  [0m] Started [0;1;39mRefresh fwupd metadata regularly[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily rotation of log files[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily man-db regeneration[0m.
[[0;32m  OK  [0m] Started [0;1;39mMessage of the Day[0m.
[[0;32m  OK  [0m] Started [0;1;39mClean PHP session files every 30 mins[0m.
[[0;32m  OK  [0m] Started [0;1;39mUpdate the plocate database daily[0m.
[[0;32m  OK  [0m] Started [0;1;39mDaily Cleanup of Temporary Directories[0m.
[[0;32m  OK  [0m] Started [0;1;39mUbuntu Advantage Timer for running repeated jobs[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mPath Units[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mACPID Listen Socket[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mAvahi mDNS/DNS-SD Stack Activation Socket[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mCUPS Scheduler[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mD-Bus System Message Bus Socket[0m.
         Starting [0;1;39mDocker Socket for the API[0m...
         Starting [0;1;39mSocket activation for snappy daemon[0m...
[[0;32m  OK  [0m] Listening on [0;1;39mUUID daemon activation socket[0m.
[[0;32m  OK  [0m] Finished [0;1;39mRaise network interfaces[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mDocker Socket for the API[0m.
[[0;32m  OK  [0m] Listening on [0;1;39mSocket activation for snappy daemon[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mSocket Units[0m.
[[0;32m  OK  [0m] Reached target [0;1;39mBasic System[0m.
[[0;32m  OK  [0m] Started [0;1;39mACPI event daemon[0m.
[[0;32m  OK  [0m] Started [0;1;39mRun anacron jobs[0m.
         Starting [0;1;39mLSB: automatic crash report generation[0m...
         Starting [0;1;39mAvahi mDNS/DNS-SD Stack[0m...
[[0;32m  OK  [0m] Started [0;1;39mD-Bus System Message Bus[0m.
         Starting [0;1;39mNetwork Manager[0m...
[[0;32m  OK  [0m] Started [0;1;39mSave initial kernel messages after boot[0m.
         Starting [0;1;39mRemove Stale Online ext4 Metadata Check Snapshots[0m...
[[0;32m  OK  [0m] Reached target [0;1;39mLogin Prompts[0m.
         Starting [0;1;39mDetect the available GPUs and deal with any system changes[0m...
         Starting [0;1;39mRecord successful boot for GRUB[0m...
[[0;32m  OK  [0m] Started [0;1;39mirqbalance daemon[0m.
         Starting [0;1;39mLSB: Start lightdm[0m...
         Starting [0;1;39mInitialize hardware monitoring sensors[0m...
         Starting [0;1;39mDispatcher daemon for systemd-networkd[0m...
         Starting [0;1;39mClean php session files[0m...
         Starting [0;1;39mAuthorization Manager[0m...
         Starting [0;1;39mPower Profiles daemon[0m...
         Starting [0;1;39mSystem Logging Service[0m...
         Starting [0;1;39mSecure Boot updates for DB and DBX[0m...
[[0;32m  OK  [0m] Reached target [0;1;39mPreparation for Logins[0m.
         Starting [0;1;39mSnap Daemon[0m...
[[0;32m  OK  [0m] Reached target [0;1;39mUser and Group Name Lookups[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD NSS Service responder socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD AutoFS Service responder socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD PAC Service responder socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD PAM Service responder private socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD PAM Service responder socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD SSH Service responder socket[0m.
[[0;1;38;5;185mDEPEND[0m] Dependency failed for [0;1;39mSSSD Sudo Service responder socket[0m.
         Starting [0;1;39mAccounts Service[0m...
[[0;32m  OK  [0m] Started [0;1;39mRegular background program processing daemon[0m.
         Starting [0;1;39mSwitcheroo Control Proxy service[0m...
         Starting [0;1;39mUser Login Management[0m...
         Starting [0;1;39mDisk Manager[0m...
         Starting [0;1;39mLSB: This services starts and stops the USB Arbitrator.[0m...
         Starting [0;1;39mWPA supplicant[0m...
[[0;32m  OK  [0m] Finished [0;1;39mRemove Stale Online ext4 Metadata Check Snapshots[0m.
[[0;32m  OK  [0m] Started [0;1;39mLSB: Start lightdm[0m.
[[0;32m  OK  [0m] Finished [0;1;39mInitialize hardware monitoring sensors[0m.
[[0;32m  OK  [0m] Started [0;1;39mStart whoopsie on modification of the /var/crash directory[0m.
         Starting [0;1;39mProcess error reports when automatic reporting is enabled[0m...
[[0;32m  OK  [0m] Started [0;1;39mLSB: automatic crash report generation[0m.
[[0;32m  OK  [0m] Finished [0;1;39mRecord successful boot for GRUB[0m.
         Starting [0;1;39mGRUB failed boot detection[0m...
[[0;32m  OK  [0m] Finished [0;1;39mGRUB failed boot detection[0m.
[[0;32m  OK  [0m] Started [0;1;39mSystem Logging Service[0m.
[[0;32m  OK  [0m] Finished [0;1;39mSecure Boot updates for DB and DBX[0m.

But after that, the Ubunto logo appears, and need to wait about 2 minutes.

Here is a critical chain

graphical.target @2min 11.767s
└─multi-user.target @2min 11.767s
  └─plymouth-quit-wait.service @41.693s +1min 30.072s
    └─systemd-user-sessions.service @41.368s +303ms
      └─network.target @41.303s
        └─NetworkManager.service @33.878s +7.424s
          └─dbus.service @33.874s
            └─basic.target @33.829s
              └─sockets.target @33.829s
                └─snapd.socket @33.827s +1ms
                  └─sysinit.target @33.732s
                    └─snapd.apparmor.service @31.054s +2.677s
                      └─apparmor.service @29.008s +2.043s
                        └─local-fs.target @28.973s
                          └─run-snapd-ns-snapd\x2ddesktop\x2dintegration.mnt.mount @1min 19.146s
                            └─run-snapd-ns.mount @1min 16.798s
                              └─local-fs-pre.target @9.273s
                                └─systemd-tmpfiles-setup-dev.service @8.197s +1.075s
                                  └─systemd-sysusers.service @7.069s +1.098s
                                    └─systemd-remount-fs.service @6.971s +95ms
                                      └─systemd-journald.socket @6.715s
                                        └─system.slice @6.674s
                                          └─-.slice @6.674s

Can somebody tell me what could be wrong?

If you need more logs, please tell me.

EDIT:

Here is a

$systemd-analyze blame
1min 30.072s plymouth-quit-wait.service
 57.318s mysql.service
 57.089s docker.service
 35.318s php8.1-fpm.service
 26.226s snapd.service
 25.153s containerd.service
 21.484s systemd-journal-flush.service
 20.393s networkd-dispatcher.service
 15.367s dev-sda2.device
 14.404s dev-loop29.device
 13.890s dev-loop9.device
 13.386s gpu-manager.service
 13.006s vmware-USBArbitrator.service
 12.960s dev-loop0.device
 12.582s udisks2.service
 12.475s NetworkManager-wait-online.service
 12.235s accounts-daemon.service
 12.038s nginx.service
 11.858s dev-loop21.device
 11.781s dev-loop18.device
 11.697s dev-loop32.device
 11.480s dev-loop20.device
 11.452s dev-loop22.device
 11.349s dev-loop26.device
 11.287s dev-loop19.device
 11.266s dev-loop11.device
 11.243s dev-loop25.device
 ...
Raffa avatar
jp flag
Related: [How to decrease the boot time](https://askubuntu.com/q/1166486)
Raffa avatar
jp flag
"Desktop"? ... Do you need `mysql` and `docker` and `php8.1-fpm` to automatically run on every boot? They are delaying your boot as well by a great deal.
Igor Popov avatar
fr flag
[https://www.orangesputnik.eu/ubuntu-desktop-optimization/](https://www.orangesputnik.eu/ubuntu-desktop-optimization/) Read here about plymouth-quit-wait.service And yes do you really need these services mentioned by @Raffa every load?
Raffa avatar
jp flag
@IgorPopov You might want to have a look at this post: [Slow boot issue due to plymouth-quit-wait.service + ubuntu 18.04](https://askubuntu.com/q/1119167/968501)
vaso123 avatar
cn flag
@Raffa Since, I am a PHP backend developer, so yes.
vaso123 avatar
cn flag
@Raffa You are right, I meant workstation instead desktop.
Raffa avatar
jp flag
That is understood ... However what I meant is unless this machine is a server, you can disable the automatic startup services `mysql.service`, `docker.service` and `php8.1-fpm.service` to see if your machine boots any faster ... Those services can actually be manually started after login with e.g. `sudo systemctl start mysql.service` ... etc. ... Also, disabling `NetworkManager-wait-online.service` should be totally safe, if not a server, and might greatly shorten boot time in some cases ... Snap mounts are delaying your boot as well but we can't do anything about them, unfortunately.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.