Default installation propose me to install grub2 on another disk's mbr. Normal?

Hello,
As usual, I’ve installed openSUSE 12.3 on my disk sda. I boot on the disk sdc. Computer with bios (no uefi), and I have windows xp on sda.
sda has legacy grub on the mbr, and sdc’s mbr has the grub2 I use to boot.

With the Milestone2 the proposition was to install grub2 on the mbr of sda (same disk). I found that good.
But now, with the RC1 (and beta1), the installation propose me to install it on the mbr of sdc.

So my question is, is this normal? And, can grub2 work between two disks?

In the RC1 bootloader part (just before to accept the installation), I’ve seen a list of my disks in the bios order (sdc, sda, sdb). So I think grub2 is installed on the boot disk. Or he search were there is already a grub2?

For myself I really don’t like this behavior. If I install a system on my second disk, this is to preserve my principal disk.
Thank you.

First, for any existing installation, have a look at findgrub, a great bash script that can tell you just where grub is located: http://www.unixversal.com/linux/openSUSE/findgrub-4.4.1.tgz

As to what the openSUSE installer is doing is to produce a working single or dual boot and assumes you may not know how to do that. Most systems include but one hard disk and so only those of us with more might see such behavior. In any case where you think the installation has gone astray, you should report the issue as a bug report before its too late to get a fix in. I will say that normally I take the reigns of the installation and put all of the openSUSE grub bootloader on the same disk while I may place /home on a different disk. Specifically, for a dual boot on a single disk with Windows, I place Grub 2 into root / and generic boot code into the MBR. For any disk dedicated for openSUSE, I place Grub into the MBR of the same disk where /boot and or root / are located. Its hard for openSUSE to guess which disk will be selected to boot from if not the default hardware boot order. I can say that if you are installing grub 2 to boot on a GPT disk on a UEFI enabled PC, its best to let the openSUSE installer do its own default installation. This is because you can not create a ESP partition manually with the YaST Partitioner. For information concerning MBR & GPT disk partitions, please have a look here: https://forums.opensuse.org/content/111-partitioning-hard-disk-during-install.html, and please post any comments or corrections if you have them to this article and thank you in advance for you help.

Thank You,

I know it, and I use it :wink:

findgrub
Find Grub Version 4.4.1 - Written for openSUSE Forums

 - reading MBR on disk /dev/sda                       ... --> Legacy GRUB  found in sda MBR     => sdc2   0x83 (openSUSE)
 - searching partition /dev/sda1      (NTFS)          ... --> Windows NT/2K/XP Loader found in /dev/sda1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can add the following entry to /boot/grub/menu.lst :

###Don't change this comment - YaST2 identifier: Original name: WindowsBootLoader###
title Windows on /dev/sda1
    rootnoverify (hd1,0)
    map (hd1) (hd0)
    map (hd0) (hd1)
    chainloader +1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 - reading bootsector  /dev/sda2      (Extended)      ...
 - skipping partition  /dev/sda5      (swap)         
 - reading bootsector  /dev/sda6      (LINUX)         ... --> Grub2 (2.00) found in /dev/sda6   => sda6   0x83 (openSUSE)
 - reading bootsector  /dev/sda7      (LINUX)         ...                                                                                            
 - reading bootsector  /dev/sda8      (LINUX)         ... --> Grub2 (2.00) found in /dev/sda8   => sda8   0x83 (openSUSE)                            
 - reading bootsector  /dev/sda9      (LINUX)         ...                                                                                            
 - reading bootsector  /dev/sda10  *  (LINUX)         ... --> Legacy GRUB  found in /dev/sda10  => sda10  0x83 (Fedora)                              
 - reading bootsector  /dev/sda11     (LINUX)         ...                                                                                            
                                                                                                                                                     
 - reading MBR on disk /dev/sdb                       ...                                                                                            
 - reading bootsector  /dev/sdb1      (LINUX)         ...                                                                                            
 - reading bootsector  /dev/sdb2      (LINUX)         ...                                                                                            
                                                                                                                                                     
 - reading MBR on disk /dev/sdc                       ... --> Grub2 (2.00) found in sdc MBR     => sd?    0x?? (ArchLinux)                           
 - skipping partition  /dev/sdc1      (swap)         
 - reading bootsector  /dev/sdc2   *  (LINUX)         ... --> Legacy GRUB  found in /dev/sdc2   => sdc2   0x83 (openSUSE)
 - reading bootsector  /dev/sdc3      (LINUX)         ...
 - reading bootsector  /dev/sdc4      (Extended)      ...
 - reading bootsector  /dev/sdc5      (LINUX)         ... --> Grub2 (1.99) found in /dev/sdc5   => sd??   0x?? (openSUSE)
 - reading bootsector  /dev/sdc6      (LINUX)         ...
 - reading bootsector  /dev/sdc7      (LINUX)         ...
 - reading bootsector  /dev/sdc8      (LINUX)         ...


