Can't boot into Windows after openSUSE install

Hi, I just switched from Fedora to openSUSE 12.1 and so far it’s great! Unfortunately I think I did something wrong, since now I can’t boot into my Windows partition. I’m running a dual-boot system with OpenSUSE 12.1 (32-bit) and Windows 7 Professional (64-bit).

To install openSUSE, I deleted all Fedora Linux partitions from Windows 7 Partition Manager, then ran the openSUSE install disk. I can now boot into openSUSE fine, but if I try to boot into Windows, I get an error message saying “BOOTMGR is missing”.

I have also read tutorials that said to use the Windows 7 installation disk and run “bootrec /fixmbr”, but when I click repair on the installation disk, it asks to select an operating system to repair and the box is blank, so it couldn’t find my Windows installation. But I’m pretty sure it’s there since I can access my C and D drives from Linux.

This is my fdisk -l:


Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x67b47025

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     3074047     1536000   27  Hidden NTFS WinRE
/dev/sda2         3074048   137291775    67108864    7  HPFS/NTFS/exFAT
/dev/sda3   *   137291776   955572223   409140224    f  W95 Ext'd (LBA)
/dev/sda5       205432832   834578431   314572800    7  HPFS/NTFS/exFAT
/dev/sda6       137293824   145678335     4192256   82  Linux swap / Solaris
/dev/sda7       145680384   205422591    29871104   83  Linux
/dev/sda8       834580480   955572223    60495872   83  Linux

Partition table entries are not in disk order

My /dev/sda2 is my C drive, where I installed Windows 7 to.

This is my /boot/grub/menu.lst:


# Modified by YaST2. Last modification on Wed Nov 23 03:22:05 PST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,6)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1
    root (hd0,6)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-Hitachi_HTS545050B9A300_100822PBN40017J5XTUE-part7 resume=/dev/disk/by-id/ata-Hitachi_HTS545050B9A300_100822PBN40017J5XTUE-part6 splash=silent quiet showopts vga=0x317
    initrd /boot/initrd-3.1.0-1.2-default

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd0,1)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1
    root (hd0,6)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-Hitachi_HTS545050B9A300_100822PBN40017J5XTUE-part7 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x317
    initrd /boot/initrd-3.1.0-1.2-default

Any suggestions on how to fix this?

II managed to fix this by changing the grub file to hd0,0 instead of hd0,1 for the windows boot. Now I can boot into windows fine.

Hello,

A similar problem occured here that could be solved by the previously given solution. I would like to ask some additional questions.

On my laptop there was initially a Windows 7 64-bit system installed on a 445GB hard drive. Using the Win7 Shrink tool, I brought it down to ~100GB.

Intending a dual-boot machine, I burned an OpenSuse 12.1 64-bit network installation disk and installed the system. During the installation, I added some partitions following ideas mentioned at opensuse 11.2 unable to create / partition >20gb by using “Edit Partition Setup”. Specifically, I did not touch any partition other than “/”, “/boot”, “/home” or similar, foremost nothing Win7 related. This method proved to work under OpenSuse 11.4 and earlier.

At reboot, the menu had only two entries, “Desktop – openSUSE 12.1” and “Failsafe – openSUSE 12.1”, yet no Win7 option. Under OpenSuse 11.4, the pre-existing Win7 32-bit partition was correctly recognized and included into the boot menu.

I edited /boot/grub/menu.lst and added the above mentioned section for Windows using (hd0,0). It is now possible to boot into Win7. Checking in Yast - System - Boot Loader, I find the following entry:

Label: Windows
Type: Other
Image / Device: /dev/sda1

Details found when editing this entry:

Section Name: Windows
Section Settings: Other System /dev/sda1
Do not verify Filesystem before Booting
Block Offset for Chainloading: 1

For reference, the output from fdisk -l :

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x80794b31

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4306943     2152448   27  Hidden NTFS WinRE
/dev/sda2   *     4308992   976771071   486231040    f  W95 Ext'd (LBA)
/dev/sda5         4311040   210810879   103249920    7  HPFS/NTFS/exFAT
/dev/sda6       937854976   948094975     5120000   27  Hidden NTFS WinRE
/dev/sda7       948099072   976771071    14336000   27  Hidden NTFS WinRE
/dev/sda8       210812928   215029759     2108416   82  Linux swap / Solaris
/dev/sda9       215031808   288430079    36699136   83  Linux
/dev/sda10      288432128   309395455    10481664   83  Linux
/dev/sda11      309397504   937842687   314222592   83  Linux

Partition table entries are not in disk order

Questions:

Q1: Why was the Win7 partition “forgotten” to be included in the boot menu?

Q2: What is the quick explanation of the difference between “(hd0,0)” and “(hd0,1)”, and why is this difference important with my disk partition setup?

Q3: How exactly do the additional lines in menu.lst correspond to the settings I find in the Boot Loader interface?

Q4: Where can I find more information about the topics mentioned in Q2 resp. Q3?

In your replies, please be as specific as possible since I am usually rather a top-level user of Linux.

Thanks in advance.

That’s probably because it is a hidden partition. Your main Windows partition is probably sda5, with sda1 hidden but still used as a boot loader. (I am guessing here).

Grub counts from zero, so (hd0,0) is the same as sda1.

I’m not quite sure what you are asking in the other questions.

Thank you for the clarifications so far.

Q3 is basically answered by what nrickert replied to Q2: If one wanted to create an entry in the boot menu using the Boot Loader interface (the method I would usually prefer), the correspondences to the lines in menu.lst are the following:


menu.lst                         Boot Loader
-------------------------------------------------------------------
title Windows              <--   Section Name: Windows
    rootnoverify (hd0,0)   <--   Do not verify Filesystem before Booting | Other System /dev/sda1
    chainloader +1         <--   Block Offset for Chainloading: 1

Q4 goes into the direction of understanding, e.g., why one has to use “rootnoverify”, or what the meaning of “block offset” is, or what would happen if the block offset were set to “0” or “+2”.

An additional

Q5: Recognizing the Win7 partition under OpenSuse 11.4 worked whereas under 12.1 it did not work. Does it depend on the fact that this was done on two different machines from two different manufacturers (11.4 on a Dell, 12.1 on a Fujitsu)? Is there a way to avoid such glitches?

Thanks again.

I’m not certain, but I think the “rootnoverify” has the effect that the partition is not checked when installing grub. The alternative would be to use “root”. If the line were for booting from a floppy, you would be asked to insert the floppy while installing grub, while with “bootnoverify” you don’t have to insert the floppy until really needed.

I inadvertenly tried the 0 (in place of 1) on the chainloader line a few months ago. That boot entry didn’t work until I fixed it.

This manual might prove helpful: Command-line and menu entry commands - GNU GRUB Manual 0.97

On your Q7, was the partitioning the same on the two machines?

On my system, where both Windows partitions are primary (instead of one being an extended partition), and where both are tagged as NTFS (rather than hidden NTFS), I get two boot menu entries (“windows 1” and “windows 2”).