Bug 870608

Summary: When writing bootloader to two locations it is not working for both
Product: [openSUSE] openSUSE 13.1 Reporter: Holger Sickenberg <holgi>
Component: YaST2Assignee: Michael Chang <mchang>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: holgi, jreidinger, jsrain, rw, snwint
Version: FinalFlags: holgi: needinfo? (rw)
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.1   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2logs.tgz
pbl.log
hwinfo.txt

Description Holger Sickenberg 2014-03-27 13:08:37 UTC
Created attachment 583958 [details]
y2logs.tgz

During installation I selected to write bootloader to extended partition (sda2) and the root partition (sda5) - activating the extended partition.

But booting did not work, I just saw "GRUB" on the screen.

Using a grub from an USB stick and chain loading to sda2, the same thing happen while if I selected sda5 booting worked fine.

I did some more tries afterward and those are also in log files, so concentrate on the first part of the logs please.
Comment 1 Holger Sickenberg 2014-03-27 13:09:06 UTC
Created attachment 583959 [details]
pbl.log
Comment 2 Holger Sickenberg 2014-03-27 13:09:30 UTC
Created attachment 583960 [details]
hwinfo.txt
Comment 3 Steffen Winterfeldt 2014-03-28 08:30:44 UTC
You cannot write grub into the extended partition (sda2). What should this accomplish?
Comment 4 Holger Sickenberg 2014-03-28 08:38:11 UTC
Sure I can. As I wrote it is working if I do it manually. Also YaST is offering this option.

As far as I understand booting:
You can only boot grub2 (as any other boot loader) from primary and extended partitions (type=0f) but not from partitions inside an extended partition.

Since openSUSE 13.1 is installed on a partition inside an extended partition I need to write grub2 on the extended partition.
Comment 6 Steffen Winterfeldt 2014-03-28 08:58:08 UTC
If you need lots of partitions you might consider using a gpt.

Anyway, afaik our current mbr code supports booting from extended partitions. So the correct way would be to put grub2 into sda5 and activate that partition.
Comment 7 Michael Chang 2015-01-28 04:50:07 UTC
Hi Hoger,

Is the problem still valid for 13.2 or current factory?

Thanks.
Comment 8 Holger Sickenberg 2015-01-28 08:46:40 UTC
I do not use 13.1 but 13.2 now. So I cannot check.
Comment 9 Michael Chang 2015-01-28 09:21:44 UTC
Meanwhile I figured out why ..

Although the two successive grub2-install to extended and logical partition succeeded, the latter will do the copying of images to /boot/grub2/i386-pc which overwrites previous one. The blocklist address of /boot/grub2/i386-pc/core.img in extended partition is therefore obsoleted by new one.

Sadly latest grub2-install do not allow specifying two locations at the same time.

Is this really a valid case we need to support? Jiri could you please help to confirm ..?
Comment 10 Jiri Srain 2015-01-28 09:34:59 UTC
I can see various reasons to support this:

- you have two identically partitioned disks with mirroring RAID; you then want to write GRUB2 to both MBRs

- you install openSUSE first and then another OS with bootloader, which chainloads openSUSE's GRUB2. Then you want to install GRUB2 to MBR for the first boots and to boot sector for booting after other OS is installed.

Besides, I fear that YaST even supports setting various locations (well, this could possibly be changed).

Why was support for multiple locations removed?
Comment 11 Michael Chang 2015-01-28 10:19:16 UTC
(In reply to Jiri Srain from comment #10)
> I can see various reasons to support this:
> 
> - you have two identically partitioned disks with mirroring RAID; you then
> want to write GRUB2 to both MBRs

This case is OK, we won't have problem. Because block list is not used to boot RAID. We only waste time in embedding core.img twice ..

> 
> - you install openSUSE first and then another OS with bootloader, which
> chainloads openSUSE's GRUB2. Then you want to install GRUB2 to MBR for the
> first boots and to boot sector for booting after other OS is installed.

This case blocklist won't break if the install sequence was like ..

grub2-install /dev/sda (embedding entire core.img to mbr)
grub2-install --force /dev/sda3 (find core.img in filesystem via blocklist)

but in this case blocklist (in /dev/sda3) breaks .. :(

grub2-install --force /dev/sda3
grub2-install /dev/sda

System is bootable to openSUSE, but chainload the partition (from other loader) would fail.

> 
> Besides, I fear that YaST even supports setting various locations (well,
> this could possibly be changed).

Yes.

> 
> Why was support for multiple locations removed?

I'm also curious ...
Comment 12 Michael Chang 2015-01-28 10:20:40 UTC
(In reply to Michael Chang from comment #11)
> (In reply to Jiri Srain from comment #10)

> boot RAID. We only waste time in embedding core.img twice ..

sorry, should be wasting time in copying the core.img and modules twice ..
Comment 13 Jiri Srain 2015-04-09 07:39:54 UTC
(In reply to Michael Chang from comment #12)
> (In reply to Michael Chang from comment #11)
> > (In reply to Jiri Srain from comment #10)
> 
> > boot RAID. We only waste time in embedding core.img twice ..
> 
> sorry, should be wasting time in copying the core.img and modules twice ..

I don't think that the time spent on GRUB2 installation is any important (given usual time it takes, compare it e.g. to initrd creation).

Anyway, my guidance: The only real case which I would like to keep are disks partitioned as RAID1 and assure that any of the disks is bootable as standalone.
Comment 14 Tomáš Chvátal 2018-04-12 13:35:39 UTC
This version of openSUSE changed to end-of-life (EOL [1]) status. As such
it 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 
openSUSE, or consider the bug still valid, please feel free to reopen this
bug against that version, or open a new ticket.

Thank you for reporting this bug and we are sorry it could not be fixed
during the lifetime of the release.

[1] https://en.opensuse.org/Lifetime