Bug 1782773

Summary: grub2-mount very very slow and uses 100% CPU core
Product: [Fedora] Fedora Reporter: Terry Barnaby <terry1>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 34CC: adam, fmartine, ghborrmann, hedayatv, ja, lkundrak, massi.ergosum, pjones, yalterz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-17 23:09:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1770599    

Description Terry Barnaby 2019-12-12 10:22:55 UTC
Description of problem:

I have been trying to install Fedora31 onto a system that has an NVMe disk and two SATA disks with multiple partitions containing multiple operating systems. The grub2-mkconfig command is taking a very long time (don't know how long haven't waited long enough I suspect > 30mins).
I have tracked this down to what looks to be a gross inefficiency in the grub2-mount FUSE driver.

If I run:
mount /dev/nvme0n1p2 /var/lib/os-prober/mount
time ls /var/lib/os-prober/mount/lib*/lib*.so* > /dev/null
real    0m0.089s
user    0m0.028s
sys     0m0.044s

If I run:

grub2-mount /dev/nvme0n1p2 /var/lib/os-prober/mount
time ls /var/lib/os-prober/mount/lib*/lib*.so* > /dev/null
real    0m59.593s
user    0m0.190s
sys     0m0.254s 

A minute of 100% of a CPU core to list a directory on a fast NVMe SSD! What about climate change folks ?

I believe this my issue in that grub2-mkconfig will take a "really" long time on my system with largely populated rootfs (It has all of the RPM packages for development that I use so is about 28 GBytes) and this system has a NVMe SSD and two SATA disks with multiple partitions and operating systems.

Comment 1 Terry Barnaby 2019-12-12 13:54:39 UTC
As a hack, if you change to use "mount" instead of "grub2-mount" then grub2-mkconfig all seems to work ok and is fast:
mv /usr/bin/grub2-mount /usr/bin/grub2-mount-orig
ln -sf mount /usr/bin/grub2-mount

Comment 2 Dr J Austin 2019-12-12 14:42:15 UTC

[root@harting:~]$ time grub2-mkconfig --no-grubenv-update -o ted_with_os-prober
Generating grub configuration file ...
Found Fedora 30 (Thirty) on /dev/nvme0n1p5
Adding boot menu entry for EFI firmware configuration

real    2m50.582s
user    0m2.156s
sys     0m1.960s
[root@harting:~]$ mv /usr/bin/grub2-mount /usr/bin/grub2-mount-orig
[root@harting:~]$ ln -sf mount /usr/bin/grub2-mount
[root@harting:~]$ time grub2-mkconfig --no-grubenv-update -o ted_with_os-prober_changed_mount
Generating grub configuration file ...
Found Fedora 30 (Thirty) on /dev/nvme0n1p5
Adding boot menu entry for EFI firmware configuration

real    0m5.041s
user    0m2.026s
sys     0m1.873s

Comment 3 Ivan Molodetskikh 2020-02-19 09:49:08 UTC
Installing F31 on my laptop and facing a similar issue, the bootloader step of Anaconda took 11 minutes according to /tmp/anaconda.log, and I had grub2-mount eating 100% of the CPU in top during this.

Comment 4 Ben Cotton 2020-11-03 17:06:46 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2020-11-24 18:22:40 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Ben Cotton 2021-02-09 16:15:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 7 Javier Martinez Canillas 2021-06-17 23:09:46 UTC
This is a bug in upstream GRUB. You will need to report the issue there.