OpenSuse 12.3/Windows 8 dual boot

As requested by nrickert - this thread relates to windows 8/12.3 dual boot
Sorry for repetition - I didn’t know how to link through…
https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/485517-opensuse-windows8-dual-boot-installation-questions-secure-boot-uefi-gpt-12.html

HP Pavillion G4 laptop 500GB HDD/4 Gb RAM
with Windows 8 pre-installed - I used DVD to install 12.3 64 bit without problems
EXCEPT default boot is to Windows - no option to boot 12.3
However, can boot 12.3 perfectly well from “bios”

Here is HDD setup from gdisk:
Number Start (sector) End (sector) Size Code Name
1 2048 821247 400.0 MiB 2700 Basic data partition
2 821248 1353727 260.0 MiB EF00 EFI system partition
3 1353728 1615871 128.0 MiB 0C01 Microsoft reserved part
4 1615872 481991501 229.1 GiB 0700 Basic data partition
5 481992704 482320383 160.0 MiB EF00 primary
6 924135424 976773119 25.1 GiB 0700 Basic data partition
7 482320384 486529023 2.0 GiB 0700 primary
8 486529024 528474111 20.0 GiB 0700 primary
9 528474112 924135423 188.7 GiB 0700 primary

and the bootmgr:

BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 3000,3001,3002,2001,2002,2003
Boot0000* Windows Boot Manager
Boot0001* opensuse
Boot0002* opensuse-secureboot
Boot2001* USB Drive (UEFI)
Boot2002* Internal CD/DVD ROM Drive (UEFI)
Boot3000* Internal Hard Disk or Solid State Disk
Boot3001* Internal Hard Disk or Solid State Disk
Boot3002* Internal Hard Disk or Solid State Disk

As suggested by nrickert - if I type “efibootmgr -n 0002” as root, a restart takes me to grub and I can boot either Windows8 or 12.3 as I choose
I would appreciate input as to how to make this behaviour default…

PS I am so irmpressed by the extent of expertise and help available here!

So how does selecting the openSUSE EFI partition in your UEFI PC setup differ from the command line version? Do you get the grub boot menu in both or not?

Thank You,

Now try:


# efibootmgr -o 0002,0000,2001,2002

and see if that makes it semi-permanent.

I have no experience with HP computers and UEFI. I am hoping to learn more about that from this thread. My UEFI experience is mainly with a Dell computer, plus a little that I have read from reading other discussions.

And thanks to James for requoting some of your output with code tags, so as to make it easier to read.

This command did not work - booting straight to Windows8 instead
checking efibootmgr again, it would appear that the original boot order has not changed
:- BootOrder: 3000,3001,3002,2001,2002,2003

In the bios under Boot order, UEFI settings - the only option appears to be OS boot manager
If I press Esc to get startup options, boot options are OS boot manager, OpenSuse, OpenSuse [Secure] and EFI files
I wonder if the Windows bootmanager is the defualt and that this is not over-written by efibootmgr?

