Vista/Opensuse dual-booting with GRUB

I installed Opensuse 11.3 on a separate partition to vista on my Acer 5115. It runs fine but the GRUB boot loader failed to show the Vista OS. I tried to add it by editing menu.lst so it contained:

title Windows Vista
root (hd0,x)
savedefault
makeactive
chainloader +1

With x changed from 0 to 4 (although it should be 4).
I ran a boot_info_script to see what was going on, the results were:

                Boot Info Script 0.55    dated February 15th, 2010                    

============================= Boot Info Summary: ==============================

 => Grub 0.97 is installed in the MBR of /dev/sda and looks on the same drive 
    in partition #4 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: _________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files/dirs:   /bootmgr /Boot/BCD /ntldr /ntdetect.com

sda2: _________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Windows Vista/7
    Boot sector info:  
sda5: _________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:  According to the info in the boot sector, sda5 starts 
                       at sector 63.
    Operating System:  Windows Vista
    Boot files/dirs:   /Windows/System32/winload.exe

sda3: _________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  
sda4: _________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub
    Boot sector info:  Grub 0.97 is installed in the boot sector of sda4 and 
                       looks at sector 245776496 of the same hard drive for 
                       the stage2 file. A stage2 file is at this location on 
                       /dev/sda. Stage2 looks on partition #4 for 
                       /boot/grub/menu.lst.
    Operating System:  Welcome to openSUSE 11.3 "Teal" 
                       - Kernel ().
    Boot files/dirs:   /boot/grub/menu.lst /etc/fstab

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot         Start           End          Size  Id System

/dev/sda1                  63    18,426,554    18,426,492  27 Hidden HPFS/NTFS
/dev/sda2          18,426,555   165,806,864   147,380,310   f W95 Ext d (LBA)
/dev/sda5          18,426,618   165,806,864   147,380,247   7 HPFS/NTFS
/dev/sda3         165,808,128   170,016,767     4,208,640  82 Linux swap / Solaris
/dev/sda4    *    170,016,768   312,561,663   142,544,896  83 Linux


blkid -c /dev/null: ____________________________________________________________

Device           UUID                                   TYPE       LABEL                         

/dev/sda1        147C11B916D9B5D2                       ntfs       PQSERVICE                     
/dev/sda2: PTTYPE="dos" 
/dev/sda3        c30956a0-f20b-4d43-b2d7-d0d7e6da1849   swap                                     
/dev/sda4        2c497a66-eb96-42b3-a4f4-e150ab759575   ext4                                     
/dev/sda5        16C0B0EBC0B0D1EB                       ntfs                                     
/dev/sda: PTTYPE="dos" 

============================ "mount | grep ^/dev  output: ===========================

Device           Mount_Point              Type       Options

/dev/sda4        /                        ext4       (rw,acl,user_xattr)
/dev/sda5        /windows/C               fuseblk    (rw,noexec,nosuid,nodev,allow_other,blksize=4096,default_permissions)


=========================== sda4/boot/grub/menu.lst: ===========================

# Modified by YaST2. Last modification on Sat Jan 22 01:46:03 GMT 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

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

title		Windows Vista
root		(hd0,4)
savedefault
makeactive
chainloader	+1

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3
    root (hd0,3)
    kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part4    resume=/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part3 splash=silent quiet showopts vga=0x317
    initrd /boot/initrd-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3
    root (hd0,3)
    kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part4 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-2.6.34-12-desktop

###Don't change this comment - YaST2 identifier: Original name: linux###
title Kernel-2.6.34-12-desktop
    root (hd0,3)
    kernel /boot/vmlinuz-2.6.34-12-desktop root=/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part4    resume=/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part3 splash=silent quiet showopts vga=0x317
    initrd /boot/initrd-2.6.34-12-desktop

=============================== sda4/etc/fstab: ===============================

/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part3 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part4 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD1600BEVS-22RST0_WD-WXE207A82624-part5 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

=================== sda4: Location of files loaded by Grub: ===================


 115.1GB: boot/grub/menu.lst
 125.8GB: boot/grub/stage2
  87.3GB: boot/initrd
  87.3GB: boot/initrd-2.6.34-12-desktop
 125.8GB: boot/vmlinuz
 125.8GB: boot/vmlinuz-2.6.34-12-desktop
=============================== StdErr Messages: ===============================

  No volume groups found
mdadm: No arrays found in config file or automatically

As far as I can see (and I don’t have much experience with these things) the Vista OS is there, on sda5, but doesn’t boot correctly because the winload.exe is in the wrong directory. Why the sdax numbers are all rearranged is a mystery too, but I have reinstalled vista several times so that could be why.

