Dual boot windows 8 and opensuse, the boot loader was wrongly set to grub2.

Dear all,

I know that I will make a lot of ‘friends’ among the opensuse experts by asking this question, but here we go…

I tried to dual boot windows 8 and opensuse 13.2. For the purpose I used a live usb and installed opensuse by manually creating the partitions, /swap /home and / ,on a previously allocated space. The installation complained about missing /boot/ufi partition. After consulting the internet I decided that this error warning can be brushed aside and I continued with the installation. Then in a sudden stroke of genius, I decided to install grub2 by clicking on an option to install it on the MBR, during the installation process.

I was able to boot into opensuse but windows is not on the grub menu. As far as I understand EFI is incompatible with grub2, hence my choice was wrong. My question is whether it is possible to make grub2 somehow see windows 8, or I should try rearing the windows boot loader and then installing opensuse again with grub-efi.

Thanks,

No it can not be brushed aside the EFI boot partition is absolutely required for EFI boot. It is a small FAT formatted partition and if you have Windows 8 installed in EFI mode then it should already exist just mount it as /boot/efi

Do not mix boot modes ie one OS as EFI another as legacy.

You can probably switch opensuse to use grub2-efi for booting. In that case, no reinstall is needed. If you still have that live USB that you used for installing, you might find it useful for the repair.

First, add an entry to “/etc/fstab” to mount your EFI partition at “/boot/efi”. You do need to know which partition is the EFI partition, so let us know if you need help working that out. It will be the partition that Windows was using for its EFI partition. You just share it.

To add the EFI partition to “/etc/fstab”, I think you can use Yast Partitioner. When it lists the existing partitions, right click on the entry for the EFI partition and select EDIT. Then tell it to mount that partition at “/boot/efi”. It should identify the partition as FAT, and it should not want to format that partition (it is important to not format it).

I’m unsure of the next step. The easy way is to use Yast Bootloader, and change the boot loader to grub2-efi. I’ve never tried that, so I’m not sure what will happen. In the best case, it will almost work but complain about one step. But I think it will allow you to ignore the error and continue. And then you boot with the live USB to fix that last step using the “efibootmgr” command (the man pages are fairly good and there are examples that you can google). We can give you the final details here when you are ready.

If the Yast bootloader bails out too early, then you might have to do it the hard way with grub2-efi recovery.

If you have not done too much since your install of opensuse, you might find it easier to just reinstall using the same partitions. If you want to try that, I still suggest first making an entry for the EFI partition in “/etc/fstab”. If nothing else, it will be good practice to get started.

I’ll stop here until I hear what you plan to do.

Dear nricert,

I have been doing my homework late last night and tried to understand how the proper installation goes. The problem is that I was not able to see the efi partition of Windows 8. There are some threads on the internet explaining how to install opensuse with to dual boot with Windows8, but due to the fact that in the Expert Partition part of the install, I was not able to see the needed partition the installation was bogus from the beginning.

As a measure of last resort I tried to insert manually an entry for windows 8, but it also didn’t work (with updating bootloader). Doing this I was left with the impression that my efi partition should be (hd0,msdos1). This I got by pressing ‘c’ and listing with ‘ls’ when grub started. However, I am not sure whether this is correct. I am rather confused, since running ls at the grub’s start gave me partitions named hd0,msdos1 hd0,msdos2 etc. But running df -hT and cat /etc/fstab didn’t give any reference to those. I don’t really understand how this works.

