Os-prober execution times

When there are a number of linux distros installed, you have probably noticed that the os-prober part of update-grub can take some time.

Here is what I get with MX23

MX23
root@trinity:/home/nevj/Downloads# time update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-25-amd64
Found initrd image: /boot/initrd.img-6.1.0-25-amd64
Found Artix Linux (rolling) on /dev/sda7
Found Void Linux on /dev/sdc5
Found Devuan GNU/Linux 5 (daedalus) on /dev/sdc7
Found antiX (23.1) on /dev/sdi5
Found Arch Linux (rolling) on /dev/sdi6
done

real	1m22.949s
user	0m24.557s
sys	0m19.886s

So, over a minute of real time. That is fair enough, it has to probe 29 partitions in my case.

But, look at this for Void Linux on the same machine

Void
# time update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.6.58_1
Found initrd image: /boot/initramfs-6.6.58_1.img
Found linux image: /boot/vmlinuz-6.6.54_1
Found initrd image: /boot/initramfs-6.6.54_1.img
Found linux image: /boot/vmlinuz-6.6.48_1
Found initrd image: /boot/initramfs-6.6.48_1.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Artix Linux (rolling) on /dev/sda7
Found antiX (23.1) on /dev/sdb5
Found Arch Linux (rolling) on /dev/sdb6
Found MX 23.4 Libretto (23.4) on /dev/sdd3
Found Devuan GNU/Linux 5 (daedalus) on /dev/sdd7
Adding boot menu entry for UEFI Firmware Settings ...
done
4.56user 3.10system 0:14.12elapsed 54%CPU (0avgtext+0avgdata 12160maxresident)k
449816inputs+240outputs (70major+793679minor)pagefaults 0swaps

Yes, only 14 secs real time.
A six-fold difference?

The full story , for all my current distros
MX23 1m 22 sec
Void 0m 14s
Devuan 0m 56s
Antix 0m 59s
Artix/S6 3m 58s

It can be truly said… “Nothing probes like a Void”

Can anyone explain?

4 Likes