Speeding up boot time and the necessary commands
-
@hairdyeguy Disabling a service is exactly that - it disables the service completely, it will not be started at all.
-
@mitu I don't mind disabling bluetooth since I currently don't use it, but I do need wifi and SSH (I don't know about other services because I still don't know many of them hence I don't know if they're important).
Isn't there a way to wait after boot? -
Isn't there a way to wait after boot?
Not sure what you mean by that. What for what ?
Did you disable the 'Wait for Network connection' at boot from Raspi-Config ? This will speed up the boot by not waiting for the Wi-Fi/SSH initialization.
-
@mitu said in Speeding up boot time and the necessary commands:
Not sure what you mean by that. What for what ?
I meant set service to load after boot (like with the wifi. I don't know if it works with other services)
@mitu That I did, though somehow it raised the booting time from 45 seconds to 47 seconds (about 6 seconds for kernel and 41 seconds for userspace). I have yet to disable bluetooth (plan on doing it now), and as for other services, I have no idea what they do, so I don't know if I should disable them.
-
I meant set service to load after boot (like with the wifi. I don't know if it works with other services)
I don't think there is a configuration for each service to do that, but each one is bound by its configuration and it may wait in turn for other service to complete.
I have no idea what they do, so I don't know if I should disable them.
Take a backup of your image and experiment by disabling one service at a time. If you've used
systemd-analyze
, you can see which service takes the longest to start and you can start by picking one of the outliers.Post the output of
systemd-analyze blame
andsystemd-analyze critical-chain
and then we can advise. -
@mitu Actually when I used
systemd-analyze
the only output was this: -
@mitu
This is thesystemd-analyze blame
output https://pastebin.com/VBgpGu8E
And this is thesystemd-analyze critical-chain
output https://pastebin.com/K3T50phv -
Try disabling the file shares (Samba) services, which take a long time to start
sudo systemctl disable smbd.service sudo systemctl disable nmbd.service
You'll not be able to use file shares to transfer ROMs though, but you can use SFTP/SSH instead.
You may disable the
triggerhappy
service also, assuming you don't use for something like GPIO inputs or anything else. -
@mitu
How can I transfer files via putty? The documentation only shows samba services.
Though I don't mind also transferring by plugging the sd card into my laptop.What
triggerhappy
does? Technically I'm going to put the pi in a freeplay zero kit which requires pins, but I think the kit has its own image and I can always turn in back on.
(I'm sorry I'm blabbering on, I'm new to this and to Linux so I worry that I made mistakes in my logic)
EDIT: oh, is it better to change things via ssh or is it better to edit the files on the sd card via laptop? I still haven't figured out how to paste commands into the putty terminal so long lines are tiring -
@hairdyeguy said in Speeding up boot time and the necessary commands:
How can I transfer files via putty? The documentation only shows samba services.
Use WinSCP for file transfers. While technically you can use Putty's equivalent (
pscp
), it's easier with WinSCP.What triggerhappy does? Technically I'm going to put the pi in a freeplay zero kit which requires pins, but I think the kit has its own image and I can always turn in back on.
Not familiar with their image, they might not use it. triggerhappy is a service that listens for input from various sources (keyboard/gamepad) and can execute scripts. Out of the box it doesn't have anything configured, but it's installed if you need to use it. I think it's safe to disable it.
-
@hairdyeguy said in Speeding up boot time and the necessary commands:
EDIT: oh, is it better to change things via ssh or is it better to edit the files on the sd card via laptop? I still haven't figured out how to paste commands into the putty terminal so long lines are tiring
Shift + Insert copies the current clipboard text to the Putty command line session. You can paste with Right Click only if configured, but not sure if it's the default.
-
I’m also interested in this for my GPi Case. Going to give this a shot later as well. Thanks @mitu and @HairDyeGuy.
-
@mitu
Tried it along side to disabeling bluetooth and rainbow splash screen + inserting the quiet flag to kernel. Booting time is now 28 seconds!
Are there more things you'd recommend?EDIT:
@mitu said in Speeding up boot time and the necessary commands:Shift + Insert copies the current clipboard text
Tried it but it didn't work
-
@hairdyeguy said in Speeding up boot time and the necessary commands:
Tried it along side to disabeling bluetooth and rainbow splash screen + inserting the quiet flag to kernel. Booting time is now 28 seconds!
Are there more things you'd recommend?The EmulationStation settings I mentioned in my first post - they should speed up dramatically the front-end startup.
Other services that are not strictly needed -
raspi-config
(?),hciuart
(which you don't need if you disabled Bluetooth),rpi-eeprom-update
(the Pi zero doesn't have an EEPROM).
You can also disable the swap service (dphys-swapfile
) and test, but the Pi 0 has limited memory and swap may be useful if you want to install from source or run other things.I'm not sure why the
dev-mmcblk0p2.device
takes so long, maybe the sdcard is not so fast (?).There may be other - more radical - options
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.