Boot time optimize (<10s)

Hi everyone, currently i am trying to make my boot time in my Beaglebone black as low as possible, target is < 10s
Here is my systemd-analyze blame
root@arm:~# systemd-analyze
Startup finished in 4.093s (kernel) + 9.019s (userspace) = 13.113s
multi-user.target reached after 8.695s in userspace
root@arm:~# systemd-analyze blame
8.179s dev-mmcblk0p1.device
2.291s systemd-udev-trigger.service
1.016s systemd-logind.service
938ms e2scrub_reap.service
850ms user@1000.service
727ms sudo.service
706ms dev-mqueue.mount
691ms sys-kernel-debug.mount
651ms sys-kernel-tracing.mount
634ms fake-hwclock.service
608ms kmod-static-nodes.service
594ms modprobe@configfs.service
586ms modprobe@fuse.service
585ms modprobe@drm.service
570ms systemd-fsck-root.service
550ms systemd-modules-load.service
421ms systemd-remount-fs.service
408ms sys-fs-fuse-connections.mount
396ms systemd-user-sessions.service
379ms systemd-sysusers.service
378ms systemd-journal-flush.service
375ms systemd-random-seed.service
373ms sys-kernel-config.mount

here is my df -h in home
root@arm:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 250M 28G 1% /
devtmpfs 221M 0 221M 0% /dev
tmpfs 245M 0 245M 0% /dev/shm
tmpfs 98M 800K 98M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 49M 0 49M 0% /run/user/1000
My sd card is not too slow,
root@arm:~# hdparm -tT /dev/mmcblk0p1

/dev/mmcblk0p1:
Timing cached reads: 368 MB in 2.01 seconds = 183.19 MB/sec
Timing buffered disk reads: 66 MB in 3.07 seconds = 21.51 MB/sec

i notice that 8.179s dev-mmcblk0p1.device or service that mount sd-card take the longest
at first i thought because i have many package in sd card, but it not
i try to delete so many package, just to need to boot ok, from 544Mb to 250Mb, but it still take 13s
I donā€™t know why is that, i disable and delete all package and service related to Internet, sudo, openssl, ā€¦ Because i want my boot time as low as possible, i disable tty1, i only connect to board, through USB serial

Can you guy suggest me what to do next , i try many thing, at first the boot takes 18s, now it is 13s

I follow the guide install kernel of RobertCNelson

have you search this site for ā€œboot timeā€ there has been a lot of work by others on this subject.

1 Like

Hello, can you tell me what worked for you to reduce the boot time to 13s? Thatā€™s not a bad time. Iā€™m trying to follow the discussions that were started in the forum, but Iā€™ve only managed to get it down to 23s.

1 Like

Hi !
Since that day, I still havenā€™t made any progress in reducing boot time. However, I fear that my approach focuses solely on minimizing the time as much as possible. Because of that, I have avoided using the Internet connection feature and have removed as many things as possible, including vim, nano, ssh, grep, etc. Currently, Iā€™m only using a connection via USB TTL. Iā€™m studying how to use Busybox and Buildroot, but I havenā€™t achieved any concrete results yet.
For more detail what i do, please check this

////////////////////////////////////////////////////////////////////////////////////
Package remove
////////////////////////////////////////////////////////////////////////////////////
modemmanager
manpages
vim-tiny
wget
ppp
network-manager
isc-dhcp-client
sudo
firmware-ti-connectivity
nano
btrfs-progs
iproute2
apt-get install iproute2 ifupdown
gpg
dirmngr
bash-completion
openssl
libsqlite3-0
libslang2

////////////////////////////////////////////////////////////////////////////////////
df -h
Filesystem Size Used Avail Use% Mounted on
udev 218M 0 218M 0% /dev
tmpfs 49M 800K 49M 2% /run
/dev/mmcblk0p1 30G 258M 28G 1% /
tmpfs 245M 0 245M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 49M 0 49M 0% /run/user/1000

