Bug 1084815

Summary: Installation of 15.0 Beta destroys GRUB of another install.
Product: [openSUSE] openSUSE Distribution Reporter: Carlos Robinson <carlos.e.r>
Component: YaST2Assignee: Josef Reidinger <jreidinger>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P1 - Urgent CC: jreidinger
Version: Leap 15.0   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/owBkMZke
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: RESULTS.txt file, output of running bootinfoscript version 0.76, 13 April 2017
Yast logs.
Screenshot of L42.3 with default boot loader location
Screenshot of L42.3, Installation settings view, after doing correct adjustments.
Screenshot of L42.3, warning prior to install, ignored.
Screenshot of L15.0 with default installation settings (incorrect)
Screenshot of L15.0 with default boot loader location
Screenshot of L15.0 with cleared boot loader location

Description Carlos Robinson 2018-03-11 22:47:00 UTC
Created attachment 763321 [details]
RESULTS.txt file, output of running bootinfoscript version 0.76, 13 April 2017

Grub of 15.0 Beta being installed in sda9 (beta test partition) overwrote the Grub install in extended partition sda4 that belongs to the stable and production operating system of the laptop.

I did this twice for confirmation. I have dedicated about a full day to test this.

Setup is:

sda 1 & 2, Windows.
sda3 was old manufacturer rescue partition. Currently holds data partition.
sda4 is extended.
sda5 swap
sda6 stable boot
sda7 stable root
sda8 stable home
sda9 beta test

MBR has syslinux code that boots sda4 ignoring the boot mark, which should be on sda1. Something has changed it to sda4, making Windows fail to update itself. 
sda4 contains grub, that should point to code in sda6 (stable /boot). The grub menu here chainloads grub in sda9.



To verify, the second time I installed Leap 42.3 on the sda9 test partition, and verified that that the main install and secondary install had both Grub booting correctly. Took an image backup, to save time if I have to install 42.3 again to test install of 15.0 beta over it.

I took photos during the install. I verified that YaST on 42.3 gives these options (defaults marked):

[X] Boot from Root partition
[ ] Boot from master boot record
[X] Boot from extended partition
[ ] Custom boot partition

which I changed to the correct settings for this laptop:

[X] Boot from Root partition
[ ] Boot from master boot record
[ ] Boot from extended partition
[ ] Custom boot partition


Then I installed Leap 15.0 Beta on the same partition. I also took photos. The options were different:


[X] Boot from partition
[ ] Boot from master boot record
[ ] Custom boot partition

Notice that it does not say _which_ partition. So I did this:


[ ] Boot from partition
[ ] Boot from master boot record
[X] Custom boot partition
[/dev/sda9            ]

I noticed that in going to another tab, the "/dev/sda9" entry was cleared out:

[ ] Boot from partition
[ ] Boot from master boot record
[ ] Custom boot partition
[                 ]

I again marked the correct entries.
I could not take more photos, yast refused.

On boot, YaST had installed grub to /dev/sda4, overwriting the main system, ignoring my explicit orders to install on /dev/sda9


On the running system, YaST in 15.0 is unable to correct the situation. It insists on not installing grub to sda9. I can only correct the situation on the main system, which will render 15.0 unbootable, as sda9 has no grub.

I will now attach logs and photos.

First file is RESULTS.txt, from running bootinfoscript version 0.76, 13 April 2017, which is an splendid brief of the boot status.
Comment 1 Carlos Robinson 2018-03-11 22:47:34 UTC
Created attachment 763322 [details]
Yast logs.
Comment 2 Carlos Robinson 2018-03-11 22:52:58 UTC
Created attachment 763323 [details]
Screenshot of L42.3 with default boot loader location
Comment 3 Carlos Robinson 2018-03-11 22:55:00 UTC
Created attachment 763324 [details]
Screenshot of L42.3, Installation settings view, after doing correct adjustments.
Comment 4 Carlos Robinson 2018-03-11 22:56:16 UTC
Created attachment 763325 [details]
Screenshot of L42.3, warning prior to install, ignored.
Comment 5 Carlos Robinson 2018-03-11 22:58:40 UTC
Created attachment 763326 [details]
Screenshot of L15.0 with default installation settings (incorrect)
Comment 6 Carlos Robinson 2018-03-11 23:01:15 UTC
Created attachment 763327 [details]
Screenshot of L15.0 with default boot loader location

Notice the "Boot from partition" line, without saying which. The first time installed I assumed it would be the root partition, obviously. It wasn't, it was sda4.
Comment 7 Carlos Robinson 2018-03-11 23:05:36 UTC
Created attachment 763328 [details]
Screenshot of L15.0 with cleared boot loader location

It is not shown in the photos because YaST refused to take more.
I changed the settings to "Custom Boot Partition" and below I wrote /dev/sda9, which is the root partition. Then I changed the tab to see the kernel settings, the options, and then back to "boot code options". The photo shows what I saw then: all options cleared, and the custom boot partition field deleted.
Comment 8 Carlos Robinson 2018-03-11 23:10:38 UTC
Installation was from openSUSE-Leap-15.0-DVD-x86_64-Build153.1-Media.iso wit network. XFCE selection.
Comment 9 Stefan Hundhammer 2018-03-12 10:44:43 UTC
macro_inst_initial.ycp from the y2logs tarball confirms this selection
(slightly reformatted for better readability):