I am adding two links here for reference.

  1. idransfi’s first post in the original thread (that was message #114 in that thread).
  2. the post in the original thread that contains the output of “efibootmgr -v” (that was message 119 in that thread).

The second of those links is one I expect to look at frequently.

I had guessed that would probably happen. But thank you for testing. You are helping me learn things about your system. And that helps to diagnose the problem that you are having.

Here’s another guess: when you ran that command “efibootmgr -o 0002,0000,2001,2002”, it really did change the boot order. And if you had immediately run “efibootmgr -v” you would have seen the change. However the firmware (or BIOS) changed it back during the next boot.

If that’s right, then your problem is similar to the one that oldcpu is having (see the older thread). I’ll elaborate on that in another message in this thread. For now, let’s concentrate on trying to get things working.

Here is what I want you to try, in order to work around the problem.

1: Mount the EFI partition from your Windows disk:


# mount /dev/sda2 /mnt

With that mounted, you should see a directory “/mnt/EFI”, which probably contains a subdirectory “Microsoft” and another subdirectory “Boot”. If you can provide the output from


# ls -l /mnt/EFI

that might be useful for future reference. And please use code tags around that output.

2: Make a backup of “/mnt/EFI/Boot” (that might be “/mnt/EFI/BOOT” or something similar on your system)


# cd /mnt/EFI
# mkdir BKUP  ### this will be a backup directory
# cd /mnt/EFI/Boot
# rsync -a . /mnt/EFI/BKUP/.

I am suggesting that the backup go in that same partition for easy access with recovery tools. You probably won’t need to use that backup, but it is there for safety. If you want to make a backup of the entire EFI partition to a USB, you could do that, too. Start by mounting the USB drive using your desktop. It will probably mount the USB as “/var/run/username/media/somename” (fill in the details).

You could then backup the original EFI partition with


# cd /mnt
# tar zcf "/var/run/username/media/somename"/efibkup.tgz EFI

Note that you would have to fix the destination name (the part ending in “.tgz”) according to where it was mounted. I put quotes around that name, because sometimes a USB mounts with spaces in the name. That EFI partition is 266M, so the backup will be smaller than that, probably smaller than 50M in size.

3: Copy the opensuse boot files to “/mnt/EFI/Boot”


# cd /mnt/EFI/Boot
# rsync -a /boot/efi/EFI/opensuse/.  .
# mv shim.efi bootx64.efi

If my diagnosis is correct, your computer will now start booting to the grub menu.

If there are updates to grub2-efi, then you will later need to repeat steps 1 and 3 since the copy that you made won’t be automatically updated by the opensuse software updater.

A Rant about UEFI implementations

Since 1980, we have been booting our PCs using the MBR of the main disk to start booting. Conceptually, we have a boot device, and we are booting that device. Code in the MBR then takes over and does operating system selection.

In truth, the idea of a boot device is earlier, probably goes back to the 1950s or even earlier.

UEFI was supposed to change that. Conceptually, with UEFI, we should be booting an operating system, not a boot device. Dell gets this. My system boots based on the boot order in the NVRAM.

It seems that some manufacturers (HP and Toshiba) don’t get this. They are still thinking “boot device” and “boot from a device”. This is wrong thinking, backward thinking.

By most accounts, I’m an old fogey. How is it that I can get the idea of booting an operating system rather than a device, while presumably younger engineers at HP and Toshiba are having trouble with that idea?

On 2013-07-07 14:36, nrickert wrote:

> It seems that some manufacturers (HP and Toshiba) don’t get this. They
> are still thinking “boot device” and “boot from a device”. This is
> wrong thinking, backward thinking.
>
> By most accounts, I’m an old fogey. How is it that I can get the idea
> of booting an operating system rather than a device, while presumably
> younger engineers at HP and Toshiba are having trouble with that idea?

Because they never knew the basics? :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

You are correct:
running efibootmgr -v informs me that the boot order was changed successfully with:

efibootmgr -o 0002,0000,2001,2003

My initial attempt to mount efi partition failed

mount dev/sda2 /mnt

returning the message

mount: special device dev/sda2 does not exist

sorry - this is obviously a problem when dealing with a Linux newbie

On 2013-07-07 16:56, idransfi wrote:

>
> My initial attempt to mount efi partition failed
>
> Code:
> --------------------
> mount dev/sda2 /mnt
> --------------------

You forget the slash before dev


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I could mount EFI partition from Windows command prompt:

J:\EFI>dir
 Volume in drive J has no label.
 Volume Serial Number is E829-4F06
 Directory of J:\EFI
03/24/2013  02:23 PM    <DIR>          .
03/24/2013  02:23 PM    <DIR>          ..
10/22/2012  03:52 PM    <DIR>          Microsoft
10/22/2012  03:52 PM    <DIR>          Boot
06/18/2013  09:04 PM    <DIR>          HP
               0 File(s)              0 bytes
               5 Dir(s)     171,393,024 bytes free

EFI/Boot contains:

03/24/2013  02:23 PM    <DIR>          .
03/24/2013  02:23 PM    <DIR>          ..
09/20/2012  01:31 AM         1,354,472 bootx64.efi

EFI/Microsoft has a whole ton of stuff:

03/24/2013  02:23 PM    <DIR>          .
03/24/2013  02:23 PM    <DIR>          ..
various language folders....
10/22/2012  03:52 PM    <DIR>          Fonts
10/22/2012  03:52 PM    <DIR>          Resources
07/07/2013  08:03 AM            36,864 BCD
06/26/2012  07:05 PM             4,186 boot.stl
09/20/2012  01:31 AM         1,354,472 bootmgfw.efi
09/20/2012  01:31 AM         1,350,888 bootmgr.efi
07/25/2012  09:57 PM         1,263,856 memtest.efi

and
EFI/HP

03/24/2013  02:23 PM    <DIR>          .
03/24/2013  02:23 PM    <DIR>          ..
10/22/2012  04:05 PM    <DIR>          SystemDiags
06/18/2013  09:04 PM    <DIR>          BIOSUpdate
06/18/2013  09:04 PM    <DIR>          BIOS
10/22/2012  03:52 PM    <DIR>          boot
10/22/2012  05:18 PM    <DIR>          EFI

I may be able to backup and copy files as you suggest from command prompt in Windows, though I don’t think I can mount 12.3 directories.

Sorry for the long post…

You did provide useful information.

As Carlos says, you missed a “/”. Try again with:


# mount /dev/sda2 /mnt

and if that still gives errors, provide the output from


# blkid

I’m pretty sure that we are making progress.

nrickert wrote:

> It seems that some manufacturers (HP and Toshiba) don’t get this. They
> are still thinking “boot device” and “boot from a device”. This is
> wrong thinking, backward thinking.

A more germane observation is that everyone seems to be playing a different
game. My “new” HP machine has given me zero problems with UEFI once I got
past the initial learning curve and has no issues with 2 GPT formatted hard
drives, EFI compatible DVDs, or USB drives. Maybe HP has begun to climb the
BIOS learning curve and I suspect that all the manufacturers will get aboard

  • eventually.

Of course, Win 8 is still an issue. MS acts as though their license gives
them th right to what ever they want - their way.


Will Honea
whonea@yahoo.com

Yes, I agree that this will settle down after a while. MBR booting wasn’t always smooth either.

It is possible that HP buys its UEFI firmware from somewhere else, and perhaps different HP models use UEFI firmware from different sources.

From my perspective, the important thing is to learn the different kinds of problems that people can have, so that we will be able to provide assistance as needed. And it will be needed for a while, until things shake out.

nrickert wrote:

> From my perspective, the important thing is to learn the different
> kinds of problems that people can have, so that we will be able to
> provide assistance as needed. And it will be needed for a while, until
> things shake out.
>

I couldn’t agree more. Your comments and those of other contributors were
invaluable while I was getting up to speed on this box.


Will Honea
whonea@yahoo.com

Thank you Carlos… I have made some progress - reading more carefully!

By following nrickert’s detailed instructions, I managed to backup the efi files and used tar to backup on a usb drive too.
The copy of opensuse boot files to /mnt/EFI/boot and the move of shim.efi to bootx64.efi also appeared to be successful.


# cd /mnt/EFI/Boot 
# rsync -a /boot/efi/EFI/opensuse/.  . 
# mv shim.efi bootx64.efi

However, the next reboot took me to back to Windows - I’ll try this again later in case I mistyped something and check that the relevant files are present and correct.
Naively, I wondered if the file that the OS bootmanager looks for on /dev/sda2 is bootmgfw.efi rather than bootx64.efi

Boot0000* Windows Boot Manager   HD(2,c8800,82000,694d4cb0-a22b-4df8-806f-a22e2d52f87d)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS

Your patience and help is appreciated.

I’m trying to understand the differences between my Toshiba Ultrabook Z930 and your HP Pavillion G4 wrt the EFI partitions, the openSUSE boot setup, and the Windows8 boot details.

I note on my Toshiba Ultrabook Z930 with UEFI BIOS, when my PC always booted to windows8, that the ‘bootmgw.efi’ (in the microsoft directory) , had an identical md5sum to the ‘bootx64.efi’ in the /boot directory. (this was before I replaced the bootx64.efi with shim.efi).

While my Ultrabook only has a single boot EFI partition (shared by openSUSE and Windows and Toshiba) I note you had created a separate EFI partition for openSUSE.

I followed some excellent advice on our forum, in order to get my installed 64-bit openSUSE-12.3 to boot.

FIRST: I note that I sent in windows8 from a command window (with admin permissions) the command:


bcdedit /set {bootmgr} path \EFI\opensuse\shim.efi

and after that did not succeed in working, I left it ‘as is’ and did not restore back to


bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi

(Possibly that is different from what you have in place - It was suggested that I send / test that, but having this working, I decided to leave ‘well enough’ alone. Maybe I should test that … :\ … ).

SECOND: To get openSUSE to boot, I then copied into the /EFI/Boot directory the openSUSE file shim.efi replacing bootx64.efi (and also copied the remaining openSUSE-12.3 /EFI/opensuse files into the /EFI/Boot directory).

Only after that copying would my Toshiba Z930 ultrabook boot direct to grub2. At this point on my PC, I note that the /EFI/Boot/bootx64.efi file and the /EFI/opensuse/shim.efi files are identical. And I also note on my PC that windows8 is still being told that the boot path is \EFI\opensuse\shim.efi . Could it be that windows8 does some sort of md5 or other checksum comparison with bootx64.efi and the ‘efi’ file that it has been told its boot path (per bcdedit) ? And if I can speculate, if the md5 sums are different, Windows8 will as a contingency over write the bootx64.efi with the windows8 bootmgw.efi file ? That’s very wild speculation on my part. Very very wild.

But for some reason, based upon what I did above, I did not lose my settings and a direct boot to Windows8 no longer occurs even if I go back and forth between Windows8 and openSUSE.

IMHO that begs the question, aside from two separate EFI partitions, what is different between our two PC’s setups ?

I have not suggested that for idransfi, because he has a separate EFI partition and I don’t think there’s a way to tell Windows to look there for booting.

That make it harder to understand what your UEFI BIOS is doing.

That’s possible, though it would be the BIOS rather than the OS boot manager. If it is doing that, then it is looking in “\EFI\Microsoft\Boot” rather then in “\EFI\Boot”. And that would mean that it is following the boot order with 0000 as first. So possibly it is Windows, rather than your BIOS that is messing things up.

I need to think about this, and post again later.

Thanks for all your efforts so far…
just confirm that the files in /dev/sda2 /mnt/EFI/Boot are:

bootx64.efi  
grub.cfg  
grub.efi  
grubx64.efi  
MokManager.efi

In reply to oldcpu
I essentially took a Windows8 system and used the 12.3 installation DVD to try and set up a dual boot system - essentially I am a naive user test of the installation process.
The choice of separate partition for boot was made following the suggested partitioning as part of the install process.
I would say that the 12.3 installation on the HP Pavillion G4 works as well as my dedicated 12.3 system running on a Dell Optiplex 780 system.
Perhaps the lesson here is to make dual boot life easier by investigating more fully (as you have) first?
Thanks once again