LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-10-2021, 06:47 AM   #1
giuuji
LQ Newbie
 
Registered: Nov 2021
Distribution: Kubuntu
Posts: 5

Rep: Reputation: Disabled
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
 
Old 11-10-2021, 09:14 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
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.

Last edited by HappyTux; 11-10-2021 at 09:19 AM.
 
Old 11-10-2021, 10:08 AM   #3
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
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)

Last edited by floppy_stuttgart; 11-10-2021 at 10:17 AM.
 
Old 11-10-2021, 11:34 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,539

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
I seriously doubt having the windows drive disconnected during the install OfKubuntu has anything to d with the slow boot.

Quote:
The hard drive that Linux is on is quite old and slow
Define 'old' and what kind of drive? I have 2 laptops with windows 10 on each and 2 Liux systems on each (thesameOS). One computer has 1 SSD drive while the other has 1 SATA drive. The systems on the SSD each boot approximately 4 times faster than the systems with the SATA drive. Most likely hardware unless you can post some actual information.
 
Old 11-10-2021, 02:30 PM   #5
giuuji
LQ Newbie
 
Registered: Nov 2021
Distribution: Kubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-10-2021, 03:59 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by giuuji View Post
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
Why would we laugh we have all used old hardware with Linux on it or in it. At least I have I am cheap SOB and never have thrown working stuff away just in case I need it in the future. Judging by the model number an old 160gb hard drive by western digital not sure if that is even SATA a quick search says yes it is a SATA2 drive. So it is not the fastest as has been mentioned cheap SSD in there would make the world of difference and have you thinking you bought new machine the difference is so great in the speed it works at. Oldest stuff like that I have laying around are a couple of 80gb IDE drives by western digital perhaps a forty now I think a little more. Still have the original SSD from Kingston I bought ages ago in one of my machines a 40gb SSDNow model it has to have been in use for over a decade now at least. A quick search on it tells me 2009 for the release, I keep expecting it to die off anytime but it is like the Energizer bunny and just keeps going and going...

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.

Last edited by HappyTux; 11-10-2021 at 04:14 PM.
 
Old 11-10-2021, 04:06 PM   #7
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,174

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
If you don't use snap, then you could delete the service and shave 19 seconds off boot.
 
Old 11-10-2021, 04:55 PM   #8
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by uteck View Post
If you don't use snap, then you could delete the service and shave 19 seconds off boot.
Indeed now you mention it I have disabled that junk too. The guide I used from my bookmarks the one part way down the page with a 3 for the rating containing the snap remove commands for all the packages, it starts with "Full credit to Don Prince".

https://askubuntu.com/questions/1280...uninstall-snap
 
Old 11-10-2021, 07:11 PM   #9
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 490

Rep: Reputation: 180Reputation: 180
Quote:
...cheap SSD in there would make the world of difference and have you thinking you bought new machine the difference is so great in the speed it works at
That I can attest too.... SSDs made old new for every laptop around here.... Even on my wife's tiny mini-laptop (notebook? Micro? Don't know what it was called but goes back a few years) it made it at least bearable to use with Linux Lite. Windows (what it came with) was almost impossible to use on that one.. even with an SSD!
 
Old 11-10-2021, 09:18 PM   #10
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by rclark View Post
That I can attest too.... SSDs made old new for every laptop around here.... Even on my wife's tiny mini-laptop (notebook? Micro? Don't know what it was called but goes back a few years) it made it at least bearable to use with Linux Lite. Windows (what it came with) was almost impossible to use on that one.. even with an SSD!
Oh yeah them laptop drives are bad couple of years ago I bought newer one for myself. It was described as used but what arrived at my door was a sealed in box refurbished old stock, with eleven months of warranty remaining even. The drive in that was a pig a full minute and half at least to boot, I replaced it with ssd and it booted in under twenty seconds, still does.
 
Old 11-11-2021, 10:23 AM   #11
giuuji
LQ Newbie
 
Registered: Nov 2021
Distribution: Kubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 11-11-2021, 10:52 AM   #12
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by giuuji View Post
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 ?
I dislike things like the snap they never seems to perform as they are supposed to, change for the sake of change not good working progress. That said it could be your driver for the video card is not working properly, which do you have it using the nvidia or nouveau, to check sudo lsmod in terminal will show one of them hopefully with a 1 in the second column showing it is in use. With the nvidia a re-install of the driver may help.
 
Old 11-11-2021, 11:06 AM   #13
giuuji
LQ Newbie
 
Registered: Nov 2021
Distribution: Kubuntu
Posts: 5

Original Poster
Rep: Reputation: Disabled
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

Last edited by giuuji; 11-11-2021 at 11:24 AM.
 
Old 11-11-2021, 11:37 AM   #14
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by giuuji View Post
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
You are welcome good to see it is back to working for you, yes that extra junk always seems to cause problems. This is the problem with busy work as I think of it, the idea that since you get paid to work on something you invent the justification for the money paid. With the Ubuntu family of software it drives me nuts all the kernel updates and things like this they do with this same idea as far as I can tell. Every few days I will turn on my supposedly stable machines running 20.04 every time I check for update it is a new kernel to install most of the time. Now my Debian stable machines hardly anything gets updated and the kernel once in a while so that tells me someone is busy trying to justify their job as no security issues have been addressed or Debian would have updated their kernel or user space programs for the same issue.
 
Old 11-12-2021, 04:29 AM   #15
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by giuuji View Post
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
How have you made that listing?
It motivate me me to look at my Debian11 on HDD: perhaps I have the same issue than you.

Last edited by floppy_stuttgart; 11-12-2021 at 04:30 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How the NY Times CIO broke down silos to democratize data at the Times LXer Syndicated Linux News 0 03-16-2015 06:10 PM
[SOLVED] atkbd Slow Boot Times x86_64 slack_rick Slackware 4 04-16-2013 05:56 PM
Kubuntu 10.10 Dual Boot W/ Win 7 Pro: No Option To Boot Kubuntu FrostBot Ubuntu 2 01-26-2011 08:17 PM
Data transfer online is slow "at times" or "stops at times" Balarabay1 SUSE / openSUSE 14 04-30-2006 10:00 AM
System hangs; Atheros Madwifi-ping times out every 15/16 times james 456 Linux - Networking 0 01-12-2006 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration