LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   elementary OS (https://www.linuxquestions.org/questions/elementary-os-112/)
-   -   How To Make Elementary OS Loki Boot Faster (https://www.linuxquestions.org/questions/elementary-os-112/how-to-make-elementary-os-loki-boot-faster-4175618510/)

Ztcoracat 11-28-2017 12:48 AM

How To Make Elementary OS Loki Boot Faster
 
For some reason Elementary OS Loki (Ubuntu 16.04) is taking a long time to boot up and I'm having trouble figuring out why and which service to disable. It's about 3 seconds short of 3 minutes to the full screen DE.

Amazingly it shuts down in 3 seconds.

I installed BUM (Boot Up Manager) and unchecked bluethooth, services associated with cups and the printer. Boot up time was a little less but not by much.

Here's the output of the services running at start up.

Code:

MS-7845:~$ systemd-analyze blame

        23.969s apt-daily.service
          8.734s dev-sdb1.device
          7.062s NetworkManager-wait-online.service
          6.536s apparmor.service
          5.641s ufw.service
          5.329s libvirt-bin.service
          3.774s qemu-kvm.service
          3.235s systemd-tmpfiles-setup-dev.service
          3.162s ModemManager.service
          2.901s accounts-daemon.service
          2.694s console-setup.service
          2.409s NetworkManager.service

Now when I ran systemd-analyze plot > boot and looked at all of the services running at start up in FF "Plymouth-start.service" was all the way across the board for 2 min's. Here's the 7 services that are taking the longest:

1. -ufw.service 6.958 seconds
2. -systemd-tmpfiles-setup-dev.service 2.470 seconds
3. -qemu-kvm.service 1.933 seconds
4. -apparmor.service 5.819 seconds
5. -console-setup.service 1.949 seconds
6. -plymouth-start.service 13 seconds
7. -modemnanager.service 2.268 seconds

I found these 2 threads but I not so sure what the answer is or the fix really is. I really don't want to "try" things. Instead I want to fix the booting issue:-

https://askubuntu.com/questions/8004...-daily-service

https://nateofnine.com/2017/02/18/fi...os-slow-boots/

How can I be certain which service is taking so long and which one to disable?

jefro 11-28-2017 10:15 PM

While you are waiting maybe take a peek at these ideas. https://wiki.debian.org/BootProcessSpeedup

Someone may have a guide on it somewhere.

Ztcoracat 11-28-2017 10:50 PM

Quote:

Originally Posted by jefro (Post 5786437)
While you are waiting maybe take a peek at these ideas. https://wiki.debian.org/BootProcessSpeedup

Someone may have a guide on it somewhere.

Thanks ;)

I have a few ideas now:-

Ztcoracat 11-28-2017 11:02 PM

I was able to solve the 3 minute booting issue.

After editing the /etc/systemd/system.conf file and changing the DefaultTimeoutStartSec=90s to 10 seconds and rebooted......
the system now boots in 45 seconds:-

Yahoo!

!!! 11-29-2017 12:12 AM

UUID mismatch?
 
Hi. Great thread/details!!! From something I has seen, by any chance,
Might there be a mismatch of UUID in fstab (vs current 'real', per lsblk)?
(I was wondering why systemd would hang 'without good reason')

Ztcoracat 11-29-2017 12:19 AM

Quote:

Originally Posted by !!! (Post 5786461)
Hi. Great thread/details!!! From something I has seen, by any chance,
Might there be a mismatch of UUID in fstab (vs current 'real', per lsblk)?
(I was wondering why systemd would hang 'without good reason')

Thanks-

No, don't think there was a mismatch of the UUID.

Are you running Elementary OS Loki !!!?

!!! 11-29-2017 12:42 AM

No, just a thirst for theoretical learning;)
IF you've ever changed partitions since initial install, it might be worth a quick check. I once saw on LQ something about a grub resume=UUID... mismatch after partition changes, causing slowness.

I also saw the mention of ipv6. I tried researching "Plymouth-start.service" slow, but didn't notice anything. I just wish I knew every last exact detail about how all this works:banghead: (yea, I know: the million lines of source code:eek:)

Anyway, if it works for you, that's all that counts. Despite the theoretical purists:D

Ztcoracat 11-29-2017 01:07 AM

A thirst for theoretical learning is a-ok with me.;)

In fact the more you learn about Linux you'll have an incredible education and great resources.

Learn all you can !!! and you'll be a Guru before you know it:-

Nope, never changed partitions.

Like you I researched Plymouth-start.service too and didn't find anything worth writing home about.
At first I thought it was systemd-tmpfiles-setup-dev.service which creates, deletes and cleans up volatile and tmp files and directories based on the configuration file.

Tho the article you linked said it's not wise to set the DefaultTimeoutStart to 10 sec's it worked like a charm for me.;)
That article was created in May of 2016 so maybe the Dev's changed something since than?

Sometimes the Tips and Tricks Tech's are mistaken. Or at least in this case for Elementary OS they were:-

It's late:-

Cheers and thanks for sharing.

sbanga95 05-25-2018 02:03 PM

Quote:

Originally Posted by Ztcoracat (Post 5786447)
I was able to solve the 3 minute booting issue.

After editing the /etc/systemd/system.conf file and changing the DefaultTimeoutStartSec=90s to 10 seconds and rebooted......
the system now boots in 45 seconds:-

Yahoo!

That sounds awesome. I'm new to Linux and I just installed Elementary OS Loki. Can you give a quick step-by-step on how to do this? Really appreciate it man!

TheTKS 05-28-2018 10:42 AM

Quote:

Originally Posted by sbanga95 (Post 5859227)
That sounds awesome. I'm new to Linux and I just installed Elementary OS Loki. Can you give a quick step-by-step on how to do this? Really appreciate it man!

sbanga95, I know you're asking Ztoracat, but I'll refer you to one of Ztoracat's links to answer what worked for me.

TL DR: for my elementaryOS Loki, changing the default timers to 14 sec or more gave me better boot time without causing errors (that I know of), changing apt daily service didn't make a difference for me. See instructions in https://askubuntu.com/questions/8004...-daily-service, post by cat Feb 28 '17 at 15:12.

Longer version:

I used this for elementaryOS Loki, Xubuntu 16.04 and Kubuntu 16.04 on two computers, and it worked for all 3 Ubuntu flavours / derivatives.

I went to the post linked by Ztoracat earlier
https://askubuntu.com/questions/8004...-daily-service

In one of my OSs, I tried the steps that start with "# apt-daily timer configuration override", but that didn't shorten boot time.

Then in the same OS I tried the steps posted by cat Feb 28 '17 at 15:12, changing default timers. One caution: that link and Ztoracat use 10 sec, someone else wrote not less than 30 sec. I tried 10 sec and booting was faster, but an error appeared in startup. No idea if it affected anything, I could sign into the OSs and didn't pursue it, but I tried a few different timer lengths. On all 3 OSs, 14 sec was the shortest timer without the startup error popping up. I added safety factor and made both timers 20 sec for boot time. Total boot time under 50 sec (from picking *buntu/elementary in GRUB menu to sign in block under 40 sec, from sign in to desktop in under 10 sec.)

I don't remember if I removed the "# apt-daily timer configuration override" from the one OS, but I didn't do it in the other two OSs, and got the same boot times in all three OSs.

Thanks Ztoracat for publishing your posts and links!

TKS

Adding two things:
- I used nano instead of gedit, and ran sudo not gksudo.
- I've removed Kubuntu 16.04 and installed Ubuntu 18.04 in its place. Total boot times 36 sec without these extra steps needed.


All times are GMT -5. The time now is 12:54 AM.