Bug 1110960 - EFI: linux-boot-prober doesn't parse bootloader configuration files in EFI partition, cause missing entries for some OSes including Fedora
Summary: EFI: linux-boot-prober doesn't parse bootloader configuration files in EFI pa...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: os-prober
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Hedayat Vatankhah
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-18 22:01 UTC by Chris Murphy
Modified: 2016-07-19 11:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 11:49:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
chrooted grub2-mkconfig (10.33 KB, text/plain)
2014-06-18 22:03 UTC, Chris Murphy
no flags Details
nonchrooted grub2-mkconfig (11.21 KB, text/plain)
2014-06-18 22:04 UTC, Chris Murphy
no flags Details
probers.txt (12.81 KB, text/plain)
2014-11-11 23:14 UTC, Chris Murphy
no flags Details
Contents of /var/log/messages from running os-prober. (31.17 KB, text/plain)
2014-12-17 18:37 UTC, Gene Snider
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1108296 0 unspecified CLOSED 30_os-prober generates incorrect menuentry definitions 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1108344 0 unspecified CLOSED os-prober cannot handle linux16/initrd16 as produced by gtub2-2.02 2021-02-22 00:41:40 UTC

Internal Links: 1108296 1108344

Description Chris Murphy 2014-06-18 22:01:33 UTC
Description of problem:Fedora 20 Btrfs default installation leaving free space; followed by Fedora Rawhide Btrfs custom+preset installation into free space. The Fedora 20 installation isn't bootable because of a missing GRUB entry.


Version-Release number of selected component (if applicable):
grub2-2.02-0.3.fc21.x86_64
anaconda-21.37-1.fc21.x86_64
python-blivet-0.53-1.fc21.noarch
grubby-8.35-1.fc21.x86_64
os-prober-1.58-6.fc21.x86_64

How reproducible:
Always when in chroot.


Steps to Reproduce:
1. Install F20, Btrfs auto part.
2. Install F21, Btrfs preset in custom part.

Actual results:
Fedora 20 boot option is not in the new grub.cfg after Fedora 21 installs.

Expected results:
Fedora 20 boot option should be present.


Additional info:
When I'm in the live environment, but not in a chroot:

# os-prober
/dev/sda4:Fedora release 20 (Heisenbug):Fedora:linux:btrfs:UUID=406c9e8d-131a-4f03-8cad-82513c612010:subvol=root
/dev/sda7:Fedora release 21 (Rawhide):Fedora1:linux:btrfs:UUID=a28cdf47-e4c0-47da-8707-91fb80b07cda:subvol=root00

When I chroot to the new system, which is what anaconda does before it runs grub2-mkconfig:

# os-prober
/dev/sda4:Fedora release 20 (Heisenbug):Fedora:linux:btrfs:UUID=406c9e8d-131a-4f03-8cad-82513c612010:subvol=root

Yet it creates only Fedora 21 boot entries. So maybe this is a grub2 bug and not an os-prober bug. Not sure.

Comment 1 Chris Murphy 2014-06-18 22:03:09 UTC
Created attachment 910175 [details]
chrooted grub2-mkconfig

This is "bash -x grub2-mkconfig" while in the Live install environment, having done "chroot /mnt/sysimage".

Comment 2 Chris Murphy 2014-06-18 22:04:52 UTC
Created attachment 910176 [details]
nonchrooted grub2-mkconfig

This is in the live environment, non-chrooted, bash -x grub2-mkconfig.

Comment 3 Chris Murphy 2014-06-18 22:18:22 UTC
Followup on comment 2, again not-chrooted, just in the live environment:

# grub2-mkconfig -o /mnt/sysimage/boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.15.0-0.rc6.git0.1.fc21.x86_64
Found linux image: /boot/vmlinuz-0-rescue-b8fc60e86883efd7d2a2e0719230d6f4
Found Fedora release 20 (Heisenbug) on /dev/sda4
Found Fedora release 21 (Rawhide) on /dev/sda7
done

This grub.cfg doesn't contain a Fedora 20 boot entry.


In the chrooted environment this becomes:
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.15.0-0.rc6.git0.1.fc21.x86_64
Found initrd image: /boot/initramfs-3.15.0-0.rc6.git0.1.fc21.x86_64.img
Warning: Please don't use old title `Fedora, with Linux 3.15.0-0.rc6.git0.1.fc21.x86_64' for GRUB_DEFAULT, use `Advanced options for Fedora>Fedora, with Linux 3.15.0-0.rc6.git0.1.fc21.x86_64' (for versions before 2.00) or `gnulinux-advanced-a28cdf47-e4c0-47da-8707-91fb80b07cda>gnulinux-3.15.0-0.rc6.git0.1.fc21.x86_64-advanced-a28cdf47-e4c0-47da-8707-91fb80b07cda' (for 2.00 or later)
Found linux image: /boot/vmlinuz-0-rescue-cb4f7e69a85d4e2487e03ad838b76403
Found initrd image: /boot/initramfs-0-rescue-cb4f7e69a85d4e2487e03ad838b76403.img
Found Fedora release 20 (Heisenbug) on /dev/sda4
done


This grub.cfg also doesn't contain a Fedora 20 boot entry.

