I’m trying to help my friend install openSUSE 13.1 x64. He has an issue where Grub2 is not giving the option to write the MBR to the hard drive that he wants openSUSE on. He has multiple hard drives in his machine, and Winblows is on one of those drives. Grub2 is writing the MBR to the Windows drive, and this isn’t the behavior that is desired. How do you get Grub2 to not write the MBR to the wrong drive?
Secondly, this install was on a drive that had FreeBSD on it, and the YaST Partioner had an issue erasing the MBR from the FreeBSD install, leaving an unbootable system. Does Grub2 sometimes have problems overwriting an existing MBR? He also tried having Grub2 write to the root partition, and that left the system unbootable.
You can set drive priority in the BIOS, choose the one to install openSUSE onto as the first drive, I suppose this isn’t UEFI? Besides, by default GRUB will boot from ‘root’(/boot) not MBR, choose whichever you like but to launch GRUB you need to set the oS drive at top.
GRUB2 writes to whatever device it is told to write. You probably mean YaST bootloader configuration which is something different. Please show /etc/default/grub_installdevice and /boot/grub2/device.map.
On the boot install screen, there’s a long button at the bottom “Boot Loader Installation Details”.
Click on that. There will be a list of drives, and up/down buttons. Arrange the list so that the first is the one where grub is to be installed. Then click “OK”. The summary screen should now show the MBR of the desired disk for installation.
I’m not sure whether it still works. It worked in the past by using legacy (hd0) as install device and changing mapping in device.map; but today yast does not use legacy drive names anymore and simply refers to OS device name (/dev/…).
It worked for me, installing 13.1 to an external drive and booting from the MBR of that external drive.
The ordered list of drives did use “/dev/sda” etc. And that was a bit awkward, because I had to make sure which device name the installer was associating with which physical device. So it is more confusing than I indicated in my earlier comment.
The difficulty is that the names of drives ("/dev/sda", “/dev/sdb”, etc) are not fixed – they can change. If the install was done while booted to a USB, that could change the device names. During the install, you have to use the device names as they are used in that particular boot to the installer. And it isn’t always obvious what that order is.
I would probably use CTRL-ALT-F2 to get to a command line. Then I would use “df” to see what is mounted. That usually gives me a clue on what the device names are for this boot. And then, CTRL-ALT-F7 gets back to the installation screen to complete entering the settings.
This worked fine for me with opensuse 13.1, installing on an external drive and booting from the MBR of that external drive.
If so, does he want to boot Windows from the Windows drive, or from Grub?
Does Windows still boot? I think you indicated not, but I am uncertain;
Depending on the above questions, how does he want to boot Linux?
From the Primary drive?
From the Windows drive?
From the Linux drive as a second or third drive by choosing it in the boot device screen at startup?
All these things make important differences in the approach.
Then, does he want to fix what is now installed, or do you want instructions how to install openSUSE again, but with a clear guide how to get GRUB written to a specific place?
If he wants Windows to still boot, and if it does not boot at the moment, then you should fix that, first. When Windows is working again, then come back here with the answers to the above questions.
And it is imperative that you post, as goglathorp asked:
He also tried having Grub2 write to the root partition, and that left the system unbootable.
If he tried booting by using his BIOS options and selecting to boot from the drive Linux is installed on, then this failure was most likely because the root partition was not set as the BOOT (or ACTIVE) partition. (Which gogalthorp also alluded to.)
> This worked fine for me with opensuse 13.1, installing on an external
> drive and booting from the MBR of that external drive.
I have not tried this, but on the photo caf4926 posted, you can see that
it offers a list of destinations for the boot loader. Maybe selecting only the last one, “custom boot partition”, and there choose one,
would work :-?
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
This is the Boot device list in the BIOS and I would rather think you made some mistake regarding this; but if so, just unplug the device (HD containing Win) install Linux and re-connect the other drive afterwards. Have the Linux drive as first boot device, then force a reinstall of GRUB to have the Windows entry automatically added to the GRUB boot menu.