Slow boot times on Kubuntu 20.04
I've noticed that booting into Linux takes a long time. It was like this since I installed Linux so I doubt that anything I did while using Linux resulted in slow booting.
I have two hard drives, one for Windows 10 and another for Kubuntu 20.04. I believe that one of the reasons for the slow boot times is that when I was installing Linux i unplugged my Windows 10 drive and I think that has caused some issues with Grub. The hard drive that Linux is on is quite old and slow and the PC in general is old so I'm not excepting to boot up in under 10 seconds or something. I ran systemd-analyze and measured boot time with a stopwatch on my phone. Here are the results. First boot stopwatch : 02:34 systemd-analyze : Startup finished in 5.957s (kernel) + 1min 402ms (userspace) = 1min 6.360s graphical.target reached after 58.594s in userspace systemd-analyze blame : 33.211s man-db.service 31.407s udisks2.service 18.710s dev-sda2.device 18.678s networkd-dispatcher.service 17.797s accounts-daemon.service 11.524s NetworkManager-wait-online.service 10.971s avahi-daemon.service 10.952s NetworkManager.service 10.790s polkit.service 10.461s snapd.service 10.163s thermald.service 10.157s systemd-logind.service 10.157s wpa_supplicant.service 9.979s dev-loop0.device 9.572s dev-loop4.device 9.143s logrotate.service 8.853s dev-loop3.device 8.822s ModemManager.service 8.206s dev-loop5.device 6.985s dev-loop2.device 6.003s gpu-manager.service 4.623s systemd-resolved.service 4.522s rsyslog.service 4.481s systemd-journal-flush.service 4.345s apport.service 4.325s dev-loop1.device 3.698s packagekit.service 3.081s e2scrub_reap.service 2.988s grub-common.service 2.932s systemd-tmpfiles-setup.service 2.906s systemd-udevd.service 1.974s apparmor.service 1.567s systemd-modules-load.service 1.205s grub-initrd-fallback.service 978ms systemd-random-seed.service 954ms snapd.seeded.service 913ms pppd-dns.service 862ms alsa-restore.service 859ms keyboard-setup.service 805ms systemd-tmpfiles-setup-dev.service 774ms swapfile.swap 729ms systemd-sysusers.service 697ms systemd-sysctl.service 658ms systemd-udev-trigger.service 585ms systemd-journald.service 567ms snap-gnome\x2d3\x2d28\x2d1804-161.mount 513ms snap-core18-2246.mount Second run stopwatch : 02:00 systemd-analyze : Startup finished in 6.165s (kernel) + 47.689s (userspace) = 53.855s graphical.target reached after 47.676s in userspace systemd-analyze blame : 19.958s snapd.service 19.806s dev-sda2.device 16.075s networkd-dispatcher.service 15.790s udisks2.service 13.998s accounts-daemon.service 12.496s plymouth-start.service 11.951s NetworkManager-wait-online.service 9.498s dev-loop0.device 9.478s dev-loop3.device 9.092s dev-loop5.device 8.813s dev-loop4.device 8.724s polkit.service 8.623s NetworkManager.service 8.483s dev-loop2.device 8.456s avahi-daemon.service 8.297s dev-loop6.device 7.969s thermald.service 7.967s systemd-logind.service 7.966s wpa_supplicant.service 7.756s ModemManager.service 5.554s gpu-manager.service 3.972s dev-loop1.device 3.870s systemd-journal-flush.service 3.650s packagekit.service 3.144s rsyslog.service 2.681s e2scrub_reap.service 2.595s systemd-udevd.service 2.575s apport.service 2.028s apparmor.service 1.658s grub-common.service 1.242s systemd-modules-load.service 1.171s systemd-resolved.service 887ms keyboard-setup.service 691ms systemd-tmpfiles-setup-dev.service 664ms systemd-sysusers.service 582ms systemd-sysctl.service 580ms systemd-tmpfiles-setup.service 542ms alsa-restore.service 530ms systemd-udev-trigger.service 519ms grub-initrd-fallback.service 446ms systemd-random-seed.service 417ms swapfile.swap 366ms snapd.seeded.service 344ms snapd.apparmor.service 339ms snap-bare-5.mount 331ms pppd-dns.service 314ms snap-chromium-1810.mount Third run stopwatch : 01:59:38 systemd-analyze : Startup finished in 5.897s (kernel) + 52.004s (userspace) = 57.902s graphical.target reached after 51.544s in userspace systemd-analyze blame : 20.482s dev-sda2.device 19.941s snapd.service 15.252s networkd-dispatcher.service 14.922s NetworkManager-wait-online.service 14.429s udisks2.service 13.655s accounts-daemon.service 10.674s ModemManager.service 9.745s dev-loop1.device 9.664s dev-loop3.device 9.444s dev-loop4.device 9.298s polkit.service 9.100s avahi-daemon.service 9.042s NetworkManager.service 8.574s dev-loop5.device 8.396s dev-loop6.device 8.299s dev-loop2.device 8.268s systemd-logind.service 8.267s thermald.service 8.264s wpa_supplicant.service 5.452s gpu-manager.service 4.889s systemd-journal-flush.service 4.021s dev-loop0.device 3.482s packagekit.service 3.237s e2scrub_reap.service 2.999s systemd-udevd.service 2.920s rsyslog.service 2.838s apport.service 2.093s grub-common.service 2.041s apparmor.service 1.899s upower.service 1.371s systemd-modules-load.service 1.278s grub-initrd-fallback.service 1.235s systemd-resolved.service 1.032s systemd-sysctl.service 877ms alsa-restore.service 865ms keyboard-setup.service 766ms user@1000.service 724ms systemd-sysusers.service 629ms systemd-journald.service 601ms modprobe@drm.service 600ms systemd-tmpfiles-setup-dev.service 572ms pppd-dns.service 548ms systemd-udev-trigger.service 523ms systemd-tmpfiles-setup.service 469ms systemd-random-seed.service 463ms ufw.service 444ms snap-bare-5.mount What can I do to improve the situation ? Thank you for your help :-D |
Either your stopwatch is off by a doubling of the time it takes or the computer is wrong on the time shown, all three runs show under a minute whereas your stopwatch is on just about two minutes for every one of them times. Without knowing the method of install and the hardware used in the machine it is impossible to tell you if it can be improved. That said a minute to boot a machine with crappy old hard drive seems reasonable to me. Using clock on the wall having pushed the power button on my computer it just took thirty seconds for mine to boot to the Ubuntu 20.04 login screen on a spare machine I have. That machine has a five second GRUB menu delay, with an i5-8400 2.8ghz coffee lake processor in it with a 128gb NVMe boot drive and 32gb of ram using an EFI install/boot method.
Edit: Oh and it has both Windows 10 and macOS Catalina on it for my spare hackintosh, both were disconnected for the install of the Linux on it and the Ubuntu drive is listed as first in the boot order in the BIOS/EFI firmware. |
I have (perhaps it is similar with you?) on the PC I am writing that answer
1. a SSD with Win10 on it (delivery situation): boot is fantastic 2. an HDD (from a defect notebook, several years old) with grub on it and Debian11 on it: the computer boot there and I can choose Win10 or Debian11. Debian11 launch is not good and probably in your time. I dont care. I assume (like on another notebook with Debian boot on SSD): a direct boot on an SSD would be fantastic. But I am a poor person. I cannot afford another SSD so I have to accept the (small) pains with the HDD. Now my boot times, from "return" in grub menue, when user logon there, Graphic with 2 screens: - Win10 SSD: 00:21 min:sec - Debian 11 HDD: 01:10 min:sec (and -not measured- approx 15sec more for the 2 screen to appear fully after "return" of user password) |
I seriously doubt having the windows drive disconnected during the install OfKubuntu has anything to d with the slow boot.
Quote:
|
Well its a quite an old machine, around 10 years old, and the hard drive that has Linux on it is even older, I belive it's a WD1600AAJS-00L7A0.
So yeah, as I said not really expecting much but I just thought it seemed slow even when taking into account the age of the machine. On the same machine, but the other drive, it takes around 30 seconds to a minute to boot into Windows Also I thought I heard somewhere that if you're trying to dualboot you shouldn't unplug the second drive (the one with Windows in my case) because it could cause some issues with Grub. Also Also when I was measuring boot time with the stopwatch I measured the time it took from clicking the power button to getting to my desktop Here are the specs of my PC (please don't laugh) Intel Pentium G645 4GB ram GT 610 |
Quote:
Edit: And now it pops into my head and doubt it still works at least the hard drive anyways the electronics just might power on. The first machine I ever built myself a 80286 from god knows when in the 1980s is in my closet upstairs. Edit2: and I am fairly old myself all thanks to the wonderful people at the QEII Health Sciences Center who saved my life, the anniversary of that event is in two Thursdays from now. Four extra years they will have given me so far, I will love them people until I really am dead and thank them every day I wake up. |
If you don't use snap, then you could delete the service and shave 19 seconds off boot.
|
Quote:
https://askubuntu.com/questions/1280...uninstall-snap |
Quote:
|
Quote:
|
Well I've removed snap. I followed the instroctions from here https://techwiser.com/remove-snap-ubuntu/
And that caused a lot of the programs, like settings, discover event the shutdown thingy to crash. So I installed snap again, didn't really seem to fix it, everything still crashed when I tried to open it so I tried restarting the pc. That fixed it, but now my resolution is stuck at 800x600. Any help ? |
Quote:
|
Here is the output of lsmod
nvidia_uvm 806912 0 nvidia_drm 49152 1 nvidia_modeset 1056768 1 nvidia_drm nvidia 15851520 2 nvidia_uvm,nvidia_modeset I didn't find nouveau so I guess I'm using nvidia drivers. Something that may also be of help is that when i run xrandr -q i get this xrandr: Failed to get size of gamma for output default Screen 0: minimum 800 x 600, current 800 x 600, maximum 800 x 600 default connected primary 800x600+0+0 0mm x 0mm 800x600 75.00* Update: Ok so I follwed this https://linuxconfig.org/how-to-insta...al-fossa-linux and that fixed the resolution, thank you @HappyTux Kinda sucks that removing snaps can cause so much issues |
Quote:
|
Quote:
It motivate me me to look at my Debian11 on HDD: perhaps I have the same issue than you. |
All times are GMT -5. The time now is 12:59 AM. |