{
  // 2018-03-11 13:14:53

  UI::ChangeWidget( `id ("Bootloader::LoaderTypeWidget"), `Value, "grub2" );
    // YComboBox "Boot Loader"
  
  UI::ChangeWidget( `id (`boot), `Value, false );
    // YCheckBox "Boot from Partition"
  
  UI::ChangeWidget( `id (`mbr), `Value, false );
    // YCheckBox "Boot from Master Boot Record"
  
  UI::ChangeWidget( `id (`custom), `Value, true );
    // YCheckBox "Custom Boot Partition"
  
  UI::ChangeWidget( `id (`custom_list), `Value, "/dev/sda9" );
    // YInputField ""
  
  UI::ChangeWidget( `id ("Bootloader::ActivateWidget"), `Value, false );
    // YCheckBox "Set active Flag in Partition Table for Boot Partit..."
  
  UI::ChangeWidget( `id ("Bootloader::GenericMBRWidget"), `Value, false );
    // YCheckBox "Write generic Boot Code to MBR"
  
  UI::ChangeWidget( `id ("Bootloader::TrustedBootWidget"), `Value, false );
    // YCheckBox "Enable Trusted Boot Support"
  

 return;
}


One thing I don't see at all there, though, is a checkbox for the extended partition. But this might also be interesting (from y2log-1.gz):

2018-03-11 13:31:56 <1> linux-9vao(3465) [Ruby] bootloader/stage1.rb:180 stage1 to merge <Bootloader::Stage1 31459980 activate: false generic_mbr: false devices: ["/dev/sda9"]>

2018-03-11 13:31:56 <1> linux-9vao(3465) [Ruby] y2storage/devicegraph.rb:321 Device <Partition /dev/sda9 7176 MiB (7.01 GiB), 935852032 - 950548479> found by its libstorage-ng name /dev/sda9

2018-03-11 13:31:56 <1> linux-9vao(3465) [Ruby] modules/BootStorage.rb:234 Using extended partition instead: <Partition /dev/sda4 308632747.5 KiB 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(294.34 GiB), 333284490 - 950549984>

2018-03-11 13:31:56 <1> linux-9vao(3465) [Ruby] modules/BootStorage.rb:167 stage1 partitions for <Partition /dev/sda9 7176 MiB (7.01 GiB), 935852032 - 950548479> are [<Partition /dev/sda4 308632747.5 KiB (294.34 GiB), 333284490 - 950549984>]
Comment 10 Stefan Hundhammer 2018-03-12 10:47:15 UTC
Josef, please have a look.

I don't know if grub can handle logical partitions on that level; but if it doesn't, we should clearly warn the user about it when he requests grub to be installed on a logical partition.
Comment 11 Stefan Hundhammer 2018-03-12 10:51:36 UTC
I found some interesting articles on the web that more or less say that some BIOSes may not be able to handle a boot loader in a logical partition; this might be an explanation for this behaviour. But in this case, we should warn the user about it.
Comment 12 Josef Reidinger 2018-03-12 11:09:40 UTC
yes, BIOS does not understand extended partition, so installing to logical is only for very advanced users which ensure its chainloading there. For this purpose user can use boot from custom location and specify it there. But I see that it is done in this case and it still rewrite it, which is wrong. I will prepare fix for it.
Comment 13 Carlos Robinson 2018-03-12 11:39:56 UTC
Thanks. Some clarifications:

Please notice that YaST in Leap 42.3 does contemplate this case, and does the correct choices for the case of the current install being the only or main one:

[X] Boot from Root partition
[ ] Boot from master boot record
[X] Boot from extended partition
[ ] Custom boot partition

In the present case, however, Leap 15.0 does not:

[X] Boot from partition         <=== (which partition?)
[ ] Boot from master boot record
[ ] Custom boot partition       <=== ignored


Also notice that it is not BIOS booting the logical partition sda9, it is GRUB from sda4 from the Leap 42.3 install.

Booting follows this chain:

Bios --> MBR --> sda4 --> grub from 42.3 --> sda9 --> grub from 15.0
                extnd     production                    beta

It is a triple boot machine, and this Beta is not the default system.
Comment 14 Josef Reidinger 2018-03-12 12:29:22 UTC
yes, that ignored is wrong ( in fact it is not ignored, but incorectly translate logical to extend, this I will try to fix ). Answer to which partition is - partition from which bootloader can boot system for sure ( so this is not logical one ).
Comment 15 Steffen Winterfeldt 2018-03-12 12:47:30 UTC
Tracking in YaST scrum board.
Comment 16 Josef Reidinger 2018-03-12 14:45:13 UTC
fix is under review https://github.com/yast/yast-bootloader/pull/489
Comment 17 Josef Reidinger 2018-03-12 15:12:07 UTC
fix merged, will be in next build of leap 15.

Thanks for report.
Comment 18 Carlos Robinson 2018-04-03 21:28:34 UTC
I confirm that Build187 doesn't have this problem.