openSUSE 13.2 and Windows 7 boot problem

Hi!
I’ve already posted on openSUSE facebook group and I’ve been told to post here. This might be long story.

So it all started with release of openSUSE 13.2…

  1. I had already Windows 8.1 and openSUSE 13.1 but only when I installed Windows 8.1 it started to annoy me a lot. So I decided that when new openSUSE comes out I will format whole drive and install Windows 7 and new openSUSE. Now the story begins.
    I wanted to format whole drive during Windows 7 installation but it wouldn’t even boot (After loading Windows files it was freezing at “Starting Windows” screen). So I decided, screw that, I’m gonna keep that god **** Windows 8.1 and started installing openSUSE 13.2. It installed successfully BUT grub2-efi couldn’t detect Windows installation even when I have mounted Windows C partition. I decided to wipe out whole drive the next day and try installing Windows 7 then too.
  2. On the next day I wiped whole drive and tried to install Windows 7. And it was successful (most probably it wouldn’t start with UEFI turned on, I had to change UEFI to Legacy Support to start Hiren’s Boot CD). After that I installed openSUSE again. Successfully again BUT now grub wasn’t starting. After turning on my laptop it was going straight into openSUSE and the only way to get to Windows was to launch bios boot menu (F12 for me). On openSUSE facebook group I was told to change Legacy Support back to UEFI but it didn’t help. BTW I forgot to mention. During Windows installation it created 3 partitions and as long as I remember it was always creating 2. One was C and the other 2 were boot partitions I guess (around 100MB each). During openSUSE installation one of those 2 partitions was selected to mount in /boot/efi (it was FAT partition BTW).
  3. I thought, maybe reinstall of openSUSE would help. But it did not. During that second installation I formated that /boot/efi partition. And now grub was launching but again… there was no Windows in it and I couldn’t detect that.

For now I got only Windows installed because I need that for school for now but I really want openSUSE installed too because I would rather use linux as main system.

Hi
Well the real issue is your mixing technologies with respect to booting, decide on one :wink:

I would suggest UEFI, now the question is do you want windows 7 or windows 8.1, please advise.

How is windows 7 or 8.1 installed restore dvd, update from 8.0?

Can you show the partition/disk setup on your system. What is the system/hardware?

Well, BIOS says that Windows 7 is installed as EFI but it’s installation somehow won’t start with UEFI, only when there’s Legacy Support.

And of course I want Windows 7. Windows 8 is annoying like hell.
Both 7 and 8.1 are installed with it’s own DVD (MSDN ftw).

http://oi61.tinypic.com/2h38qww.jpg
For now that’s my partition setup. the unassigned 60GB part is for linux (20-30GB root dir(btrfs), rest home(xfs)).
My laptop is Lenovo g580 (20150)

http://support.lenovo.com/us/en/products/laptops-and-netbooks/lenovo-g-series-laptops/lenovo-g580-notebook

Oh, and the disc is SSD.

On a laptop and BTRFS root I suggest a separate 300-500 meg ext2/4 boot. Grub does not know how to write to btrfs so it can lead to problems on resumes.

Also if you even once tried mixing modes it can create spurious partition tables and that can confuse things.

OK, So you will need to re-install (since you have the install media), what you need to do is pre-configure the disk before installing windows 7. I use the openSUSE 13.1 rescue cd (on a USB device to boot), I suggest you use this as it will boot in UEFI mode.

So, step one, backup any data you have and want to keep as we will re-do the disk.

Step two, set your system BIOS to boot in UEFI mode, with secure boot disabled.

Step three, boot the system from the rescue cd, however your system does this (press F12 maybe?).

Step four, when logged into the rescue cd desktop, right click and open a terminal and switch to root user (no password is required).


su -
efibootmgr

You should see some efi entries, 0001, 0002?

From the rescue system, open you browser, login and post the info here, we need to delete them (windows and openSUSE will recreate :wink: )

Once they are removed we can re-partition your device with gdisk in preparation for the windows 7 and openSUSE install.