Press <enter> to Exit findgrub...

On sda I’ve windows xp, openSUSE 12.2/12.3, and Blag (to see how the libre linux kernel works).
On sdc openSUSE 12.1, and archllinux

As to what the openSUSE installer is doing is to produce a working single or dual boot and assumes you may not know how to do that. Most systems include but one hard disk and so only those of use with more might see such behavior. IN any case where you think the installation has gone astray, you should report the issue as a bug report before its too late to get a fix in.

I understand. I don’t know what to think about this behavior. I don’t like it, but if this can help someone, we can let it like that. I know what I do, so I can change the default proposition…

I will say that normally I take the reigns of the installation and put all of the openSUSE grub bootloader on the same disk while I may place /home on a different disk.

I don’t use default proposition too. And I thought that grub2 had to be on the same disk, so I’m wrong.

Specifically, for a dual boot on a single disk with Windows, I place Grub 2 into root / and generic boot code into the MBR.

For systems on my sda disk I install grub/grub2 on /, but this is not very good. One time I’ve change the partitioning of another system in the the extended partition, and I’ve lost my grub2 because core.img has moved.

Its hard for openSUSE to guess which disk will be selected to boot from if not the default hardware boot order.

Yes, but there was the right list in the bootloader part. And he find my boot disk.

Thank you very much! Now I know, this work, and this is normal for basic users :slight_smile:

I think this is not normal generally should grub be placed on sda if exists.

Consider that with most computer BIOS’ and the newer UEFI PC’s, you can select which disk is your boot disk and so sda does not need to be your boot disk unless its the only disk you have. Therefor, you can install grub onto any hard disk you like and then set that disk to boot. If a different disk from Windows in a dual boot setup, grub will create a menu option to load Windows even if not the selected boot disk in your BIOS or UEFI PC. The exception if a GPT disk used on a UEFI PC which must be selected in a different manner to be bootable MBR disk and by that I mean you must select what will be booted on this disk as it supports more than one boot. Have a look at the Partition setup between a MBR and GPT hard disk.

Creating Partitions During Install for MBR and GPT Hard Disks: https://forums.opensuse.org/content/111-partitioning-hard-disk-during-install.html

If you are dual booting with openSUSE and Windows on the same hard disk, consider placing generic boot code in the MBR and load grub into the root / partition. In the event you need to switch to Windows as primary, just changing its boot partition as acting sets WIndows as the only booting OS and allows the install of a Windows Service Pack when needed. Making the openSUSE root partition as active returns control back to openSUSE and Grub. GParted LiveCD boot disks work well for this purpose.

Have a look here: GParted – Live CD/USB/PXE/HD

Anytime you wish to boot the openSUSE root / partition from a MBR disk and its not on disk partitions 1, 2, 3 or 4, the grub MUST be loaded into the MBR as you can’t actually “boot” from a Logical Partition, numbers 5 or higher, unless grub is in the MBR. For GPT disks, its a whole new thing where its using ESP partitions to designate the booting partitions.

Thank You,

I think behavior is correct. If /dev/sdc is your BIOS boot disk, and installer somehow can detect it, then “Boot from MBR” should offer /dev/sdc.

That said, I personally would prefer “Boot from MBR” option to be removed entirely. There is really no reliable way to know which MBR is the MBR, so it is better to let user explicitly select device.

I do not think YaST2 tries to detect previous installations of bootloader, but I may be wrong here.

I have no problem to setup bootable disc. But for newcomers could be problem, they must know, what is extended partition and so on.

Well when GPT disks and UEFI take over all PC’s and assuming secure boot does not lock us out, the MBR situation will be just a bad memory in the past. However, if you end up with the openSUSE root / in a Logical Partition, that a MBR load of grub is your only option. None the less, loading generic boot code works fine most of the time if you have a primary partition to use for booting, but please don’t put it in an Extended Partition and run a Windows disk manager on it.

Thank You,