Bug 14467 - os-prober doesn't detect btrfs install
Summary: os-prober doesn't detect btrfs install
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard: 5beta1
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2014-11-05 17:55 CET by Marja Van Waes
Modified: 2014-12-20 12:27 CET (History)
6 users (show)

See Also:
Source RPM: os-prober-1.64-3.mga5
CVE:
Status comment:


Attachments

Description Marja Van Waes 2014-11-05 17:55:40 CET
The grub2 bootloader doesn't show a cauldron install on BTRFS partitions after a fresh dual-iso install.

os-prober shows errors about btrfs:

[root@dual5beta1i586 u]# os-prober
/usr/lib/os-probes/50mounted-tests: line 80: btrfs: command not found
/usr/lib/os-probes/50mounted-tests: line 81: btrfs: command not found
/usr/lib/os-probes/50mounted-tests: line 82: btrfs: command not found
/usr/lib/os-probes/50mounted-tests: line 80: btrfs: command not found
/usr/lib/os-probes/50mounted-tests: line 81: btrfs: command not found
/usr/lib/os-probes/50mounted-tests: line 82: btrfs: command not found
/dev/sda6:Mageia 4 (4):Mageia:linux
[root@dual5beta1i586 u]# rpm -qa | grep os-prober
os-prober-1.64-3.mga5
[root@dual5beta1i586 u]#

see also
https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/1294638
(thx barjac)

so it looks like an upstream issue.

I hit it in a old fashioned non-efi install, btw.
Comment 1 Marja Van Waes 2014-11-05 17:58:56 CET
cc'ing some people because I don't know whether the combination btrfs + grub2 is used so often, that this should be fixed before beta1 release

Keywords: (none) => UPSTREAM
CC: (none) => davidwhodgins, eeeemail, ennael1, tmb, wilcal.int
Whiteboard: (none) => 5beta1

Comment 2 claire robinson 2014-11-05 18:49:24 CET
is btrfs-progs installed marja? 

I wouldn't think it likely to block beta 1 but should be release blocker imho.
Comment 3 claire robinson 2014-11-05 18:52:08 CET
Guessing os-prober is missing a require on btrfs-progs from the error msgs
Comment 4 Marja Van Waes 2014-11-05 19:11:35 CET
(In reply to claire robinson from comment #2)
> is btrfs-progs installed marja? 
> 

no, it wasn't

right after installing it, I get

[root@dual5beta1i586 u]# os-prober
/dev/sda6:Mageia 4 (4):Mageia:linux
[root@dual5beta1i586 u]# 

so the errors disappeared, but a Mageia / btrfs partition on sda5 is still not detected.
I'll reboot, in case that was needed
Comment 5 Marja Van Waes 2014-11-05 19:17:21 CET
after reboot I still get:

[root@dual5beta1i586 u]# os-prober
/dev/sda6:Mageia 4 (4):Mageia:linux
[root@dual5beta1i586 u]#
Comment 6 Barry Jackson 2014-11-06 15:25:55 CET
os-prober-1.64-4.mga5 pushed with requires on btrfs-progs

thanks Claire ;)
Comment 7 Thomas Backlund 2014-11-06 15:56:28 CET
That's not a correct fix ...

os-prober dont _need_ btrfs-progs to work.

It's an installer issue... if btrfs fs is selected, then the installer should install the tools needed as done for other fs
Comment 8 Marja Van Waes 2014-11-06 16:06:52 CET
(In reply to Thomas Backlund from comment #7)
> That's not a correct fix ...
> 
> os-prober dont _need_ btrfs-progs to work.
> 
> It's an installer issue... if btrfs fs is selected, then the installer
> should install the tools needed as done for other fs

For the sake of clarity: I did not install to a btrfs partition, but the existing btrfs install wasn't recognised by os-prober and still isn't.

Installing btrfs-progs didn't make os-prober see that btrfs install
Comment 9 Barry Jackson 2014-11-06 16:19:52 CET
(In reply to Thomas Backlund from comment #7)
> That's not a correct fix ...
> 
> os-prober dont _need_ btrfs-progs to work.
> 

It errors when trying to detect *other* os's without it - see https://bugs.mageia.org/show_bug.cgi?id=14467#c4

> It's an installer issue... if btrfs fs is selected, then the installer
> should install the tools needed as done for other fs

I agree, but if there are existing btrfs OS's and the current install is not to btrfs then os-prober will error without it.

Maybe the installer should *always* install btrfs-progs in which case it need not be 'Required' by os-prober.

@marja
> Installing btrfs-progs didn't make os-prober see that btrfs install

No but I think that's another issue, it did fix the error messages.
Comment 10 Thomas Backlund 2014-11-06 16:30:09 CET
(In reply to Barry Jackson from comment #9)

 
> I agree, but if there are existing btrfs OS's and the current install is not
> to btrfs then os-prober will error without it.


And that is a os-prober bug.

it should _never_ call out to a utility before checking if it's actually available...  blindly assuming is bad design...


> Maybe the installer should *always* install btrfs-progs in which case it
> need not be 'Required' by os-prober.


So install more bloat on systems not needing it...
Comment 11 Barry Jackson 2014-11-07 00:38:42 CET
I don't really see how checking it's there will help it to find it if it's not there.

No idea then :\

It's actually academic at present as I can not find a fix for this bug.
I have searched for and tried all the various patched versions of os-prober including Fedora's latest along with grub2 from git (which is only a few commits ahead of us) but no change.

It refuses to detect a system with a btrfs root.

I have asked upstream grub about this - no reply yet.
Comment 12 Barry Jackson 2014-11-11 22:21:04 CET
I started digging into the code and I have found it!

It seems that Debian-installer only uses btrfs sub-volumes for their installations and therefore os-prober only looks for (and into) sub-vols to detect systems.

We AFAICT don't use sub-vols by default so our installations are not found.

I have patched os-prober so it now looks at btrfs base partitions as well as sub-vols where they exist.

It works for me, with my limited testing so please test by installing:

os-prober-1.64-5.mga5 from updates_testing.

There is no need to do anything other than install it, the grub2 menu should be updated during install and on next boot you should see the btrfs installations that were previously missing from the menu.

I would be happier if someone else were to check my patch ;)
Comment 13 Barry Jackson 2014-11-11 23:54:29 CET
It's actually os-prober-1.64-6.mga5 from updates_testing now - I left a stray debugging command in the previous one.
Comment 14 Marja Van Waes 2014-11-14 16:57:26 CET
Thanks, Barry, that fixed it :-)


Btw, accidentally tested on a wrong laptop first (64bits non-efi, without btrfs partitions), but you might like to hear that i didn't see any regression there.


Closing as fixed, feel free to reopen when needed.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 15 Marja Van Waes 2014-11-15 23:25:39 CET
Reopening, because the fix is only in updates_testing now

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 16 Barry Jackson 2014-11-16 00:45:21 CET
I pushed it to core release so closing again - thanks for testing.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 17 Barry Jackson 2014-11-16 00:47:19 CET
Forgot to mention that I will send the patch upstream next week, assuming nothing breaks in the meantime.
Comment 18 Barry Jackson 2014-11-20 19:25:10 CET
Patch with comment added upstream here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688336
Comment 19 Maurice Batey 2014-12-20 12:27:09 CET
Note that the 1/2015 edition of Linux Format reports the availability of Mageia-5, and that:

"The btrfs file systyem will be used by default."

CC: (none) => maurice


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