You mean a special rescue cd? Where can I get it? Or you mean the rescue mode from openSUSE install DVD?

EDIT: NVM, I got this. Gonna try your instruction tomorrow as I have absolutely no time today.

linux:~ # efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,2001
Boot0000* Windows Boot Manager
Boot0001* EFI DVD/CDROM (PLDS DVD-RW DS8A9SH)
Boot0002* EFI Network 0 for IPv6 (20-1A-06-89-D7-16) 
Boot0003* EFI Network 0 for IPv4 (20-1A-06-89-D7-16) 
Boot2001* EFI USB Device

So… I guess i remove only Windows entry? How?
And then I have to I will have to create the partitions. Do I include boot partition here?

Ok, I’ve finally installed openSuse with grub working. Turns out that all I had to do was to turn on UEFI after Windows install, disable secure boot and just install openSuse. I din’t even had to delete Windows again. And during openSuse installation, just in case, I deselected Secure Boot Support in grub. Thread may be closed

On Tue 11 Nov 2014 11:16:02 AM CST, FilipK wrote:

Code:

linux:~ # efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,2001
Boot0000* Windows Boot Manager
Boot0001* EFI DVD/CDROM (PLDS DVD-RW DS8A9SH)
Boot0002* EFI Network 0 for IPv6 (20-1A-06-89-D7-16)
Boot0003* EFI Network 0 for IPv4 (20-1A-06-89-D7-16)
Boot2001* EFI USB Device


So… I guess i remove only Windows entry? How?
And then I have to I will have to create the partitions. Do I include
boot partition here?

Hi
Ok, to remove an entry;


efibootmgr -b 0000 -B 0000

As an aside, to add a custom entry for example windows back in, would
be;


efibootmgr -c -L "Windows Boot Manager" -l "\\EFI\Microsoft\\Boot\\bootmgfw.efi"

If you run efibootmgr -v it shows the more verbose output.

Yes you need to create a few partitions :wink:

Can you post the output of;


gdisk -l /dev/sda

I’m assuming it’s already gpt ready, but always like to clear it out
and start again;


gdisk /dev/sda
x
z
y
y

That is e(x)pert (z)ap y to accept wiping gpt and y to clear the mbr.

I would then run gdisk again to create;


sda1 - 260MB Type ef00 [efi partition]
sda2 - 128MB Type 0c01 [windows msr]
sda3 - ~40GB for / type 8300 [openSUSE /]
sda4 - ? for /home type 8300 [home]
sda5 - swap type 8200 (equal to RAM if => 8GB else 1.5 times if less)
sda6 - ? for windows type 0700

You can then boot into the windows install and use the custom feature
and select sda6 for windows to install on.

Then the openSUSE install using the ‘expert’ mode for the partitioning,
hit the rescan device button, then up to the sda and select the
partitions as required, all you need to remember is to set sda1 to not
format and you should be good to go.

Now on the reboot of the openSUSE install you may need to boot from the
openSUSE efi file.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I’m not sure if you noticed but I posted that disabling secure boot and UEFI worked. Although it “crashed” again and I have absolutely no idea why.

So as I posted before, straight after opensuse installation grub worked fine. After I configured it a bit I wanted to check if Windows will boot successfully. I rebooted the system selecting to automatically boot Windows. It didn’t boot Windows and grub didn’t showed up. After a normal reboot same thing happened. No grub again. And again I can get to Windows only by boot menu. When I try to get to grub options in Yast i get this message.
http://oi60.tinypic.com/28an80y.jpg
And here is result of grub2-mkconfig

Filip:/home/filip # grub2-mkconfig -o /boot/grub2/grub.cfg
Generowanie pliku konfiguracyjnego GRUB-a...
Znaleziono motyw: /boot/grub2/themes/openSUSE/theme.txt
Znaleziono obraz Linuksa: /boot/vmlinuz-3.16.6-2-desktop
Znaleziono obraz initrd: /boot/initrd-3.16.6-2-desktop
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  No volume groups found
Znaleziono Windows Boot Manager na /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Znaleziono openSUSE 13.2 (x86_64) na /dev/sda5
gotowe

