Grub-mkconfig and OS-Prober

This is not really an issue but I am curious about it. When running grub-mkconfig -o /boot/grub/grub.cfg, it takes what seems like a long time for os-prober to complete its run. Why would this be so? I do have other 4 oses installed alongside EndeavourOS. Here is info on my laptop.

System:
  Kernel: 6.14.7-arch2-1 arch: x86_64 bits: 64 compiler: gcc v: 15.1.1
    clocksource: tsc
  Desktop: Openbox v: 3.6.1 with: tint2 vt: 7 dm: LightDM v: 1.32.0
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 11433FU v: ThinkPad E520
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 11433FU serial: <superuser required>
    uuid: <superuser required> UEFI-[Legacy]: LENOVO v: 8HET30WW(1.12)
    date: 05/19/2011
Battery:
  ID-1: BAT0 charge: 52.2 Wh (99.6%) condition: 52.4/71.3 Wh (73.4%)
    volts: 12.2 min: 10.8 model: SANYO LNV-42T4763 type: Li-ion serial: <filter>
    status: not charging
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse serial: <filter>
    charge: 55% (should be ignored) rechargeable: yes status: discharging
CPU:
  Info: dual core model: Intel Core i5-2410M bits: 64 type: MT MCP
    smt: enabled arch: Sandy Bridge rev: 7 cache: L1: 128 KiB L2: 512 KiB
    L3: 3 MiB
  Speed (MHz): avg: 800 min/max: 800/2900 cores: 1: 800 2: 800 3: 800 4: 800
    bogomips: 18359
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
    vendor: Lenovo driver: i915 v: kernel arch: Gen-6 ports: active: LVDS-1
    empty: DP-1,HDMI-A-1,VGA-1 bus-ID: 00:02.0 chip-ID: 8086:0116
    class-ID: 0300
  Device-2: Bison Lenovo Integrated Webcam driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-1.5:3 chip-ID: 5986:03b3
    class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.16 compositor: Picom v: 12.5 driver: X:
    loaded: modesetting alternate: fbdev,intel,vesa dri: crocus gpu: i915
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99")
    s-diag: 414mm (16.31")
  Monitor-1: LVDS-1 model: LG Display 0x02e3 res: mode: 1366x768 hz: 60
    scale: 100% (1) dpi: 101 size: 344x194mm (13.54x7.64") diag: 395mm (15.5")
    modes: 1366x768
  API: EGL v: 1.5 hw: drv: intel crocus platforms: device: 0 drv: crocus
    device: 1 drv: swrast gbm: drv: crocus surfaceless: drv: crocus x11:
    drv: crocus inactive: wayland
  API: OpenGL v: 4.5 compat-v: 3.3 vendor: intel mesa v: 25.1.1-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel HD Graphics 3000 (SNB
    GT2) device-ID: 8086:0116
  Info: Tools: api: eglinfo,glxinfo x11: xdpyinfo, xprop, xrandr
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio
    vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
    chip-ID: 8086:1c20 class-ID: 0403
  API: ALSA v: k6.14.7-arch2-1 status: kernel-api
  Server-1: JACK v: 1.9.22 status: off
  Server-2: PipeWire v: 1.4.2 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: 4000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel Centrino Wireless-N 1000 [Condor Peak] driver: iwlwifi
    v: kernel pcie: speed: 2.5 GT/s lanes: 1 bus-ID: 08:00.0 chip-ID: 8086:0084
    class-ID: 0280
  IF: wlan0 state: down mac: <filter>
Bluetooth:
  Device-1: Broadcom BCM2045B (BDC-2.1) driver: btusb v: 0.8 type: USB
    rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 2-1.4:5 chip-ID: 0a5c:217f
    class-ID: fe01 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 2 state: down bt-service: not found
    rfk-block: hardware: no software: no address: see --recommends
Drives:
  Local Storage: total: 931.51 GiB used: 47.13 GiB (5.1%)
  ID-1: /dev/sda vendor: Western Digital model: WD10JPVX-75JC3T0
    size: 931.51 GiB speed: 6.0 Gb/s tech: HDD rpm: 5400 serial: <filter>
    fw-rev: 1A01 scheme: MBR
Partition:
  ID-1: / size: 97.47 GiB used: 27 GiB (27.7%) fs: ext4 dev: /dev/sda9
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 40.5 C mobo: N/A
  Fan Speeds (rpm): cpu: 0 fan-2: 0
Repos:
  Packages: pm: pacman pkgs: 966
  Active pacman repo servers in: /etc/pacman.d/endeavouros-mirrorlist
    1: https://mirrors.gigenet.com/endeavouros/repo/$repo/$arch
    2: https://mirror.moson.org/endeavouros/repo/$repo/$arch
    3: https://mirror.accum.se/mirror/endeavouros/repo/$repo/$arch
    4: https://md.mirrors.hacktegic.com/endeavouros/repo/$repo/$arch
    5: https://mirror.rznet.fr/endeavouros/repo/$repo/$arch
    6: https://mirror.funami.tech/endeavouros/repo/$repo/$arch
    7: https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
    8: https://mirrors.c0urier.net/linux/endeavouros/repo/$repo/$arch
    9: https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch
    10: https://mirror.archlinux.tw/EndeavourOS/repo/$repo/$arch
    11: https://www.miraa.jp/endeavouros/repo/$repo/$arch
    12: https://fosszone.csd.auth.gr/endeavouros/repo/$repo/$arch
    13: https://ftp.belnet.be/mirror/endeavouros/repo/$repo/$arch
    14: https://mirror.freedif.org/EndeavourOS/repo/$repo/$arch
    15: https://mirrors.jlu.edu.cn/endeavouros/repo/$repo/$arch
    16: https://mirrors.nxtgen.com/endeavouros-mirror/repo/$repo/$arch
    17: https://fastmirror.pp.ua/endeavouros/repo/$repo/$arch
    18: https://endeavouros.ip-connect.info/repo/$repo/$arch
    19: https://mirror.albony.xyz/endeavouros/repo/$repo/$arch
    20: https://mirror.sjtu.edu.cn/endeavouros/repo/$repo/$arch
    21: https://mirrors.urbanwave.co.za/endeavouros/repo/$repo/$arch
    22: https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
  Active pacman repo servers in: /etc/pacman.d/mirrorlist
    1: https://america.mirror.pkgbuild.com/$repo/os/$arch
    2: https://arch.mirror.constant.com/$repo/os/$arch
    3: https://us.arch.niranjan.co/$repo/os/$arch
    4: https://arlm.tyzoid.com/$repo/os/$arch
    5: https://mirrors.rit.edu/archlinux/$repo/os/$arch
    6: https://us.mirrors.cicku.me/archlinux/$repo/os/$arch
    7: https://mirror.theash.xyz/arch/$repo/os/$arch
    8: https://arch.mirror.k0.ae/$repo/os/$arch
    9: https://mirrors.sonic.net/archlinux/$repo/os/$arch
    10: https://mirror.arizona.edu/archlinux/$repo/os/$arch
    11: https://mirrors.lug.mtu.edu/archlinux/$repo/os/$arch
    12: https://mirrors.vectair.net/archlinux/$repo/os/$arch
    13: https://archlinux.doridian.net/$repo/os/$arch
    14: https://dfw.mirror.rackspace.com/archlinux/$repo/os/$arch
    15: https://iad.mirror.rackspace.com/archlinux/$repo/os/$arch
    16: https://ord.mirror.rackspace.com/archlinux/$repo/os/$arch
    17: https://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch
    18: https://codingflyboy.mm.fcix.net/archlinux/$repo/os/$arch
    19: https://coresite.mm.fcix.net/archlinux/$repo/os/$arch
    20: https://forksystems.mm.fcix.net/archlinux/$repo/os/$arch
Info:
  Memory: total: 8 GiB available: 7.66 GiB used: 2.95 GiB (38.5%)
  Processes: 191 Power: uptime: 1h 55m states: freeze,standby,mem,disk
    suspend: deep wakeups: 0 hibernate: platform Init: systemd v: 257
    default: graphical
  Compilers: gcc: 15.1.1 Shell: Bash v: 5.2.37 running-in: sakura
    inxi: 3.3.38

Might be because one or more of the other systems do not have
lsb-release installed?

If its not related simply to the speed of the disk..
(Which is not particulalry fast itself - a 5400 RPM spinning disk.)

Then it may be related to this.

Or both.

The tool has to traverse multiple partitions across almost a whole terabyte worth of a slow spinning disk. It can be expected to be less than speedy.

Maybe this also could happen if a os installed on another drive then where GRUB is present and uses its own ESP located on the other drive, could take some time to find the other ESP I guess.
That is what I have noticed while both are nvme drives.

To add some more info to the issue. The distros iinstalled are:
EndeavourOS
RebornOS
ArchBang
Aritx
PCLinuxOS
EndeavourOS and PCLinuxOS are the only two distros that take a long time running os-prober. The others pretty much jump right up there and get it done. I have to check on the lsb-release thing. Also grub is installed at: /dev/sda.

Just my 2 cents:
Have had heavy problems with grub and >1 Linux on the same machine in the past (like yours).
Some weeks ago I switched to rEFInd (https://www.rodsbooks.com/refind/) and I am very happy…
No need for grub or something else, works like a charm. You may test it beforehand using a USBstick for boot.
But you should read the instructions and hints there!
Good luck!