/etc/modprobe.d$ dpkg-query -W --showformat=ā€˜${Installed-Size}\t${Package}\nā€™ | sort -nr | less
15022 coreutils
11758 systemd
8994 libglib2.0-data
8481 udev
8231 libc6
6555 dpkg
6518 perl-base
6051 bash
4397 libc-l10n
4003 sudo
3674 apt
3152 util-linux
2971 libc-bin
2940 tar
2796 libglib2.0-0
2636 libapt-pkg6.0
2568 libgnutls30
2543 libssl1.1
2266 login
2042 passwd
1817 findutils
1725 libdns-export1110
1711 libstdc++6

////////////////////////////////////////////////////////////////////////////////////
Module remove
////////////////////////////////////////////////////////////////////////////////////

/etc/modprobe.d$ cat blacklist.conf
blacklist joydev
blacklist hid_generic
blacklist snd_soc_simple_card
blacklist snd_soc_core
blacklist snd_soc_davinci_mcasp
blacklist snd_pcm
blacklist snd_timer
blacklist snd_soc_ti_udma
blacklist snd_soc_ti_edma
blacklist snd_soc_ti_sdma
blacklist snd_soc_hdmi_codec
blacklist snd_pcm_dmaengine
blacklist evdev

/etc/modprobe.d$ lsmod
Module Size Used by
pru_rproc 24576 0
uio_pdrv_genirq 20480 0
uio 20480 1 uio_pdrv_genirq

////////////////////////////////////////////////////////////////////////////////////
systemd-analyze
////////////////////////////////////////////////////////////////////////////////////

systemd-analyze
Startup finished in 4.153s (kernel) + 9.095s (userspace) = 13.249s
multi-user.target reached after 8.756s in userspace
systemd-analyze blame
9.362s dev-mmcblk0p1.device
2.287s systemd-udev-trigger.service
1.019s systemd-logind.service
913ms user0.service
846ms e2scrub_reap.service
841ms user1000.service
808ms sudo.service
657ms dev-mqueue.mount
649ms sys-kernel-debug.mount
633ms sys-kernel-tracing.mount
629ms fake-hwclock.service
615ms kmod-static-nodes.service

////////////////////////////////////////////////////////////////////////////////////
after run bbb-eMMC-flasher-eewiki-ext4.sh script to run on eMMC
////////////////////////////////////////////////////////////////////////////////////

//boot from sd-card

systemd-analyze
Startup finished in 7.367s (kernel) + 8.557s (userspace) = 15.924s
multi-user.target reached after 8.234s in userspace

systemd-analyze blame
7.679s dev-mmcblk0p1.device
1.983s systemd-udev-trigger.service
872ms systemd-logind.service
848ms user1000.service
723ms e2scrub_reap.service
712ms sudo.service
662ms dev-mqueue.mount
660ms sys-kernel-debug.mount
639ms sys-kernel-tracing.mount
634ms fake-hwclock.service
623ms kmod-static-nodes.service

systemd-analyze critical-chain

multi-user.target 8.234s
ā””ā”€getty.target 8.199s
ā””ā”€serial-gettyttyS0.service 8.170s
ā””ā”€dev-ttyS0.device 8.115s

//boot from emmc
systemd-analyze
Startup finished in 6.908s (kernel) + 8.387s (userspace) = 15.295s
multi-user.target reached after 8.049s in userspace

systemd-analyze critical-chain

multi-user.target 8.049s
ā””ā”€getty.target 8.014s
ā””ā”€serial-gettyttyS0.service 7.975s
ā””ā”€dev-ttyS0.device 7.923s

systemd-analyze blame
8.299s dev-mmcblk1p1.device
1.961s systemd-udev-trigger.service
867ms systemd-logind.service
700ms user1000.service
674ms sudo.service
664ms dev-mqueue.mount
655ms sys-kernel-debug.mount
643ms sys-kernel-tracing.mount
640ms fake-hwclock.service
623ms kmod-static-nodes.service