Jamescoop
Posts: 15
Joined: Tue May 26, 2015 8:06 pm

Optimizing boot time of Pi Zero W

Wed Feb 26, 2020 4:44 pm

My Pi Zero (despite running at 700MHz, alternate thread in Troubleshooting Forum) take over a minute to boot
Most recent Raspbian Buster Feb 2020 release

How to optimize boot time? How to disable non-needed services on boot?

Thank you in advance

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: Optimizing boot time of Pi Zero W

Wed Feb 26, 2020 4:57 pm

Without knowing what you what to use it for it's imppossible to say which services are "non-needed".

For example:
You could disable all the WiFi related services, but if you need to use WiFi that would make it useless !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jahboater
Posts: 5213
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Optimizing boot time of Pi Zero W

Wed Feb 26, 2020 5:07 pm

Jamescoop wrote:
Wed Feb 26, 2020 4:44 pm
How to optimize boot time?
You could start with "initial_turbo=30" in /boot/config.txt

Run these commands to see whats taking all the time:-

systemd-analyze
systemd-analyze blame
systemd-analyze critical-chain
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

jahboater
Posts: 5213
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Optimizing boot time of Pi Zero W

Wed Feb 26, 2020 5:11 pm

PeterO wrote:
Wed Feb 26, 2020 4:57 pm
Without knowing what you what to use it for it's impossible to say which services are "non-needed".
He was asking "how" to disable the services, not "which ones" he should disable.

Something like:-

sudo systemctl stop xxx.service
sudo systemctl disable xxx.service
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

User avatar
PeterO
Posts: 5623
Joined: Sun Jul 22, 2012 4:14 pm

Re: Optimizing boot time of Pi Zero W

Wed Feb 26, 2020 5:25 pm

jahboater wrote:
Wed Feb 26, 2020 5:11 pm
He was asking "how" to disable the services, not "which ones" he should disable.
Maybe but there's not enough info to tell either way !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Jamescoop
Posts: 15
Joined: Tue May 26, 2015 8:06 pm

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 5:14 am

Where to put those commands? config.txt?
Thanks for the replies.

What is initial_turbo doing?

fruitoftheloom
Posts: 22061
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 5:40 am

Jamescoop wrote:
Thu Feb 27, 2020 5:14 am
Where to put those commands? config.txt?
Thanks for the replies.

What is initial_turbo doing?

As mentioned in you other post TinyCoreLinux is worth a try:

http://forum.tinycorelinux.net/index.ph ... ,57.0.html

http://www.tinycorelinux.net/ports.html
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

Jamescoop
Posts: 15
Joined: Tue May 26, 2015 8:06 pm

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 6:22 am

I need the desktop to run GUI software app

fruitoftheloom
Posts: 22061
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 6:41 am

Jamescoop wrote:
Thu Feb 27, 2020 6:22 am
I need the desktop to run GUI software app

Obviously you are not interested, but for the benefit for those who are reading this in the future it does have a desktop environment which needs to be installed seperately, an Ethernet Connection is preferable for initial setup:

https://iotbyhvm.ooo/picore-tiny-core-l ... pberry-pi/

https://www.zdnet.com/google-amp/articl ... pberry-pi/


TCL supports all models of Raspberry Pi SBC released in the last 8 years.
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

DirkS
Posts: 10206
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 10:50 am

Jamescoop wrote:
Thu Feb 27, 2020 6:22 am
I need the desktop to run GUI software app
That's not a general requirement. Lots of GUI software does not need the desktop.
Just a matter of choosing the best (development) tool for the job / environment.
Especially important if you want to use a Zero that will always struggle to run the full Raspbian desktop...

kolsi
Posts: 38
Joined: Wed Jan 23, 2019 10:40 am

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 11:09 am

Read my old topic here viewtopic.php?f=29&t=236363
Althought it is not directly for PiZero, it might give you some hints. The main idea in systemd services removal and order optimization.

jahboater
Posts: 5213
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 11:18 am

Jamescoop wrote:
Thu Feb 27, 2020 5:14 am
Where to put those commands? config.txt?
Thanks for the replies.
No, they are Linux commands and need to be run once only.
Once a service is disabled, it will never start until you enable it by hand again.
Jamescoop wrote:
Thu Feb 27, 2020 5:14 am
What is initial_turbo doing?
It runs the processor's at full speed for the first N seconds.
It helps boot times - slightly.

The (initial) raison d'être for systemd was to run all the start up processes in parallel as much as possible.
Most modern computers have multiple cores.

Examining "systemd-analyze blame" should help you spot the services taking the most time.
"We are in the beginning of a mass extinction, and all you can talk
about is money and fairy tales of eternal economic growth."
- Greta Thunberg

User avatar
pi-anazazi
Posts: 685
Joined: Fri Feb 13, 2015 9:22 pm
Location: EU

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 12:36 pm

Hi PO!

Based on your first thread I started optimizing boot time on my zero w, with some success.

At first you need to do some analytics. After boot is completed, log in and open a console.

Enter:

Code: Select all

systemd-analyze
Copy the output and post it here with Code tags arround the pasted text. Otherwise nobody will be able to read it.

Next enter:

Code: Select all

systemd-analyze blame
and paste the output into Code tags here in this thread.

Afterwards you can start disabling services you don't need but eating up time on boot. And you can stop waiting for network being up on boot via raspi-config.
Kind regards

anazazi

User avatar
pi-anazazi
Posts: 685
Joined: Fri Feb 13, 2015 9:22 pm
Location: EU

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 1:48 pm

PS: Here somebody proposed some things, but I would personally not disable the fsck on boot. ymmv

https://medium.com/@dmesko/long-pi-zero ... ee832a469d
Kind regards

anazazi

Jamescoop
Posts: 15
Joined: Tue May 26, 2015 8:06 pm

Re: Optimizing boot time of Pi Zero W

Thu Feb 27, 2020 6:28 pm

fruitoftheloom wrote:
Thu Feb 27, 2020 6:41 am
Jamescoop wrote:
Thu Feb 27, 2020 6:22 am
I need the desktop to run GUI software app

Obviously you are not interested, but for the benefit for those who are reading this in the future it does have a desktop environment which needs to be installed seperately, an Ethernet Connection is preferable for initial setup:

https://iotbyhvm.ooo/picore-tiny-core-l ... pberry-pi/

https://www.zdnet.com/google-amp/articl ... pberry-pi/


TCL supports all models of Raspberry Pi SBC released in the last 8 years.

This is very valuable info- thank you. Yes I will check this out, but have had so many problems just getting it to where it is, I cannot focus on making another change at the moment. Im new to this but learning Linux quickly,

Return to “Advanced users”