Bug 15846 - Grub2 doesn't install the bootloader on btrfs if we have a dualboot with windows starting at sector 63
Summary: Grub2 doesn't install the bootloader on btrfs if we have a dualboot with wind...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Installer (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard: FOR_ERRATA
Keywords:
Depends on: 15374
Blocks: 416
  Show dependency treegraph
 
Reported: 2015-05-04 20:30 CEST by Thomas Spuhler
Modified: 2016-06-07 18:44 CEST (History)
3 users (show)

See Also:
Source RPM: grub2
CVE:
Status comment:


Attachments
Image of error in installer (6.45 KB, image/png)
2016-06-06 18:10 CEST, Barry Jackson
Details
message during boot that works (434.86 KB, image/png)
2016-06-06 18:15 CEST, Barry Jackson
Details
Bootloader fail screen without patch (130.33 KB, image/png)
2016-06-07 12:47 CEST, Barry Jackson
Details

Description Thomas Spuhler 2015-05-04 20:30:38 CEST
Description of problem:
If you install mga5 on btrfs partitions  on a dualboot box with an installed windows OS, the installer cannot install the Grub2 bootloader.
If you move the start of the windows partition using a Gparted-Live and leave a 2MB (maybe 1MB suffices) empty space ahead of the windows partition then it works.
There are some postings on the WEB from OpenSuse about this problem:


https://forums.opensuse.org/showthread.php/502134-GRUB2-amp-BTRFS/page2
=> https://bugzilla.opensuse.org/show_bug.cgi?id=841247#c18
=> https://bugzilla.opensuse.org/attachment.cgi?id=611757&action=diff
I am not rating this as a release blocker, should I?

Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2015-05-05 09:32:55 CEST
Just creating a small ext4 /boot would workaround this

CC: (none) => thierry.vignaud, zen25000
Blocks: (none) => 416

Thierry Vignaud 2015-05-10 08:49:46 CEST

Summary: Grub2 doesn't install the bootloader if we have a dualboot with windows starting at sector 63 => Grub2 doesn't install the bootloader on btrfs if we have a dualboot with windows starting at sector 63
Source RPM: (none) => grub2

Comment 2 Thierry Vignaud 2015-05-11 11:06:51 CEST
Thomas: I think we should revert your fix for bug #15374....

Keywords: (none) => PATCH
Depends on: (none) => 15374
Assignee: bugsquad => tmb

claire robinson 2015-05-11 13:05:31 CEST

CC: (none) => eeeemail

Comment 3 Samuel Verschelde 2015-05-13 15:55:55 CEST
Thierry, Thomas, is that something that must be done for mga5? (in other words, is it a release blocker)
Comment 4 Thomas Spuhler 2015-05-13 16:45:01 CEST
Samuel, Thierry:
If we don't do anything, we will have a lot of folks with a problem and we could be trashed by a reviewer. On the other hand, if we introduce a fix this late w/o a lot of testing by cauldron users, we could have a problem too. I would favor a prominent paragraph in the Release Notes and Errata.
I moved the start of the windows using GParted-live. It's very easy. Unfortunately, we don't provide it on our Live-DVD (there is probably no room on the Live-CD)
Samuel Verschelde 2015-05-31 21:38:34 CEST

Whiteboard: (none) => FOR_ERRATA

Comment 5 Thierry Vignaud 2016-06-06 11:48:51 CEST
Barry can you fix grub2 regarding booting from btrfs?

Keywords: PATCH => (none)
Assignee: tmb => zen25000

Comment 6 Barry Jackson 2016-06-06 12:53:10 CEST
If anyone can test this, a test grub2 build with the OpenSuSE patch from #0 is here in my repo now: grub2-2.02-0.git10457.6.2

Install by adding and enabling http://mtf.no-ip.co.uk/pub/linux/barjac/distrib/cauldron/x86_64/media/extra/release/

s/x86_64/i586/ for the i586 build.

Remove that media afterwards as there is all-sorts of test stuff in there you REALLY do not want!
Comment 7 Barry Jackson 2016-06-06 18:06:32 CEST
I happened to have a VM with Windows-8.1 (UEFI) and tried a net-install of Mga6 cauldron onto btrfs next to it.

I now know that the Windows recovery partition is sda1 and
first sector: 2048 (at 1024.0 KiB)

However, grub2 install failed.
(fail message in attachment to follow)

I closed the VM and ran the installer again with the patched grub2 in #6 available and the install completed.
Other than a cryptic message in the grub2 console at boot there were no problems and it booted into LXDE.

So it seems that the patch does something useful for btrfs even when the first sector start is not at sector 63.
Comment 8 Barry Jackson 2016-06-06 18:10:26 CEST
Created attachment 7935 [details]
Image of error in installer
Comment 9 Barry Jackson 2016-06-06 18:15:38 CEST
Created attachment 7936 [details]
message during boot that works

This message displays for a few seconds before booting completes normally.
Comment 10 Barry Jackson 2016-06-07 12:44:55 CEST
OK - success!

I installed XP in a VM which did place itself at sector 63.

I then net-installed Cauldron alongside it on btrfs root using free space above XP.

Using current Cauldron grub2 it failed installing bootloader with the error which I will attach below.

I shut down the VM and re-ran the net install to upgrade my previous install, but added my local repo with the patched grub2.

The bootloader install went without error and on re-boot the boot was successful. (Not to graphical, but that is another issue probably with VBox) 

@Thierry
Are you OK for me to push this now, or would you prefer it went to updates_testing first?
Comment 11 Barry Jackson 2016-06-07 12:47:02 CEST
Created attachment 7937 [details]
Bootloader fail screen without patch

Bootloader failure before updating to patched grub2 in installer.
Comment 12 Barry Jackson 2016-06-07 13:10:43 CEST
I saw no regression in my current ext4 system with this patched version.

It is now in svn.
Comment 13 Barry Jackson 2016-06-07 18:44:08 CEST
OK pushed to Cauldron.

Closing as fixed.

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


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