So in both cases os-prober is aware of the Fedora 20 installation at some level, but either grub2-mkconfig is confused or os-prober isn't handing off enough information for grub2-mkconfig to create proper entries.

Comment 4 Chris Murphy 2014-06-18 22:59:47 UTC
I get completely different results on BIOS. I'll attach the resulting grub.cfg that comes from Rawhide, which contains a pretty ugly grub.cfg but I can at least boot Fedora 20 as well as Rawhide. Obviously if I boot Fedora 20 and upgrade the kernel, grubby won't update the correct grub.cfg, so I will perpetually be booting the wrong kernel on the prior Fedora...

We need to stop this nonsense where grub2-mkconfig creates entirely new menu entries for old systems; and instead use configfile to point to the old one, which will be updated.

Comment 5 Adam Williamson 2014-11-07 18:39:54 UTC
I believe this is likely a dupe of https://bugzilla.redhat.com/show_bug.cgi?id=964828 , right?

Comment 6 Chris Murphy 2014-11-09 23:39:04 UTC
*sigh* no. Bug 964828 is due to linux/initrd commands in Fedora's GRUB, its grub2-mkconfig uses the correct extended command names for Fedora-current but not previous Linux. This bug is about os-prober getting confused, and not reporting the previous Fedora installation therefore entries aren't made for it; I don't know the nature of this confusion but if anything it's a duplicate of bug 825236.

Comment 7 Hedayat Vatankhah 2014-11-10 09:02:21 UTC
Chris,
1. sorry, for some reason, I've not noticed this bug sooner
2. As far as I can see, as you also have noted in previous comments, os-prober is seeing and reporting F20 installation. However, we should see what linux-boot-prober prints. Please try this:
linux-boot-prober btrfs UUID=406c9e8d-131a-4f03-8cad-82513c612010 subvol=root

Comment 8 Hedayat Vatankhah 2014-11-10 09:04:08 UTC
It'd be also nice if you give the output of os-prober and linux-boot-prober when running in BIOS mode.

Comment 9 Adam Williamson 2014-11-10 19:50:59 UTC
Chris: I don't think your read of the situation is right. The actual *symptoms* you describe are exactly what happened with UEFI installs with os-prober < 1.58-11 , because os-prober < 1.58-11 would disregard entries in the grub config which used the 'linuxefi' directive, as all UEFI native installs do. Thus when parsing, the installation was found, but no bootloader entries for it were found - exactly the symptom you describe, in the correct time frame.