lap11@linux1:/etc/grub.d> cat /etc/fstab
UUID=*** swap swap defaults 0 0
UUID=*** / ext4 acl,user_xattr 1 1
UUID=*** /home ext4 acl,user_xattr 1 2
[FONT=courier new]lap11@linux1:/etc/grub.d> df -ahT
rootfs - - - - - /
sysfs sysfs 0 0 0 - /sys
proc proc 0 0 0 - /proc
devtmpfs devtmpfs 2.9G 0 2.9G 0% /dev
securityfs securityfs 0 0 0 - /sys/kernel/security
tmpfs tmpfs 2.9G 84K 2.9G 1% /dev/shm
devpts devpts 0 0 0 - /dev/pts
tmpfs tmpfs 2.9G 2.2M 2.9G 1% /run
tmpfs tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
cgroup cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore pstore 0 0 0 - /sys/fs/pstore
cgroup cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio
cgroup cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup cgroup 0 0 0 - /sys/fs/cgroup/perf_event
cgroup cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
/dev/sda5 ext4 40G 4.6G 34G 12% /
systemd-1 autofs 0 0 0 - /proc/sys/fs/binfmt_misc
debugfs debugfs 0 0 0 - /sys/kernel/debug
mqueue mqueue 0 0 0 - /dev/mqueue
hugetlbfs hugetlbfs 0 0 0 - /dev/hugepages
/dev/sda7 ext4 235G 208M 233G 1% /home
fusectl fusectl 0 0 0 - /sys/fs/fuse/connections
gvfsd-fuse fuse.gvfsd-fuse 0 0 0 - /run/user/1000/gvfs

[/FONT]
Concerning the fstab entry, I found the following line on the internet.

Label=XY|uuid=XY|dev/sdXY /boot/efi vfat defaults,noatime,discard 0 1

Is this correct? Since I don’t know exactly which is my efi partition, I am not sure how to get the proper data for fstab. Yast Partitioner also couldn’t find a FAT Partition, I can see my Windows partition and a system reserved 350Mb which i tend to belive is reserved for windows, both are NTFS dough.

I plan to fix the boot loader and insert an entry for the /boot/efi on fstab. If it does not work, I will try to restore the windwos boot loader and run new installation of open-suse, since I have no data to loose.

