openSUSE 13.2 didn't detect Windows 7

Hello all,
I installed Windows 7 and openSUSE on separated hd’s.
First I installed Windows 7 on ssd, which connected via mSATA.
Then I installed openSUSE 13.2.
I set openSUSE hd to be the first to be loaded via the BIOS.
But, grub didn’t detect my Windows 7 installation.
I tried to edit 40_custom file in /etc/grub.d, but still without succeed.
I will be more than happy to get some assistance with this issue.

parted -l
Model: ATA WDC WD1003FZEX-0 (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 165MB 164MB fat16 primary boot*
  • 2 165MB 8751MB 8587MB linux-swap(v1) primary*
  • 3 8751MB 73.2GB 64.4GB btrfs primary*
  • 4 73.2GB 181GB 107GB xfs primary*

Model: ATA SAMSUNG MZNTD256 (scsi)
Disk /dev/sdb: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
*Disk Flags: *

Number Start End Size Type File system Flags

  • 1 1049kB 106MB 105MB primary ntfs boot, type=07*
  • 2 106MB 149GB 149GB primary ntfs type=07*
  • 3 149GB 256GB 107GB primary ntfs type=07

***40_custom file
**#!/bin/sh
set -e
#exec tail -n +3 $0

This file provides an easy way to add custom menu entries. Simply type the

menu entries you want to add after this comment. Be careful not to change

the ‘exec tail’ line above.F

echo “Adding Windows 7”
cat << EOF
menuentry “Windows 7” {
set root = (hd0,1)
chainloader (hd0,1) + 1
}
EOF

Error message from boot loader:
*error:not an assignment.
error: invalid file name

press any key to continue

Sincerely,
Tsur.

parted -l
*

Model: ATA WDC WD1003FZEX-0 (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 165MB 164MB fat16 primary boot
*2 165MB 8751MB 8587MB linux-swap(v1) primary
*3 8751MB 73.2GB 64.4GB btrfs primary
*4 73.2GB 181GB 107GB xfs primary


*Model: ATA SAMSUNG MZNTD256 (scsi)
*Disk /dev/sdb: 256GB
*Sector size (logical/physical): 512B/512B
*Partition Table: msdos
*Disk Flags: 

*Number Start End Size Type File system Flags
*1 1049kB 106MB 105MB primary ntfs boot, type=07
*2 106MB 149GB 149GB primary ntfs type=07
*3 149GB 256GB 107GB primary ntfs type=07******************

40_custom file

#!/bin/sh
set -e
#exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.F
echo "Adding Windows 7" 
cat << EOF
menuentry "Windows 7" {
set root = (hd0,1)
chainloader (hd0,1) + 1
}
EOF

Error message from boot loader:

*error:not an assignment.
error: invalid file name

press any key to continue*******************

*fdisk -l

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D28D6837-2B29-4E69-920D-31357AC75452


Device         Start       End   Sectors  Size Type
/dev/sda1       2048    321535    319488  156M EFI System
/dev/sda2     321536  17092607  16771072    8G Microsoft basic data
/dev/sda3   17092608 142929919 125837312   60G Microsoft basic data
/dev/sda4  142929920 352643071 209713152  100G Microsoft basic data


Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2efea122


Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sdb2          206848 290400255 290193408 138.4G  7 HPFS/NTFS/exFAT
/dev/sdb3       290400256 500113407 209713152   100G  7 HPFS/NTFS/exFAT
 



To begin with, I am not an expert on Grub and how it handles multi-boot on different disks.
But I observe two things here.

You have a mix of GPT and DOS partitioned disks. That should of course be no problem, but could explain something.

I assume that sdb has your openSUSE system. But I wonder about the type of the partitions there: 7 HPFS/NTFS/exFAT.
I would expect 82 Linux Swap / Solaris for the swap partition and 83 Linux for your / (and eventual /home and other Linux file systems) partitions. That may be irrelevant for your problem, but it struck me as strange.

Hi, thank you for your replay.
windows is on sdb (which divided to 100GB for C: , 138GB for local partition and 100MB for boot).
Linux is on sda (which divided to 165MB for boot, 8GB for swap, 60GB for root and 100 for home).

Linux partitions types:
boot: FAT
Swap: Swap
root: BtrFS
home: XFS

Thanks for te correction.
BTW what you call partition types above aren’t partition types but the usage you make of the partitions: swap and several types of file systems.

But I do not know enough about GPT to know if partition type "Microsoft basic data " is correct. On the other hand, when the installer created it like that, it most probably is alright.

Let us hope someone with more knowledge about this mix and about EFI may tune in.

I am assuming that “/dev/sda” is your hard drive with opensuse, and “/dev/sdb” is your SSD with Windows.

Your problem appears to be that Windows is installed for Legacy MBR booting, while opensuse is installed for UEFI booting. The two don’t mix.

The reason that they don’t mix is that your firmware (BIOS) will support only one of those. If you start booting with UEFI for opensuse, then the BIOS may disable support for traditional (legacy) BIOS calls. Knowing this, grub2-efi won’t try and does not add Windows to the boot menu.

Your choices, as far as I can tell, are:

  1. Reinstall Windows 7 to use UEFI. I do not know how easy this is.
  2. Reinstall opensuse to use legacy MBR booting. This take the install time, but can be done.
  3. Keep opensuse as is, except switch it to use legacy booting (this is fairly easy to do).
  4. Don’t change a thing. Handle booting through the BIOS. With at least some computers you can hit a key during boot (usually F12) and get a boot menu from your BIOS.

If you decide to reinstall WIndows for UEFI, I won’t be able to help. I have no experience. If you decide on one of the other choices, let us know and I can provide more detailed instructions.

Thanks you all.
You were right.
I had to re-install my Windows with UEFI and it solved my problem.

I have come to the same problem on my latest motherboard with separate windows 8.1 and openSUSE hdd’s. After long hours mining Microsoft’s site it became apparent that their partitioner does no automatically setup the hdd with a gpt partition table… grrr!! I have been pulling my hair out with this problem. Okay I can go into the bios and boot windows, but for elegance this is not ideal :slight_smile: Now if only I had posted to this forum… That’ll teach me :smiley: