Ubuntu Server 18.04 - How to decrease boot time of the Rock Pi 4?

I have tested boot time of some operating systems from https://wiki.radxa.com/Rockpi4/downloads

My results:
LibreELEC 9.1.002 - 18 sec
Ubuntu Server 18.04 - 30 sec
Debian Stretch 9.9 - 30 sec
Debian ARM64 Build 4.4.154.c83 - 31 sec
Armbian 5.67 - 32 sec
DietPi Buster - 60 sec

I’m planning to use Ubuntu Server. As you can see LibreELEC has best boot time of 18 sec.
I wonder is it possible to decrease Ubuntu Server boot time up to 20 sec at least and how to do that?

You choose it by the boot time? Seriously?

By starting your own custom Linux distribution made from scratch with Yocto. It will cost you …

1 Like

No, of course not! :slight_smile:

It would be better for me if there is some possibility to cut off some parts of existing distribution. May be disable some services, etc. I’m newbie in that and have lack of deep knowledge of linux.

Better stick to some clean and supported Linux, best would be https://www.armbian.com/rock-pi-4/ where experienced people already did this job for you. Standard (Debian like) Linux needs some time to put up necessary services. There is nothing you don’t need or something that would slow you down for no reason.

Only (usually) single task custom Linux OS can boot faster … which is also seen from your experiment (OpenElec = “just enough OS to run KODI”).

1 Like

Choose to boot from eMMC or M.2, eventually SSD drive from USB 3.0. I have lowered the boot time to few seconds.

I boot from eMMC.

@pbies I am using Ubuntu Server, and using M.2 NVME SSD, but boot time is 30 seconds. Do I have to do anything related to SPI flash or something else? 30 seconds is really a lot for SSD boot. I don’t understand how you are achieving few secs.

@rrzayev Change timeout in /boot/extlinux/extlinux.conf to minimum 10 seconds. With lower value it will fail to boot.

@pbies I checked it, and the timeout is already 10 seconds. Probably issue is somewhere else. I would appreciate any other tips if you have :slight_smile:

What OS are you using that boots for few seconds on NVME? Did you try it with official Ubuntu-Server from Radxa?

How do you measure this boot time?

Yes, I am using Radxa Ubuntu 20.04.5 LTS with kernel 4.4.154-116-rockchip-g86a614bc15b3.

My kernel is 5, not 4. I power the system, it takes 30 seconds until Linux starts showing boot messages, and then enters the main desktop screen. Until that moment, screen is dark.

I don’t know kernel in version 5. Maybe you use some services that has long start. Try using fresh image.

I just did the fresh image right now and it is still 30 seconds till boot. Image name: rockpi-4b-ubuntu-focal-server-arm64-20220801-0355-gpt from https://github.com/radxa-build/rockpi-4b/releases/tag/20220801-0227

Kernel version is 5.10.131-2-rockchip-g8802564cbf09

Use kernel options:

append earlyprintk console=tty1

to see the whole boot process.
Then you can see what slows it down.

I did

append earlyprintk console=tty1

On Kernel 4.4, it looks to be faster:
First 16 seconds are dark screen. From 16 to 20 are boot logs. After 20 seconds comes login screen.

On Kernel 5:
First 30 seconds are dark screen. From 30 to 40 are boot logs. After 40 seconds comes login screen.

Why so much time in dark screen. Is it normal?

I don’t have eMMC or SD card on Rock, only NVME.

What /var/log/syslog says?

There is no directory/file called syslog in this path. Below you can find the screenshot showing contents of /var/log/ :

Try first running once unminimize script to make written image working properly. Maybe at boot time (before login) the script is run and fails. Without syslog there can’t be much said about what happens in boot time.

Also run:

apt update
apt upgrade

for all packages after that reboot and search for syslog file.