os-prober takes forever if Arch is installed on other partition

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
Ravi Joshi
Posts: 23
Joined: 2015-10-03 16:56
Has thanked: 7 times

os-prober takes forever if Arch is installed on other partition

#1 Post by Ravi Joshi »

I have a situation where os-prober when mounting an ext4 partition takes up CPU 100% and does not come out.

1) Partitions [ EFI ] [ WIn Reserved ] [Win ] [ empty ] [swap ] [arch] [ ntfs ]
2) Arch is already installed in 'sda6'
3) Arch partition is NOT mounted <- important
4) os-prober is enabled
5) fstab does not have an entry for sda6

Each time I run 'grub-mkconfig', the process grub-mount /dev/sda6' - which is arch partition - gets stuck. It happens each time.
Workaround I've found is to mount sda6 manually somewhere. In this case grub-mount identifies arch and comes out immediately.

**update** : ran os-prober standalone. Once while arch's partition is mounted, and once when it isn't. When mounted, os-prober detects and comes out immediately. When not mounted, grub-mount /dev/sda6 waits forever - taking almost 100% cpu

Any idea what might be happening? TIA

mrmazda
Posts: 502
Joined: 2023-06-02 02:22
Has thanked: 14 times
Been thanked: 63 times

Re: os-prober takes forever if Arch is installed on other partition

#2 Post by mrmazda »

Is Arch the only installed OS besides Windows and Debian? Which Debian release and os-prober version are installed?

Ravi Joshi
Posts: 23
Joined: 2015-10-03 16:56
Has thanked: 7 times

Re: os-prober takes forever if Arch is installed on other partition

#3 Post by Ravi Joshi »

mrmazda wrote: 2024-11-10 04:54 Is Arch the only installed OS besides Windows and Debian? Which Debian release and os-prober version are installed?
Yes, Win 11 and Arch are only OSes. Debian is bookworm, updated. os-prober is 1.81
This issue manifests on more than one machine.
I ran os-prober in Arch, and it detects immediately even when Debian partition is not mounted.

I have a similar thread : viewtopic.php?t=160550

User avatar
sunrat
Site admin
Site admin
Posts: 7365
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 133 times
Been thanked: 649 times

Re: os-prober takes forever if Arch is installed on other partition

#4 Post by sunrat »

Ravi Joshi wrote: 2024-11-10 08:37 I have a similar thread : viewtopic.php?t=160550
This appears to be the same issue. Can you explain why it needs a new topic? Splitting it may reduce the chance of an answer.

Are you sure Arch is on a ext4 partition? I installed Garuda, an Arch derivative, a while back and Debian GRUB didn't seem to detect it at all although I didn't wait 10 minutes. It was btrfs by default. I ended up just chainloading the UEFI stub in Debian GRUB.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

mrmazda
Posts: 502
Joined: 2023-06-02 02:22
Has thanked: 14 times
Been thanked: 63 times

Re: os-prober takes forever if Arch is installed on other partition

#5 Post by mrmazda »

Run os-prober standalone without Arch filesystem mounted, then after the timeout expires, visit the journal. If "forever" is literal, open journalctl -f first, in a separate xterm, then run os-prober while watching the journal.

Ravi Joshi
Posts: 23
Joined: 2015-10-03 16:56
Has thanked: 7 times

Re: os-prober takes forever if Arch is installed on other partition

#6 Post by Ravi Joshi »

sunrat wrote: 2024-11-10 08:59 This appears to be the same issue. Can you explain why it needs a new topic? Splitting it may reduce the chance of an answer.
That was slightly old issue, and there wasn't any 'resolution' to it, even if marked 'solved'. The new attempt, imo, had some new info
sunrat wrote: 2024-11-10 08:59 Are you sure Arch is on a ext4 partition?
Yes, it is an ext4.
mrmazda wrote: 2024-11-10 10:16 Run os-prober standalone without Arch filesystem mounted, then after the timeout expires, visit the journal. If "forever" is literal, open journalctl -f first, in a separate xterm, then run os-prober while watching the journal.
Thanks. It doesn't take 'forever' literally. In the journal extries below, Arch detection takes 3-4 minutes which imo is quite long. I can't pinpoint which part of os-prober that takes so long.

Code: Select all

 Nov 11 09:02:19 debian 50mounted-tests[4350]: debug: running subtest /usr/lib/os-probes/mounted/90linux-distro
Nov 11 09:05:41 debian 90linux-distro[4389]: result: /dev/sda6:Arch Linux:Arch:linux
Nov 11 09:05:41 debian 50mounted-tests[4390]: debug: os found by subtest /usr/lib/os-probes/mounted/90linux-distro
Nov 11 09:05:41 debian systemd[1]: var-lib-os\x2dprober-mount.mount: Deactivated successfully.
Nov 11 09:05:41 debian os-prober[4393]: debug: os detected by /usr/lib/os-probes/50mounted-tests

mrmazda
Posts: 502
Joined: 2023-06-02 02:22
Has thanked: 14 times
Been thanked: 63 times

Re: os-prober takes forever if Arch is installed on other partition

#7 Post by mrmazda »

Not a lot to go on there. Does your Arch / filesystem have any unusual features enabled? Perhaps repeat but with dmesg instead of journal.

Ravi Joshi
Posts: 23
Joined: 2015-10-03 16:56
Has thanked: 7 times

Re: os-prober takes forever if Arch is installed on other partition

#8 Post by Ravi Joshi »

Mounting the partition with 'grub-mount /dev/sda6 /var/lib/os-prober/mount' should be a rather quick operation not needed more than a few seconds. But htop shows it running for 3+ minutes, which makes me wonder if it has difficulty mounting the partition.

Arch is installed in a standard ext4 partition. Nothing unusual done to that partition. (attached is os-prober log)
Attachments
os-prober.log
(8.71 KiB) Downloaded 6 times

jmgibson1981
Posts: 343
Joined: 2015-06-07 14:38
Has thanked: 16 times
Been thanked: 49 times

Re: os-prober takes forever if Arch is installed on other partition

#9 Post by jmgibson1981 »

Run os-prober standalone without Arch filesystem mounted, then after the timeout expires, visit the journal. If "forever" is literal, open journalctl -f first, in a separate xterm, then run os-prober while watching the journal.
forgive the slight derail. this is wonderful and i am quite grateful. never figured out how to track it as it runs. Thank you again.

Ravi Joshi
Posts: 23
Joined: 2015-10-03 16:56
Has thanked: 7 times

Re: os-prober takes forever if Arch is installed on other partition

#10 Post by Ravi Joshi »

So far, my understanding of how os-prober works is that the delay occurs because of how grub-mount handles file system detection and mounting when the partition isn't already mounted. It needs to probe file system types, attempt various drivers, perform thorough checks and verification which eventually slow things down. Arch's os-prober, on the other hand may not be as strict as debian's.
I have attached strace of 'strace -f grub-mount /dev/sda6 /var/lib/os-prober/mount' if anyone understands various calls made to kernel. I don't understand those myself (yet)
Attachments
strace-os-prober.txt
(58.04 KiB) Downloaded 8 times

User avatar
pbear
Posts: 509
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 81 times

Re: os-prober takes forever if Arch is installed on other partition

#11 Post by pbear »

The simple solution is something sunrat mentioned earlier. Rather than os-prober, use a custom.cfg file to chainload-boot Arch.

Post Reply