I don’t have a vista recovery cd (wasn’t given one), is there any way to fix this within opensuse (which works fine)?

Thanks

When Vista is on sda5, that is on an extended partition. Could it be that Vista can not be booted from an extended partition? (I have no knowledge about Vista whatsoever).

You understand that you have the following (somewhat strange) partition:
sda1: primary
sda2: extended and containing one logical partition sda5
sda3: primary
sda4: primary
I do not know why you have an extended containing only one logical and no space left. In that case sda2 could have been a primary and that is it.

I used the manual partition option when installing opensuse because it wanted to shrink the windows partition so it had no space, I thought I told it to install opensuse in the already existing extra partition.

Can you recommend anything that I could do to try and fix it?

I take it you weren’t as imaginative as user @idee (Invalid partition table - parted magic 5.8 - grub) and didn’t move Windows from a primary into a logical partition just to see how it would feel like. Hmmm … Wait for LostFarmer then!

  • Oh, I didn’t see your answer. That explains the mess.

I think this is why the partitions are so:

sda1: laptop recovery partition (I think)
sda2: original vista partition (factory)
sda5: second vista partition created after dodgy reinstalls or maybe a result of manual partitioning at opensuse installation
sda3: linux swap
sda4: linux

As hcvv already pointed out, sda2 is (now?) an extended partition (just a container for other partitions).

I realise that, does that prevent GRUB from being able to boot windows? Can I change something to enable it?

I can just wipe and start again but that isn’t preferable, I’d rather leave it as a last resort.

Well, as it seems logical that you rather want advice how to recover then on how it should have been done if … (I, btw would even have wiped the Vista and recovery partition completely :slight_smile: for them never to return), I will give a first proposal. Many others will come with amendments or complete other proposals, so be prepared.

I would use fdisk from a live CD (any Linux one), delete the logical (sda5), delete the extended (sda2) and create a primary (sda2) on exact the same place as the old sda2. Then I would reinstall Vista >:( and then use one of the threads in this forum that tell you how to recover your GRUB boot from a Vista install.

Any comments in this?

Try this

Partitioning external drive for Linux

Hmmm … You could try to delete partition 5 and partition 2. Notice that delete a partition doesn’t mean delete its content. Then create a new primary partition. Again notice that create a partition doesn’t mean format its filesystem. So basically, by deleting these 2 partitions you won’t lose data - at this point. Then you can assign sda2 the type NTFS. An then probably use some Windows command I don’t recall to fix the bootsector - but not the mbr! But rather wait for a Windows dualbooter to look around here and provide a better advice, as I haven’t touched this OS for many years (it’s bad for my nerves).

hcvv: the aim is not to uninstall anything, but to modify the grub boot files (or other files) in such a way that booting the existing vista is now possible

Yes that’s what I would do, then give sda2 the type 0x07. It might be necessary to fix the bootsector afterwards. Or wait for LostFarmer!

@please_try_again’s method:
It is almost the same as I proposed. But you try to conserve the contents of the Vista partition. But imho sda5 will start a bit further then sda2 because sda2, as extended partition, has in its first block the description of sda5. After that sda5 starts. But the data of new primary sda2 will start immediatly in it’s first block.

And the method is to read first the answers we provide.

That would only be possible if booting Vista from a logical partition is possible at all. Which until now nobody confirmed (but after all we are Linux people, what do we know about Vista?).

OK, that option is seeming more convenient (quicker). If I do go ahead with it, as an inexperienced linux user, would it be possible for you to write some detailed instructions on the whole process (I realise that might be a pain, but even a few bits would be helpful)? (assume I’d be able to get hold of a Live cd and a vista disk)

LostFarmer and Swerdna did confirm that it was possible, although definitely not advisable.

I wonder how many problems are related to Windows in this forum? Microsoft does not only pollute the life of those who use Windows but also takes the time of those who don’t use it. There is no way out. :frowning:

Yep. That’s why I said that fixing the Windows boot sector could be necessary afterwards. I guess it would be easier for the OP - as I doubt he would edit the bootsector.

It is not only the bootsector. The file system would not start any more at the beginning of the partition. There would first be some spare space (512 bytes?) where the partition administration was earlier. Thus I think that no system would recocnise that there is a file system on the new sda2.

Your windows sda2 primary partition suddenly becomes an extended containing windows in sda5?
The installer by default, does NOT do this, without knowing what you did, my advice is backup all data, then delete sda2, 3, 4, and 5. reinstall windows, then Linux. Your linux system is a fresh install anyway, and windows is a mess.

Well, that’s my point of view!