Can you please just re-test an affected config with Final TC1 or something else that has os-prober 1.58-11 (and without using LVM, due to https://bugzilla.redhat.com/show_bug.cgi?id=825236 ?)

Thanks.

Comment 10 Chris Murphy 2014-11-11 21:23:56 UTC
vbox VM, UEFI enabled, new 80GB VDI
1. Install Fedora-20-x86_64-netinst.iso, ext4 /boot, btrfs / and /home taking up 50% of the disk, no swap.
2. Confirm that it boots post install.
3. Boot and install Fedora-Server-netinst-x86_64-21_TC1.iso, reuse ESP at /boot/efi, new ext4 /boot, new Btrfs volume
for / and /home, no swap.
4. Reboot

Actual
No Fedora 20 boot menu entry

Expected
Fedora 20 and 21 boot menu entries


When booted in Fedora 21:
# os-prober
/dev/sda3:Fedora release 20 (Heisenbug):Fedora:linux:btrfs:UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15:subvol=root
# linux-boot-prober btrfs UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 subvol=root
<no results>
## using UUID for F21 btrfs volume from blkid
# linux-boot-prober btrfs UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 subvol=root
<no results>

# grub2-mkconfig -o grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.17.2-300.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.2-300.fc21.x86_64.img
Warning: Please don't use old title `Fedora, with Linux 3.17.2-300.fc21.x86_64' for GRUB_DEFAULT, use `Advanced options for Fedora>Fedora, with Linux 3.17.2-300.fc21.x86_64' (for versions before 2.00) or `gnulinux-advanced-69b068e7-fbf6-481c-a821-2b4feca5b997>gnulinux-3.17.2-300.fc21.x86_64-advanced-69b068e7-fbf6-481c-a821-2b4feca5b997' (for 2.00 or later)
Found linux image: /boot/vmlinuz-0-rescue-6828bca26a8f44f286cf253261ab6edd
Found initrd image: /boot/initramfs-0-rescue-6828bca26a8f44f286cf253261ab6edd.img
Found Fedora release 20 (Heisenbug) on /dev/sda3
done

So it clearly sees Fedora 20 on /dev/sda3, but doesn't create entries for it. In the grub.cfg produced at installation time, as well as from grub2-mkconfig after booting in Fedora 21:
### BEGIN /etc/grub.d/30_os-prober ###

### END /etc/grub.d/30_os-prober ###

Comment 11 Chris Murphy 2014-11-11 22:13:24 UTC
vbox VM, UEFI enabled, new 80GB VDI
1. Boot and install from Fedora-20-x86_64-DVD.iso, ESP at /boot/efi and single ext4 / and no swap; leaving 40GB free space for F21.
2. Reboot, confirm it boots.
3. Boot and install from Fedora-Live-Workstation-x86_64-21-TC1.iso, reuse ESP at /boot/efi, and new single ext4 / in remaining free space, and no swap.
4. Reboot

Actual results: I have four GRUB menu entries, including F21 and F20. However, the title doesn't convey what kernel will be booted, by default the F20 option boots the F20 rescue kernel which by the time a user would actually use this, won't have its kernel modules anymore so it'll drop the user to a dracut prompt. They have to go to the Advanced options, which contains two identically named F20 boot entries, one of which is for the current kernel. Very ugly but at least provides the possibility of booting with existing entries.

The Btrfs outcome simply doesn't work, there's no F20 entry.

Expected results: Fedora 20 and 21 should be menu entries.


Regression: Still need to test it on BIOS to see if this is a Btrfs + UEFI problem.

Comment 12 Chris Murphy 2014-11-11 22:54:26 UTC
vbox VM, BIOS, new 80GB VDI
1. Boot and install from Fedora-20-x86_64-DVD.iso, ext4 /boot and btrfs / and no swap; leaving 40GB free space for F21.
2. Reboot, confirm it boots.
3. Boot and install from Fedora-Live-Workstation-x86_64-21-TC1.iso, new ext4 /boot and new btrfs / and no swap.
4. Reboot

Actual results: I have Fedora 20 and 21 boot entries in the GRUB menu; just like for UEFI + ext4. So this bug is as described, it only happens on EFI + Btrfs.


Rebooted in Fedora 21 (again this whole comment is a BIOS VM)

# os-prober
/dev/sda2:Fedora release 20 (Heisenbug):Fedora:linux:btrfs:UUID=7ca2ad17-9324-46f5-bef0-48ba17775dcd:subvol=root

# linux-boot-prober btrfs UUID=7ca2ad17-9324-46f5-bef0-48ba17775dcd subvol=root
/dev/sda2:/dev/sda1:Fedora, with Linux 3.11.10-301.fc20.x86_64:/boot/vmlinuz-3.11.10-301.fc20.x86_64:/boot/initramfs-3.11.10-301.fc20.x86_64.img:root=UUID=7ca2ad17-9324-46f5-bef0-48ba17775dcd ro rootflags=subvol=root vconsole.font=latarcyrheb-sun16 rhgb quiet LANG=en_US.UTF-8
/dev/sda2:/dev/sda1:Fedora, with Linux 0-rescue-0fe0405c74aa4a7593adcb30bc6ae172:/boot/vmlinuz-0-rescue-0fe0405c74aa4a7593adcb30bc6ae172:/boot/initramfs-0-rescue-0fe0405c74aa4a7593adcb30bc6ae172.img:root=UUID=7ca2ad17-9324-46f5-bef0-48ba17775dcd ro rootflags=subvol=root vconsole.font=latarcyrheb-sun16 rhgb quiet

Comment 13 Hedayat Vatankhah 2014-11-11 23:06:40 UTC
Thank you for the detailed experiments. Could you please add the linux-boot-prober output in system logs (or maybe running it with 'set +x' added on top of it) in UEFI+Btrfs case?

Comment 14 Chris Murphy 2014-11-11 23:14:54 UTC
Created attachment 956471 [details]
probers.txt

UEFI+Btrfs
The attached file contains everything after this sequence:

# os-prober
/dev/sda3:Fedora release 20 (Heisenbug):Fedora:linux:btrfs:UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15:subvol=root
[root@localhost ~]# linux-boot-prober UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 subvol=root


Used journalctl -b -o short-monotonic -l

Comment 15 Chris Murphy 2014-11-11 23:16:53 UTC
From journal
[   90.189953] localhost.localdomain root[1361]: 50mounted-tests: debug: UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 type not recognised; skipping

From blkid
/dev/sda3: LABEL="f20" UUID="c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15" UUID_SUB="db7ca714-e129-4800-8cb8-81588fcf963c" TYPE="btrfs" PARTUUID="c12438bb-e1bc-4761-80c3-18ca22404b38"

So its not understanding this UUID is Btrfs?

Comment 16 Hedayat Vatankhah 2014-11-17 19:56:11 UTC
(Oops, just noticed this right now) In comment #14 you wrote:
# linux-boot-prober UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 subvol=root

while it should be:
# linux-boot-prober btrfs UUID=c1b5a2e3-3c70-4db0-8b76-907fe4c7aa15 subvol=root

Was it a typo or it was what you actually run?

Comment 17 Gene Snider 2014-12-16 22:02:20 UTC
I have two btrfs partitions with root and home subvolumes on my internal hard drive.  I also have root and home on ext4 partions on an external hard drive.  All three installations have their own ext4 boot partion.  The internal drive gpt and the external drive is mbr.

Fedora 21 installation 1:

/dev/sda6 ext4 boot partition
/dev/sda7 swap
/dev/sda8 btrfs root/home volume

Fedora 21 installation 2:

/dev/sda9 ext4 boot partition
/dev/sda10 btrfs root/home volume

Fedora 19 installation:

/dev/sdb3 boot partition
/dev/sdb4 extended partition
/dev/sdb5 ext4 root partition
/dev/sdb6 ext4 home partition


Running grub2-mkconfig in F21 installation 1 gives:

$ sudo grub2-mkconfig -o /tmp/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.17.6-300.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.6-300.fc21.x86_64.img
Warning: Please don't use old title `Fedora, with Linux 3.17.6-300.fc21.x86_64' for GRUB_DEFAULT, use `Advanced options for Fedora>Fedora, with Linux 3.17.6-300.fc21.x86_64' (for versions before 2.00) or `gnulinux-advanced-9306cf92-16a8-4987-9ec2-47b753bd5f9b>gnulinux-3.17.6-300.fc21.x86_64-advanced-9306cf92-16a8-4987-9ec2-47b753bd5f9b' (for 2.00 or later)
Found linux image: /boot/vmlinuz-3.17.4-302.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.4-302.fc21.x86_64.img
Found linux image: /boot/vmlinuz-3.17.4-301.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.4-301.fc21.x86_64.img
Found linux image: /boot/vmlinuz-3.17.4-300.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.4-300.fc21.x86_64.img
Found linux image: /boot/vmlinuz-3.17.3-300.fc21.x86_64
Found initrd image: /boot/initramfs-3.17.3-300.fc21.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-3fa2d5b487f54eb4af9546d26bbf3c33
Found initrd image: /boot/initramfs-0-rescue-3fa2d5b487f54eb4af9546d26bbf3c33.img
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Fedora release 21 (Twenty One) on /dev/sda10
Found Fedora release 19 (Schrödinger’s Cat) on /dev/sdb5
done

As you can see, all the Fedora and windows were found, but NO entries are in grub.cfg for Fedora release 21 (Twenty One) on /dev/sda10.  However, the entries for Windows and the Fedora 19 installation are in grub.cfg.

If I chroot into the second F21 installation and run grub2-mkconfig, the grub.cfg file contains entries for all the systems, EXCEPT for the first F21 installation.  Apparently, grub2-mkconfig doesn't handle inactive btrfs installations correctly, even if they are correctly mounted under /mnt.

Gene

Comment 18 Chris Murphy 2014-12-16 22:24:05 UTC
From either Fedora 21:

$ blkid   ## to get the UUIDs for both Btrfs volumes

$ linux-boot-prober btrfs UUID=<uuidbtrfsvol1> subvol=root
$ linux-boot-prober btrfs UUID=<uuidbtrfsvol2> subvol=root

Post results for all three, and also specify which uuid is the volume for the currently booted system.

[Also, it is not (normally) necessary to mount unencrypted volumes of other systems for them to be found by grub-mkconfig.]

Comment 19 Gene Snider 2014-12-17 01:51:46 UTC
$ sudo blkid -s UUID /dev/sda8
/dev/sda8: UUID="9306cf92-16a8-4987-9ec2-47b753bd5f9b"

$ sudo blkid -s UUID /dev/sda10
/dev/sda10: UUID="05af56e5-d68f-4413-aa55-b06920c10a56"

$ sudo linux-boot-prober btrfs UUID=9306cf92-16a8-4987-9ec2-47b753bd5f9b subvol=root

No output was generated.  $?=0

$ sudo linux-boot-prober btrfs UUID=05af56e5-d68f-4413-aa55-b06920c10a56 subvol=root

Same result, no output and $?=0.

Comment 20 Gene Snider 2014-12-17 01:52:57 UTC
Sorry for two posts, but /dev/sda8: UUID="9306cf92-16a8-4987-9ec2-47b753bd5f9b" is the currently booted system.

Gene

Comment 21 Gene Czarcinski 2014-12-17 11:52:04 UTC
Suggestion:  run sudo os-prober

and paste the output here.  You might also want to extract all of the messages running os-prober puts in the log (var/log/message or journalctl) and attach them here.

Comment 22 Gene Snider 2014-12-17 18:37:07 UTC
Created attachment 970284 [details]
Contents of /var/log/messages from running os-prober.

Comment 23 Gene Snider 2014-12-17 18:38:48 UTC
$ sudo os-prober
/dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
/dev/sda10:Fedora release 21 (Twenty One):Fedora:linux:btrfs:UUID=05af56e5-d68f-4413-aa55-b06920c10a56:subvol=root00
/dev/sdb5:Fedora release 19 (Schrödinger’s Cat):Fedora1:linux

Here's the output of os-prober.  I was running the installation on /dev/sda8, so it looks like os-prober found the other btrfs installation.

Gene

Comment 24 Gene Snider 2014-12-17 19:10:17 UTC
Perhaps I should have opened a bug against grub2, instead of adding to this bug.  I see now that this bug is against os-prober.

Geen

Comment 25 Jaroslav Reznik 2015-03-03 17:02:22 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 26 Tore Anderson 2015-08-20 19:09:40 UTC
This bug is also present in Fedora 23 Alpha. I have an UEFI machine with Fedora 22 installed to btrfs, and installed Fedora 23 Alpha in an available partition. grub2-mkconfig spits out that if found Fedora 22 on /dev/sda4, but produces no menuentries. The reason is that the os-prober command returns an empty string (successfully). This is taken from the Fedora 22 installation, but I got exactly the same result in Fedora 23 Alpha:

[root@envy ~]# grep ' / ' /proc/mounts 
/dev/sda4 / btrfs rw,relatime,ssd,space_cache 0 0
[root@envy ~]# btrfs subvolume list /
ID 256 gen 1813585 top level 5 path home
ID 258 gen 1813584 top level 5 path root
ID 363 gen 1813506 top level 258 path var/lib/machines
[root@envy ~]# blkid /dev/sda4 
/dev/sda4: LABEL="fedora_envy" UUID="8cdf3553-0726-4db5-848a-99660d76290b" UUID_SUB="e4c4c953-6a12-412d-9d2d-2dd169b9e534" TYPE="btrfs" PARTLABEL="Microsoft basic data" PARTUUID="98a79e41-9477-4876-a647-b2459cf0a041"
[root@envy ~]# linux-boot-prober btrfs UUID=8cdf3553-0726-4db5-848a-99660d76290b subvol=root
[root@envy ~]# echo $?
0

Tore

Comment 27 Hedayat Vatankhah 2015-11-13 19:49:52 UTC
Hi,
Unfortunately (if I don't miss something), system logs when running linux-boot-prober is not provided. Logs in comment #14 was wrong because of wrong linux-boot-prober command as I told in comment #16. 

Chire or Tore, please provide system logs when running correct linux-boot-prober command.

Comment 28 Tore Anderson 2015-11-19 19:09:33 UTC
Here's the requested info:

[root@foo ~]# grub2-mkconfig -o grub.conf
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.2.3-300.fc23.x86_64
Found initrd image: /boot/initramfs-4.2.3-300.fc23.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-e583a93e269e41058bc681c5cb10aa30
Found initrd image: /boot/initramfs-0-rescue-e583a93e269e41058bc681c5cb10aa30.img
Found Fedora release 23 (Twenty Three) on /dev/sda4
done

(However, no entry for the Fedora installation on /dev/sda4 is present in the generated grub.conf.)

[root@foo ~]# blkid /dev/sda4
/dev/sda4: LABEL="fedora_envy" UUID="8cdf3553-0726-4db5-848a-99660d76290b" UUID_SUB="e4c4c953-6a12-412d-9d2d-2dd169b9e534" TYPE="btrfs" PARTLABEL="Microsoft basic data" PARTUUID="98a79e41-9477-4876-a647-b2459cf0a041"

[root@foo ~]# linux-boot-prober btrfs UUID=8cdf3553-0726-4db5-848a-99660d76290b subvol=root

Messages that appear in the system journal while running the above command:

Nov 19 19:47:49 foo tore[8613]: linux-boot-prober: debug: btrfs: partition=/dev/sda4, UUID=8cdf3553-0726-4db5-848a-99660d76290b, subvol=root
Nov 19 19:47:49 foo kernel: BTRFS info (device sda4): disk space caching is enabled
Nov 19 19:47:49 foo kernel: BTRFS: detected SSD devices, enabling SSD mode
Nov 19 19:47:49 foo tore[8613]: linux-boot-prober: debug: mounted btrfs /dev/sda4, subvol=root on /var/lib/os-prober/mount
Nov 19 19:47:49 foo tore[8613]: linux-boot-prober: debug: mapped UUID=091e888f-3c54-4437-af5f-5f9c5d375629 to /dev/sda2
Nov 19 19:47:49 foo tore[8613]: linux-boot-prober: debug: found boot partition /dev/sda2 for linux system on /dev/sda4
Nov 19 19:47:49 foo kernel: EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
Nov 19 19:47:49 foo tore[8613]: linux-boot-prober: debug: running /usr/libexec/linux-boot-probes/mounted/40grub2 /dev/sda4 /dev/sda2 /var/lib/os-prober/mount btrfs root

[root@foo ~]# rpm -qa os-prober
os-prober-1.65-3.fc23.x86_64

Let me know if more information is needed.

Tore

Comment 29 Hedayat Vatankhah 2015-11-19 21:19:05 UTC
Thank you for the provided info. I think I'm getting close to the problem, but something interesting is that it seems to be completely unrelated to btrfs, and should happen on non-btrfs EFI installs too. Anyway, please give me the output of following commands (where /sda2mnt is where /dev/sda2 is mounted):

ls /sda2mnt/boot/ /sda2mnt/boot/grub2/
ls /boot/efi/ /boot/efi/EFI/BOOT/grub.cfg

Also, please try this: copy F23 grub.cfg into /sda2mnt/boot/grub2/grub.cfg, unmount /sda2mnt and then try running linux-boot-prober again. See if it changes linux-boot-prober behavior.

Comment 30 Tore Anderson 2015-11-20 14:42:50 UTC
Hello again, here is the requested output:

[root@foo ~]# mkdir /sda2mnt
[root@foo ~]# mount /dev/sda2 /sda2mnt
[root@foo ~]# ls /sda2mnt/boot/ /sda2mnt/boot/grub2/
ls: cannot access /sda2mnt/boot/: No such file or directory
ls: cannot access /sda2mnt/boot/grub2/: No such file or directory
[root@foo ~]# ls /sda2mnt/ /sda2mnt/grub2/ # I assume this is what you meant
/sda2mnt/:
config-4.2.6-300.fc23.x86_64  grub2                                                    lost+found                                         vmlinuz-4.2.6-300.fc23.x86_64
efi                           initramfs-0-rescue-45f895c6f21749b381e3c74c5e097b03.img  memtest86+-5.01
elf-memtest86+-5.01           initramfs-4.2.6-300.fc23.x86_64.img                      System.map-4.2.6-300.fc23.x86_64
extlinux                      initrd-plymouth.img                                      vmlinuz-0-rescue-45f895c6f21749b381e3c74c5e097b03

/sda2mnt/grub2/:
fonts  grubenv  grubenv.new  i386-pc  locale  themes
[root@foo ~]# ls /boot/efi/ /boot/efi/EFI/BOOT/grub.cfg
ls: cannot access /boot/efi/EFI/BOOT/grub.cfg: No such file or directory
/boot/efi/:
EFI  mach_kernel  System
[root@foo ~]# ls /boot/efi/EFI/fedora/grub.cfg # I assume this is what you meant
/boot/efi/EFI/fedora/grub.cfg
[root@foo ~]# cp /etc/grub2
grub2.cfg      grub2-efi.cfg  
[root@foo ~]# cp /etc/grub2-efi.cfg /sda2mnt/boot/grub2/grub.cfg
cp: cannot create regular file ‘/sda2mnt/boot/grub2/grub.cfg’: No such file or directory
[root@foo ~]# cp /etc/grub2-efi.cfg /sda2mnt/grub2/grub.cfg # I assume this is what you meant
[root@foo ~]# umount /sda2mnt 
[root@foo ~]# linux-boot-prober btrfs UUID=8cdf3553-0726-4db5-848a-99660d76290b subvol=root
/dev/sda4:/dev/sda2:Fedora (4.2.6-300.fc23.x86_64) 23 (Twenty Three):/boot/vmlinuz-4.2.6-300.fc23.x86_64:/boot/initramfs-4.2.6-300.fc23.x86_64.img:root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16
/dev/sda4:/dev/sda2:Fedora (0-rescue-45f895c6f21749b381e3c74c5e097b03) 23 (Twenty Three):/boot/vmlinuz-0-rescue-45f895c6f21749b381e3c74c5e097b03:/boot/initramfs-0-rescue-45f895c6f21749b381e3c74c5e097b03.img:root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16

System journal when running linux-boot-prober command:

Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: btrfs: partition=/dev/sda4, UUID=8cdf3553-0726-4db5-848a-99660d76290b, subvol=root
Nov 20 15:34:31 foo kernel: BTRFS info (device sda4): disk space caching is enabled
Nov 20 15:34:31 foo kernel: BTRFS: detected SSD devices, enabling SSD mode
Nov 20 15:34:31 foo kernel: BTRFS: checking UUID tree
Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: mounted btrfs /dev/sda4, subvol=root on /var/lib/os-prober/mount
Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: mapped UUID=091e888f-3c54-4437-af5f-5f9c5d375629 to /dev/sda2
Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: found boot partition /dev/sda2 for linux system on /dev/sda4
Nov 20 15:34:31 foo kernel: EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: running /usr/libexec/linux-boot-probes/mounted/40grub2 /dev/sda4 /dev/sda2 /var/lib/os-prober/mount btrfs root
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing grub.cfg
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: #
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # DO NOT EDIT THIS FILE
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: #
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # It is automatically generated by grub2-mkconfig using templates
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # from /etc/grub.d and settings from /etc/default/grub
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: #
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/00_header ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set pager=1
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ -s $prefix/grubenv ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: load_env
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ "${next_entry}" ] ; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set default="${next_entry}"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set next_entry=
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: save_env next_entry
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set boot_once=true
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set default="${saved_entry}"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x"${feature_menuentry_id}" = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry_id_option="--id"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry_id_option=""
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: export menuentry_id_option
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ "${prev_saved_entry}" ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set saved_entry="${prev_saved_entry}"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: save_env saved_entry
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set prev_saved_entry=
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: save_env prev_saved_entry
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set boot_once=true
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: function savedefault {
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ -z "${boot_once}" ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: saved_entry="${chosen}"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: save_env saved_entry
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: function load_video {
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_all_video_module = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod all_video
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod efi_gop
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod efi_uga
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ieee1275_fb
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod vbe
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod vga
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod video_bochs
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod video_cirrus
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: terminal_output console
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_timeout_style = xy ] ; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set timeout_style=menu
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set timeout=5
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # Fallback normal timeout code in case the timeout_style feature is
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # unavailable.
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set timeout=5
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/00_header ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/01_users ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ -f ${prefix}/user.cfg ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: source ${prefix}/user.cfg
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ -n ${GRUB2_PASSWORD} ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set superusers="root"
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: export superusers
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: password_pbkdf2 root ${GRUB2_PASSWORD}
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/01_users ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/10_linux ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry 'Fedora (4.2.6-300.fc23.x86_64) 23 (Twenty Three)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.2.6-300.fc23.x86_64-advanced-8cdf3553-0726-4db5-848a-99660d76290b' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: load_video
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set gfxpayload=keep
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod gzio
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod part_gpt
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ext2
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set root='hd0,gpt2'
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_platform_search_hint = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  091e888f-3c54-4437-af5f-5f9c5d375629
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root 091e888f-3c54-4437-af5f-5f9c5d375629
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: linuxefi /vmlinuz-4.2.6-300.fc23.x86_64 root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: initrdefi /initramfs-4.2.6-300.fc23.x86_64.img
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: result: /dev/sda4:/dev/sda2:Fedora (4.2.6-300.fc23.x86_64) 23 (Twenty Three):/boot/vmlinuz-4.2.6-300.fc23.x86_64:/boot/initramfs-4.2.6-300.fc23.x86_64.img:root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry 'Fedora (0-rescue-45f895c6f21749b381e3c74c5e097b03) 23 (Twenty Three)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-45f895c6f21749b381e3c74c5e097b03-advanced-8cdf3553-0726-4db5-848a-99660d76290b' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: load_video
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod gzio
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod part_gpt
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ext2
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set root='hd0,gpt2'
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_platform_search_hint = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  091e888f-3c54-4437-af5f-5f9c5d375629
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root 091e888f-3c54-4437-af5f-5f9c5d375629
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: linuxefi /vmlinuz-0-rescue-45f895c6f21749b381e3c74c5e097b03 root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: initrdefi /initramfs-0-rescue-45f895c6f21749b381e3c74c5e097b03.img
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: result: /dev/sda4:/dev/sda2:Fedora (0-rescue-45f895c6f21749b381e3c74c5e097b03) 23 (Twenty Three):/boot/vmlinuz-0-rescue-45f895c6f21749b381e3c74c5e097b03:/boot/initramfs-0-rescue-45f895c6f21749b381e3c74c5e097b03.img:root=UUID=8cdf3553-0726-4db5-848a-99660d76290b ro rootflags=subvol=root rd.debug vconsole.font=latarcyrheb-sun16
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/10_linux ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/20_linux_xen ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/20_linux_xen ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/20_ppc_terminfo ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/20_ppc_terminfo ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/30_os-prober ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry 'Fedora release 23 (Twenty Three) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-2daaf50b-b736-476d-ad53-f2ba477e7b5c' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: Skipping entry 'Fedora release 23 (Twenty Three) (on /dev/sda5)':
Nov 20 15:34:31 foo tore[3227]: 40grub2: appears to be an automatic reference taken from another menu.lst
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod part_gpt
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ext2
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set root='hd0,gpt5'
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_platform_search_hint = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root 2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: linux /boot/vmlinuz-0-rescue-e583a93e269e41058bc681c5cb10aa30 root=/dev/sda5
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: initrd /boot/initramfs-0-rescue-e583a93e269e41058bc681c5cb10aa30.img
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: submenu 'Advanced options for Fedora release 23 (Twenty Three) (on /dev/sda5)' $menuentry_id_option 'osprober-gnulinux-advanced-2daaf50b-b736-476d-ad53-f2ba477e7b5c' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry 'Fedora release 23 (Twenty Three) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-0-rescue-e583a93e269e41058bc681c5cb10aa30--2daaf50b-b736-476d-ad53-f2ba477e7b5c' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: Skipping entry 'Fedora release 23 (Twenty Three) (on /dev/sda5)':
Nov 20 15:34:31 foo tore[3227]: 40grub2: appears to be an automatic reference taken from another menu.lst
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod part_gpt
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ext2
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set root='hd0,gpt5'
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_platform_search_hint = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root 2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: linux /boot/vmlinuz-0-rescue-e583a93e269e41058bc681c5cb10aa30 root=/dev/sda5
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: initrd /boot/initramfs-0-rescue-e583a93e269e41058bc681c5cb10aa30.img
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: menuentry 'Fedora release 23 (Twenty Three) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.2.3-300.fc23.x86_64--2daaf50b-b736-476d-ad53-f2ba477e7b5c' {
Nov 20 15:34:31 foo tore[3227]: 40grub2: Skipping entry 'Fedora release 23 (Twenty Three) (on /dev/sda5)':
Nov 20 15:34:31 foo tore[3227]: 40grub2: appears to be an automatic reference taken from another menu.lst
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod part_gpt
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: insmod ext2
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: set root='hd0,gpt5'
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ x$feature_platform_search_hint = xy ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: else
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: search --no-floppy --fs-uuid --set=root 2daaf50b-b736-476d-ad53-f2ba477e7b5c
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: linux /boot/vmlinuz-4.2.3-300.fc23.x86_64 root=/dev/sda5
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: initrd /boot/initramfs-4.2.3-300.fc23.x86_64.img
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: }
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/30_os-prober ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/40_custom ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # This file provides an easy way to add custom menu entries.  Simply type the
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # menu entries you want to add after this comment.  Be careful not to change
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: # the 'exec tail' line above.
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/40_custom ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing:
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### BEGIN /etc/grub.d/41_custom ###
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: if [ -f  ${config_directory}/custom.cfg ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: source ${config_directory}/custom.cfg
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: source $prefix/custom.cfg;
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: fi
Nov 20 15:34:31 foo tore[3227]: 40grub2: debug: parsing: ### END /etc/grub.d/41_custom ###
Nov 20 15:34:31 foo tore[3227]: linux-boot-prober: debug: /usr/libexec/linux-boot-probes/mounted/40grub2 succeeded

Comment 31 Hedayat Vatankhah 2015-11-20 17:23:37 UTC
Thank you for the detailed output, and trying to figure out my intentions :) which worked quite well. 

It seems that copying grub.cfg in F23 /boot partition has fixed the problem.

So, the problem seems to be this:
1. Currently, linux-boot-prober doesn't know anything about EFI, so it doesn't parse grub configuration files in EFI partition. When it founds a Linux OS, it tries to find its /boot (using fstab entries) and look for boot loader config files in there. But it knows nothing about EFI.

2. The problem is unrelated to BTRFS

3. EFI partition is shared between multiple Fedora installations, so a single grub.cfg will remain for all of them. 

4. I don't know how we do behave currently when there is a shared /boot partition, but probably we should do the same for an EFI partition. 

5. This is actually a major feature: implementing EFI support for linux-boot-partition. Due to how upstream does (NOT) work, this feature might have been already implemented by some other distro. I'll try to search for it in os-prober bugzilla and other distro's os-prober for possible patches for it.

6. I think the solution should work more or less like this: find system EFI partition, and for each GNU/Linux partition try to guess if there are any entries for that specific distro in configuration files in EFI partition.  Doesn't seem to be straightforward!

Comment 32 Chris Murphy 2015-11-20 20:04:51 UTC
re: 3, 4, 5, 6. I agree, and some inclusion of Atomic should be accounted for. That is, whether they intend to have a way to support Fedora n and Fedora n+1, and what they think that will look like. Much of what Atomic is doing seems a lot more sane to me than the free for all boot methods so far; the reality is that expecting a tool like os-prober + grub-mkconfig to discover the intended assembly of a system is a lot more complicated than defining the layout, assembly and boot method in advance, and some user space tool (the Atomic tools that do this) that's solely responsible for maintaining grub.cfg or drop-in snippets such as what bootloaderspec proposes (which is mainly how Fedora Atomic works).

Bottom line is I don't want people, in particular developers, doing a lot of work supporting crazy things before we have the constrained best-practices way of doing things really bullet proof. All of this is very fragile right now, I think.

Comment 33 Hedayat Vatankhah 2015-11-20 20:41:37 UTC
EFI itself tries to provide a solution for this using its EFI boot menu which is managed using EFI partition. A solution for Fedora can be like this: instead of creating a single 'fedora' directory in EFI partition, create a unique directory for each installation and put its grub.cfg there. Let the user select which OS he'd like to boot using EFI boot menu!

Comment 34 Adam Williamson 2015-11-20 21:44:30 UTC
I'm pretty sure pjones specifically chose not to do that.

Comment 35 Chris Murphy 2015-11-20 23:22:23 UTC
(In reply to Hedayat Vatankhah from comment #33)
> EFI itself tries to provide a solution for this using its EFI boot menu
> which is managed using EFI partition. 

I think the UEFI consortium has sufficiently abandoned UI/UX from their mandate that reliance on the built-in boot manager is not practical. Some machines now don't even offer a boot menu at startup by default, and don't initialize USB, in favor of faster boot times. And firmware OEMs have taken great pleasure in producing radically different UIs from each other.

>A solution for Fedora can be like
> this: instead of creating a single 'fedora' directory in EFI partition,
> create a unique directory for each installation and put its grub.cfg there.

I'm not opposed, but again there might be a more elegant and consolidated solution with BLS snippets and Fedora Atomic (rpm-ostree specifically, but not limited to that).

> Let the user select which OS he'd like to boot using EFI boot menu!

I prefer giving up on this because, at a minimum, users have different hardware and therefore can't help each other navigate different firmware interfaces. I'd really like whatever bootloader we choose to be in a position to be rock solid, even coming up by default in dual-boot scenarios if/when NVRAM is blown away. But for that to be possible we also need Windows Secure Boot chainloading working, bug 1170245, and ideally also get GRUB upstream to support chainloading the Apple bootloader rather than the totally busted nonsense it currently uses, bug 1170245.

Comment 36 Hedayat Vatankhah 2015-11-21 10:24:05 UTC
I should see what Fedora Atomic is doing.

Adding the possibility to detect different grub/grub2 configuration files and include them directly is something I'd like to support in os-prober (offering the files themselves rather than parsing them), but only if I create a fork of it.

However, while it might seem wrong, parsing other configs have a small benefit: you can boot other OSes even if they are installed in BIOS mode. But yes, that's a very special case which rarely happens (a user decides to switch to EFI mode with the new Fedora installation).

Well, actually it is possible to: 1. When running in EFI mode, include other grub config files in EFI partition directly, but parse grub config files in other partitions. 2. When in BIOS mode, include other files in regular partitions but parse the ones in EFI partition.

There are no forks yet, so lets forget it for now!

Comment 37 Fedora End Of Life 2016-07-19 11:49:07 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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
bug.

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


Note You need to log in before you can comment on or make changes to this bug.