Long boot up time with Ubuntu 24.04.3

I am running Ubuntu 24.04.3 with Gnome Flashback x64

A few weeks ago, we had a power outage after which I experienced exceptionally long boot times (over 15 minutes or more). Another oddity is the first screen I see has some system bios images (2) along with the normal Ubuntu rotating circle.

Before the power failure, usual boot time was in the 1 minute range. Where can I find something that can help me see what is causing this, and what should I be looking for generally? I have looked in /var/log at several of the logs, but I’m not sure what I’m looking for.

Any help would be appreciated

Is this a standalone install or dual-booting?

Do you have more than one drive?

Have you run either SMART checks or filesystem checks?

Show us the output, wrapped with code tags, for the following commands:

systemd-analyze blame | head -20
journalctl -b -p 3 | tail -20

Standard desk top install, no dual boot;

I assume you are speaking of non-system drives, and the answer is yes;

I have run smart check on all drives and they are OK;

systemd-analyze blame | head -20
2min 3.208s smartmontools.service
1min 2.745s mysql.service
    37.932s e2scrub_reap.service
    32.366s plymouth-quit-wait.service
    15.478s media-butch-Ubuntu_Data_Back.mount
    13.532s snapd.seeded.service
    13.160s snapd.service
    10.590s dev-sdb3.device
     9.965s NetworkManager.service
     8.916s accounts-daemon.service
     7.709s udisks2.service
     7.540s gnome-remote-desktop.service
     7.352s power-profiles-daemon.service
     7.309s polkit.service
     5.757s avahi-daemon.service
     5.739s dbus.service
     5.514s switcheroo-control.service
     5.513s thermald.service
     5.423s dev-loop10.device
     5.411s dev-loop9.device

