3

Since I have upgraded my Del D630 laptop to Ubuntu 18.04 , boot times became "impossible". It literally take many minutes just to get a login screen, and then still one minute or more to have working icons on a desktop. This for both X11 and Wayland sessions.

I ran systemd analyse tools and I saw that the different snap and systemd services are causing a huge delay in booting.

Does anyone have any idea how to overcome this or how to remove them without further breaking breaking my system?

$ systemd-analyze blame
1min 31.794s dev-loop8.device
1min 31.790s dev-loop9.device
1min 31.675s systemd-backlight@backlight:intel_backlight.service
1min 31.144s systemd-rfkill.service
1.408s dev-sda1.device
822ms fwupd.service
789ms dev-loop7.device
689ms dev-loop6.device
658ms dev-loop3.device
634ms dev-loop1.device
629ms dev-loop5.device
626ms dev-loop0.device
601ms dev-loop4.device
562ms dev-loop2.device
529ms networkd-dispatcher.service
522ms systemd-udev-trigger.service
491ms ModemManager.service
490ms accounts-daemon.service
437ms udisks2.service
409ms NetworkManager.service

$ systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 33.705s
└─multi-user.target @1min 33.703s
└─systemd-user-sessions.service @1min 33.620s +8ms
└─network.target @1min 33.617s
└─NetworkManager.service @1min 33.206s +409ms
└─dbus.service @1min 33.119s
└─basic.target @1min 32.981s
└─sockets.target @1min 32.979s
└─snapd.socket @1min 32.961s +15ms
└─sysinit.target @1min 32.935s
└─apparmor.service @1min 32.710s +222ms
└─local-fs.target @1min 32.686s
└─home.mount @1.695s +22ms
└─systemd-fsck@dev-disk-by\x2duuid-79ea6e09\x2dcdf7\x2d4447\x2d9041\x2d6abffceb9e50.s ervice @1.641s +47ms
└─dev-disk-by\x2duuid-79ea6e09\x2dcdf7\x2d4447\x2d9041\x2d6abffceb9e50.d evice @1.635s

Thanks for any help or tips.

Zanna
  • 70,465

6 Answers6

4

I may have found a work-around; my boot time got reduced from over 4 minutes back to about 50 seconds (Wayland session) by doing:

  1. sudo vi /etc/default/grub
  2. I changed the GRUB_CMDLINE_LINUX_DEFAULT boot parameter to: GRUB_CMDLINE_LINUX_DEFAULT="video=SVIDEO-1:d"
  3. Save and exit vi
  4. sudo update-grub
  5. sudo reboot

br, Koen.

1

Regarding the time spent loading snap packages on boot (dev-loopN.device), it is possible to replace them in Software Center with their versions from universe bionic repo instead of the pre installed versions from Snap Store. Just a few seconds can be saved, however, making real difference only if there are too many snap packages installed on your system

Angelo
  • 11
0

You can disable or uninstall snapd if you don't use snap apps. I've done this routinely since it appeared in Ubuntu.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • How is this going to resolve OP's "slow boot" problem? – Thomas Ward May 05 '18 at 22:11
  • @ThomasWard OP states "I saw that the different snap...services are causing a huge delay in booting". I took them at their word. If snap is causing a huge delay and you don't need it, remove it. – Organic Marble May 05 '18 at 22:37
  • 2
    I think what @ThomasWard is referencing is the systemd analyze-blame output doesn't show any substancial CPU cycles or wait time attributed to snap. It is a good idea to remove snap in the first place though if you don't believe in it. – WinEunuuchs2Unix May 05 '18 at 23:12
0

This also worked for me sudo apt install ubuntu-unity-desktop

My UI was very slowly, boot and login were taking a few seconds, even booting from SSD. After installing unity, everything is back to normal(I'm still using Gnome, just installed unity package)

Note: I started to see these issues after upgrading Ubuntu from 16.04 to 18.04. Don't know if they occur with a fresh installation.

See: https://www.reddit.com/r/Ubuntu/comments/8fks5c/ubuntu_1804_slower_than_1710/

0

I think there were several issues with mine slowing it down. In the end I fixed the GPT with sudo gdisk, formatted and clean installed on my SSD drive, mounted /home on my HDD using the "Something other" install option and I turned on fast boot in the BIOS as well optimizing other boot options.

***I mounted /home on the HDD since the SSD isn't very big on this old Satellite U845.

***I can't speak to all systems but on the Satellite you must set USB emulation to legacy in the BIOS or the .iso won't load on startup even if the USB is set to boot first.

***If the GPT is messed up you will see a mismatch error when you run sudo gdisk /dev/sd(x) where x is the drive containing your mbr/gpt/efi boot info which may or may not be on /dev/sda.

***Backup any important files to an external disk before writing (w) to gdisk. If the gpt doesn't restore correctly you may lose the ability to access those files. For some reason the GPT backup didn't have my NTFS partition so I lost that install but since I had the files backed up it wasn't a big deal.

Edit: I almost forgot to post that my boot time prior was about 3 minutes all in. Here is what I get now on a Satellite U845t with i5@1.8 Ghz running Ubuntu 20.04.

~$ systemd-analyze Startup finished in 1.359s (firmware) + 3.633s (loader) + 3.317s (kernel) + 10.017s (userspace) = 18.329s graphical.target reached after 10.004s in userspace

Greg
  • 1
-1

for me this helped: Boot hangs for 30 seconds at "Begin: Running /scripts/local-premount"

I found out that the local-premount script was hanging when i disabled the splash screen in the grub configuration

  • Welcome to Ask Ubuntu! ;-) Thank you for pointing out that this question was a duplicate. Once you reach 15 rep, you'll be able to flag them as a duplicate! Keep up the good work! – Fabby May 25 '18 at 20:37