I would appretiate your help.

](https://forums.opensuse.org/member.php/49759-nrickert)

Firstly: please always use code tags when posting computer output. That keeps the output in columns, and is easier to read.

You can generate code tags by clicking the “#” symbol in the header of the edit box. Then paste your output between them. It looks like
(code)pasted text(/code)
except that you use square brackets if you want to directly type them.

Secondly, using code tags, please give us the output from:

# parted -l

You will need to be root to run that command. It will tell us about your disk partitions.

Was this a default factory install of Windows 8?? You can install Win 8 as legacy but you do have to go out of your way to do so on newer hardware.

If so it must have a efi boot partition. It is a small usually about 100 meg± FAT formatted partition. Depending on the tools used it may not be labelled as EFI boot but is generally easy to spot because of the FAT format

Since you supplied the partitions and went to expert mode you must make all the choices.

I prefer to simply provide free space for the installer to do it’s thing

Can you boot Windows from the EFI boot menu?? If you can then the efi boot partitions is still there. A EFI installed OS will not boot without it. Since you overrode the Installer defaults and did not know what you were doing you installed in legacy mode and you can not chain to an OS that is installed in EFI mode from legacy mode. THis is why no Windows option in grub.

That’s correct. Windows by default does not expose EFI partition. If you absolutely need to see it under Windows (why?) use


mountvol <drive>: /s

where <drive> is any drive letter of your choice.

Hi,

I had a lot of errors. Therefore, I decided to do a new installation of windows 8 and reinstall opensuse. I have a bootable usb prepared with rufus with efi support. The problem is that no uefi partition is seen, by the partition manager. I have two partitions, which belong to windows. One is 350MB and the other one is 200GB where my windows is installed. I would presume that the smaller one is the uefi partition, moreover, it is designated “system reserved”. The problem is that it is NTFS. I found a tutorial online how to install opensuse with windows 8. As seen in the photos form that tutorial, one of the partitions is clearly uefi.

I tried to start a recovery session and run parted -l, (I am typing this in per hand)


! I am omitting the start and end values form the table
parted -l
Number  Start End           Size            Type         File system            Flags
1                           367MB           primary       ntfs                  boot,type=07
2                           197GB           primary       ntfs                  type=07
3                           303GB           extended                            lba,type=0f
5                           85GB            logical       ext4                  type=83
6                           64899MB         logical       linux-swap(v1)        type=82
7                           210GB           logical       ext4                  type=83                

I have created partitions 3,5,6,7. 4 is missing (don’t know why it is not listed) and the NTFS partitions came with windows.
Is it safe to just mount partition 1 (367MB) which has flags boot, type=07 as /boot/efi and continue the install. Or I am doing something wrong.

Anyone seen something like this. I decided to ask, before doing something stupid and force myself to install windows for the third time :’(.

Ok that is legacy or DOS or MS or MBR (take your pick of the name) partitioning. It has an extended partition thus is not GPT partitioning which is what is used with EFI boot. No such animal as extended or logical partition in GPT only primary.

So It appears you are installing things in legacy mode or this machine does not have EFI BIOS

DO NOT use rufus or any other boot helper program with openSUSE it will not work correctly

Instructions here https://en.opensuse.org/Live_USB_stick

If your computer came with Windows 8, then it almost certainly came with GPT partitioning and UEFI support. I don’t see any of that there. Instead, you have legacy partitioning.

Honestly, my best advice is to start over.

Install Windows first, then opensuse later.

You will probably be able to choose between legacy partitioning and booting, or GPT partitioning and UEFI booting. Either can work. But you must do both Windows and opensuse the same way. I suggest GPT and UEFI, but that’s your choice.

For comparison, here’s the “parted” output for my “/dev/sda” (which has Windows 8.1 – opensuse is on a “/dev/sdb”)


# parted /dev/sda print
Model: ATA WDC WD10EZEX-75Z (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 


Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  525MB   524MB   fat32        EFI system partition          boot
 2      525MB   567MB   41.9MB  fat32        Basic data partition          hidden
 3      567MB   701MB   134MB                Microsoft reserved partition  msftres
 4      701MB   1226MB  524MB   ntfs         Basic data partition          hidden, diag
 5      1226MB  498GB   497GB   ntfs         Basic data partition
 6      498GB   498GB   367MB   ntfs                                       hidden, diag
 7      987GB   1000GB  13.7GB  ntfs         Microsoft recovery partition  hidden, diag

Notice that there is no mention of extended or primary partitions, because this is GPT. And the EFI partition is clearly identified.

If you stay with legacy partitioning and legacy booting, that’s fine too. It can work either way. But mix and match doesn’t work.

My suggestion: Install Windows first. Then get back to us with updated “parted -l” output. And we can advise how to proceed from there.

Hi,

The extended partition was created by me, I had windows installed on about 200GB and the rest 300GB were left unallocated. I created the extended partition, by choosing the expert option and simply adding it. I chose the extended option, because this was done in an online tutorial. In fact, I had windows 8 installed and those partitions (3,5,6,7) remained there from my last failed attempt to install opensuse. So I can delete the extended partition allotgether and create new one. Will that help me?

The problem is that windows is installed by our adimnistrators and re-installing it yet again will cause inconvenience.

Are you able to boot Windows? Or not?

If you are able to boot it, or if your administrators can repair booting for it, then there is no need to install. In that case, you just need to get opensuse working in a way that is compatible with Windows.

If you cannot boot windows and cannot repair that, then you will probably need to reinstall.

I have a fresh intallation of windows. I can boot it actually i am using it in the moment. As explained above the extended partition and the other linux partitions are on part of the hard drive, which was not updated. They are legacy of my faild open suse installation. The problem now is what should I do with opensuse to make it work. I don’t have DVD player, so I would have to use USB. Should I delete the exteneded partition and create something new?

Understand as it is now you are booting in legacy mode you must install openSUSE in legacy mode assuming your computer does have EFI BIOS. If this is an older machine it probably has the older BIOS if new it has EFI (all new machines come with EFI).

There is nothing worng with using legacy even on a newer machine but you do have to be aware of the differences. On older hardware you can not install EFI mode it is all legacy. Extended partition only can exist on MBR/DOS/MS/legacy structured drives GPT does not have or allow them. If this is a newer machine you must be sure to boot the install media in legacy mode. If older it does not matter it will boot in legacy mode period.

Using MBR/legacy mode and dual booting it is best to leave a generic or even MS boot loader in MBR. This reduces the chance of Windows messing up the boot. There are severl ways to set this up none absolutly wrong but leaving a generic boot in MBR is best if dual booting. You want to install grub2 into the partition that contains /boot this is normally the root partition unless you opted for a separate boot partition. If in an extended install grub to the extended partition. And then install generic boot code to the MBR.

The boot flag (note another thing that does not happen in GPT) should be set to the partition you installed grub2 to. Should happen anyway but something to be aware of.

IMHO it is best NOT to pre partition just leave free space let the installer make a proposal. You can always change it but it generally will set things up in a workable format

Okay.

Choice 1: reinstall opensuse.
Choice 2: reinstall just grub2 to fix the booting.

Your choice.

I don’t have DVD player, so I would have to use USB.

That should be fine. I do all of my installs via a USB.

Should I delete the exteneded partition and create something new?

I would not do that. If you decide to reinstall, then at the partitioning section of the install you can select “Create Partitioning”. That will present a list of partitions. Right-click on a partition to change how it is used.

For “/dev/sda5”, you will probably want to select “format as ext4” and “mount as /”
For “/dev/sda6” you will probably want to select “mount as swap”. Whether you format as swap is probably not important, but it won’t hurt do that if you are unsure.
For “/dev/sda7” you will probably want to select “do not format” and "mount as “/home”. Note that I’m partly guessing as to how you have been using the partitions.

The big issue will be on booting. You will need to get that right, whether you just want to fix booting or whether you reinstall. I’ll go through the options in a followup post.

How you boot the install USB can be important. If your BIOS is set to allow UEFI booting, then it might boot in UEFI mode, and that will result in confusing messages. It is best to boot the installer in non-UEFI mode.

How to tell? If you booted on legacy mode (non-UEFI), then the boot screen for the installer will list some function key options at the bottom of the screen. If you boot in UEFI mode, those options won’t be there. So it should be easy to tell.

Boot options for the installed system:

Since you are using legacy partitioning, you need to use “grub2” for booting (not “grub2-efi”). If reinstalling, then there’s a point in the install where it gives a summary screen with several headings. You can click on any heading to make relevant changes. So you will need to click on the Booting heading (I’m not sure of the exact wording). You should make sure that the boot loader is set to “grub2” and not to “grub2-efi”. There are other selections on where to install grub2. So I’ll go over those.

Places to install grub2:

In the MBR: This is pretty sure to work, though there’s a risk that Windows will overwrite it at some future time. I think the risk is small, but if you have Windows 8 and upgrade it to Windows 8.1 or Windows 10, that’s where Windows might overwrite the MBR.

On the extended partition: this will probably work, but there is a greater risk that Windows will overwrite it.

On the root partition (on “/”). This won’t initially work, but can be made to work very reliably by adding an entry to the Windows boot manager. If you decide on this, then also check the box “install generic code in the MBR” while installing. That makes it easier to get the system to boot.

On both “/” and the extended partition. I think this is the installer default. I have heard of problems when you install grub2 in two different places, so I advise against it.

At this stage, I’ll wait till I hear what you are going to do.

Hi,

First of all, I would like to thank you for your help. I really appreciate the fact that you have invested so much of your time to teach me how to do things in the proper manner.

Here is a summary of what I have:
Windows 8 that boots normally.
Bunch of partitions that remained form the last open suse installation
A usb with opensuse 13.2. Created with rufus - option used MBR partition for UEFI
My laptop is Lenovo E320, it is few years old. The bios, according to the system information of windows is “legacy”. (Actually it is in German and is called “vorgängerversion” - legacyversion.)

What I don’t understand.
Which option of UEFI should I use to crate the bootable usb:
1 MBR partition scheme for BIOS or UEFI
2 MBR partition scheme for UEFI
3 GPT partition scheme for UEFI

If i booted with with the correct rufus – prepared USB, would that guarantee me that I am booting in non-UEFI mode. Then I will properly format the partitions (you guessed correct I have prepared already \home, , and \swap), I wil use ext4.
But what exactly is the MBR. Perhaps it is this partition?


1                           367MB           primary       ntfs                  boot,type=07
 

The last time when windows stopped booting, I tried installing grub-2 on the MBR, by clicking on the summary screen menu. Then windows disappeared and my admin told me that I have damaged the MBR. Should I somehow mount the MBR as was the case with the UEFI partition? Perhaps I should mount it as boot without changing the format? I would like to understand this part correctly, because I don’t want to have nasty surprises.

DO NOT use Rufus or any other boot helper app to make the USB. Because it adds things to the iso it breaks the iso. Some Linux distros need this openSUSE does not.

The openSUSE iso is made to boot from the USB or DVD. Follow the instruction here (note the procedure is same for the live ISO’s or the full installer iso)

https://en.opensuse.org/Live_USB_stick

In short all you need to do is do an unmodified binary copy to the device that is all that imagewriter does. In Linux I use the copy command to copy direct to the device.

You are making it harder then it has to be :stuck_out_tongue:

Note that old BIOS do not call themselves legacy that is a term that is used by EFI based BIOS’s to refer to the old way of doing things. An old BIOS would not refer to itself as legacy. So it may appear that you have an EFI BIOS but using the legacy mode. Only a couple of years old means it probably is EFI did it come with Windows 8?? All machines made since Windows 8 released are EFI BIOS

Note the MBR is the name given to the first sector on the hard drive it is NOT a partition and does not show as a partition. When a computer boots in the old legacy/MBR mode it first looks for code at the fist sector of the first hard drive for further instruction. This is the MBR code and it lives at the first sector of the drive. Depnding on exactly what code is there it may do various things but it is the first step in the boot strapping of the operating system.

An EFI boot doe not use the MBR nor any code there it looks for a special efi boot partition and follows instructions there.

Back to MBR boot

MBR boot code is very small just a couple of hundred bytes of assembly code it’s purpose is to hand the boot off to some other program. For our purposes we only need to know 3 cases. First is MS boot code. Second is generic boot. Third is Grub boot code. MS and generic work the same. The BIOS starts the code and the code looks for a special boot flag on a partition. It then hands off to the code that lives in the first sector of that partition. Which in turn hands off to more sophisticated code which know how to read the file system and then eventually loads the kernel and starts the OS rolling.

So with generic or MS boot code you need a boot flag to tell it where to continue with the boot. Which brings use to grub boot code. Grub code is a little smarter and is told at installation where the boot is to continue so no boot flag is needed or used. Trouble is in a dual boot with Windows is the Windows hates all other os’s and sometimes with a major update will override your selected boot method ad rewrite both the MBR code and set the boot flag to itself thus making the other OS invisible to the boot process. Thank you MS. :X So it is best to use generic MBR code since it is functionally the same as MS and uses the boot flag. Yes Windows may still reset the boot flag but that is trivial to fix in either OS.

So when you put generic in the MBR you need to install grub to the partition that contains the /boot directory which is normally the root partition in Linux or if is in an extended then to the extended. If you simply leave space the installer knows all this stuff and generally will select the right way though you may have to adjust where grub goes and/or the generic MBR. Note that a grub in the MBR is ok it is just that Windows does not play well with others.

Now you know more then you ever wanted to about how a computer boots rotfl!

The commonly used method (copy PBR) is not “very reliable”. It needs manual intervention every time GRUB is updated, otherwise openSUSE most likely fails booting from Windows boot manager.

Do you mean this one or something different? It is possible to create small grub image that will work very reliably indeed, but as I do not have configuration to finalize the details I hesitate to push it. If I could work with someone with dual boot setup to create tool that automates such image creation, we could provide it (may be even as part of GRUB distribution itself).

Hi,

Thank you for providing me with this information, but I am still in the dark regarding the actual installation. :frowning:

I am using windows to prepare the usb. So I would have to use ImageWriter herunter.

My laptop is Lenovo E320, was bought in 2011 and came with windows 7.
My problem boils down to this. I have 3 partitions created , \home,\swap. I have 2 NTFS partitions form Windows 8. One of them is ~360MB the other is 180gb. Non of the partitions is identified as uefi. Therefore, the info given here

does not apply. Because the uefi partition is not at hand. So I have noting to mount. I might speculate that the 350MB partition form windows is the UEFI, and mount it, but I don’t know what will happen.
I tried to write grub2 on the MBR but this made windows disappear.
Can you give me step by step instructions how to install opensuse. I am not that familiar with the highly technical details, after all I am not a computer scientist. I need just a clear recipe.