journalctl -b -p 3 | tail -20
Oct 06 18:42:09 cp1 systemd-fstab-generator[2511]: Failed to create unit file '/run/systemd/generator/media-Data.mount', as it already exists. Duplicate entry in '/etc/fstab'?
Oct 06 18:42:09 cp1 (sd-exec-[2498]: /usr/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Oct 06 18:42:18 cp1 kernel: sd 8:0:0:0: [sdf] tag#0 timing out command, waited 30s
Oct 06 18:42:20 cp1 nologin[2894]: Attempted login by UNKNOWN (UID: 7) on UNKNOWN
Oct 06 18:42:22 cp1 gdm-autologin][2633]: gkr-pam: couldn't unlock the login keyring.
Oct 06 18:42:22 cp1 gdm3[2626]: Gdm: on_display_added: assertion 'GDM_IS_REMOTE_DISPLAY (display)' failed
Oct 06 18:42:22 cp1 gdm3[2626]: Gdm: on_display_removed: assertion 'GDM_IS_REMOTE_DISPLAY (display)' failed
Oct 06 18:42:32 cp1 systemd-fstab-generator[3636]: Failed to create unit file '/run/systemd/generator/media-Data.mount', as it already exists. Duplicate entry in '/etc/fstab'?
Oct 06 18:42:32 cp1 (sd-exec-[3623]: /usr/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Oct 06 18:42:40 cp1 systemd[2851]: Failed to start app-gnome-gnome\x2dkeyring\x2dpkcs11-3901.scope - Application launched by gnome-session-binary.
Oct 06 18:42:40 cp1 systemd[2851]: Failed to start app-gnome-gnome\x2dkeyring\x2dsecrets-3903.scope - Application launched by gnome-session-binary.
Oct 06 18:42:57 cp1 kernel: sd 8:0:0:0: [sdf] tag#0 timing out command, waited 60s
Oct 06 18:43:05 cp1 systemd-fstab-generator[4786]: Failed to create unit file '/run/systemd/generator/media-Data.mount', as it already exists. Duplicate entry in '/etc/fstab'?
Oct 06 18:43:05 cp1 (sd-exec-[4773]: /usr/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Oct 06 18:43:14 cp1 kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Oct 06 18:43:57 cp1 kernel: sd 8:0:0:0: [sdf] tag#0 timing out command, waited 60s
Oct 06 18:43:57 cp1 systemd[1]: Failed to start smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon.
Oct 06 18:45:43 cp1 kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Oct 07 00:00:10 cp1 systemd[1]: Failed to start logrotate.service - Rotate log files.
Oct 08 00:00:05 cp1 systemd[1]: Failed to start logrotate.service - Rotate log files.

Is sdf your backup drive?

Seems to be hanging. Try unplugging/detaching and then reboot to see if the slow boot resolves.

Also post output from cat /etc/fstab please.

Disable both these services and prevent them from autostarting at boot.

Oct 06 18:42:18 cp1 kernel: sd 8:0:0:0: [sdf] tag#0 timing out command, waited 30s

Also, as mentioned by @rubi1200, double check that your /etc/fstab is configured correctly for this disk.

Here is my fstab:

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=c98e60b4-4a86-46ee-9009-30cee2eed7c5 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=B476-D2E6  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
#Entry for /dev/sdb :
#Entry for /dev/sdc1 :
# Corrected Entry for External USB Data Backup Drive
UUID=394833f8-06e8-40fe-90cd-a9e669810b5b /media/butch/Ubuntu_Data_Back	auto nosuid,nodev,nofail,x-gvfs-show 0 0 /media/butch/Ubuntu_Data_Back	auto nosuid,nodev,nofail,x-gvfs-show 0 0
# Entry for External USB Data Backup Drive
# UUID=c4f82388-713a-4b9a-9f50-e36446e17520 /media/butch/Ubuntu_Data_Back	auto nosuid,nodev,nofail,x-gvfs-show 0 0
#Entry for NFS Server on drive g on cp2
192.168.1.111:/media/brenda/Ubuntu_Data_Back /nfs/Ubuntu_Data_Back nfs vers=3,auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
#Entry for NFS Server shared documents on cp2
192.168.1.111:/media/brenda/cp2_data /nfs/cp2_data nfs vers=3,auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
/dev/disk/by-id/wwn-0x50014ee26bdbfdb4-part1 /mnt/wwn-0x50014ee26bdbfdb4-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
UUID=6f18006e-62f2-4a18-8582-17b9d6480fcd /media/Data ext4 errors=remount-ro,x-gvfs-show 0 1
UUID=21af4737-c65b-4b2b-8db8-51d592789719 /media/Data_Two ext4 errors=remount-ro,x-gvfs-show 0 1
/dev/disk/by-uuid/6f18006e-62f2-4a18-8582-17b9d6480fcd /media/Data auto nosuid,nodev,nofail,x-gvfs-show 0 0

I think there are some extraneous entries for the following:

/media/Data (this is my user data drive)
/media/butch/Ubuntu_Data_Back (this is a backup of my user data)

sdf is a multi-partition (4) drive that contains backups of system and home in two of the partitions.

I will disable them to see if that improves boot time on next reboot. If so, I will create a procedure to start them after boot and disable them before shutdown and/or reboot.

Your fstab appears to show two duplicate /media/Data entries for the same UUID.

I recommend commenting one of them out.

There also seems to be a malformed Ubuntu_Data_Back line with two entries merged in one?

Again, I would suggest editing that to only have one clean line.

Reboot and test if the slowness disappears or improves.

I cleaned up fstab. Now boot shows the normal Ubuntu image while booting. I had to leave it before it completed, so I’m not sure how long it took to boot. Is there a log I can look at to see the time duration for this boot?

Try this:
systemd-analyze time

systemd-analyze time
Startup finished in 18min 8.359s (kernel) + 2min 1.789s (userspace) = 20min 10.149s
graphical.target reached after 2min 1.677s in userspace.

Seens as if I still have some work to do.

Did you test disabling the services @tea-for-one suggested?

If not, perhaps try that next and then run the command again to check.

The preceding times were with the services disabled.

Power on and boot into Ubuntu 24.04
As the process starts, press Esc
This should show text output on your monitor
When the boot process hesitates or stalls, you may be able to identify a reason for the delay?

The first part, kernel, is not normal whereas the userspace time seems about right.

Something hardware or kernel device related is likely the culprit here (at least that is what I would suspect).

Let’s take a look at the output from these commands and see if it is possible to narrow this down:

sudo dmesg --ctime | grep -E "error|fail|timeout|reset"
sudo dmesg --ctime | grep sd