Znaleziono means found.

If you won’t give any answer to that I will probably reinstall that again with your instruction but I would rather not do that again…

I’m confused if you can’t boot to openSUSE how in the world are you running Yast??

Are you trying to use it from a Live media?

I did not say that I can’t boot to openSuse. I said that grub is not working like it wasn’t even installed. When i turn on my laptop it goes straight to openSuse and if I want to boot Windows I have to select Windows in boot menu.

???

You have to select Windows in what boot menu?

The BIOS one, the one I open with F12.

On Wed 12 Nov 2014 08:16:02 AM CST, FilipK wrote:

Fraser_Bell;2675443 Wrote:
> You have to select Windows in -what- boot menu?

The BIOS one, the one I open with F12.

Hi
OK, so when you press F12, in the menu does it just list the drivers,
or can you select an efi file?

If you can, boot to openSUSE and post the output from;


efibootmgr -v

If not, can you boot from the openSUSE recue cd and run the above
command and post the output.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Filip:/home/filip # efibootmgr -v
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0000,2001
Boot0000* Windows Boot Manager  HD(1,800,32000,5abac954-76a0-49aa-be6a-2951daccd8a1)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0002* EFI Network 0 for IPv6 (20-1A-06-89-D7-16)    ACPI(a0341d0,0)PCI(1c,0)PCI(0,0)MAC(201a0689d716,0)030d3c000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000RC
Boot0003* EFI Network 0 for IPv4 (20-1A-06-89-D7-16)    ACPI(a0341d0,0)PCI(1c,0)PCI(0,0)MAC(201a0689d716,0)IPv4(0.0.0.0:0<->0.0.0.0:0,0, 0RC
Boot0004* opensuse      HD(1,800,32000,5abac954-76a0-49aa-be6a-2951daccd8a1)File(\EFI\opensuse\grubx64.efi)
Boot2001* EFI USB Device        RC

Here’s the result and about the boot menu it’s just a normal boot menu. I got there the same entries as in that result I gave you except for USB because I got no bootable USB drive connected

On Wed 12 Nov 2014 06:06:06 PM CST, FilipK wrote:
<snip>

Here’s the result and about the boot menu it’s just a normal boot menu.
I got there the same entries as in that result I gave you except for USB
because I got no bootable USB drive connected

Hi
OK, we can just add the openSUSE one in, then after you boot into
openSUSE we can clean it up…

So, from the booted USB device run;


efibootmgr -c -L "openSUSE" -l "\\EFI\\opensuse\grubx64.efi"

Then when you boot into openSUSE proper;


update-bootloader --reinit
efibootmgr -v

That should sort it…


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

If it goes direct to openSUSE without a grub screen there are two possible reasons one you set the boot timeout to zero. or you hibernated and this is a return from that state and you use BSRFS file system and do not have a separate non-BTRFS boot partition. In essence grub does not know how to write BTRFS (can read but not write) so when you return from hibernation it is stuck always thinking it is returning from hibernation.

Delete /boot/grub2/grubenv

should get things back Note next hibernate the same will happen. :’( One of several reasons I believe that BTRFS as default should not have happened this cycle

Ding, ding, ding, ding! That’s the answer I’ve been looking for! Deleting that file helped and I think your answer about that hibernate stuff is right. Once I launched opensuse at first and there was grub and I then might have left my laptop for a long while and it hibernated.
I got /boot/efi on separate FAT partition. Maybe if I just change it’s mount location to /boot it will help?

No no no no

/boot/efi is needed on the FAT as now to be able to boot EFI mode. DO NOT TOUCH THAT!!!

The only thing that you can do to fix the problem is 1 report it 2 reinstall and don’t use BTRFS or reinstall and define a separate ext4 boot partition. The problem is in grub + BTRFS. only the developers can do anything to help this problem. Maybe they will issue a patch if enough people holler