VISTA + OPEN SUSE 11.0 DUAL BOOT: Another turn of the screw

Installing and configuring a multiboot OS (being Windows Vista one of them) is an issue well known and documented, specially when the point of view adopted to carry that task to a happy end is read as follows:

  1. Install Windows.
  2. Install Linux
  3. Configure the linux boot loader (grub) to deal with the booting process of both systems.

In this small, quick and dirty guide, I’ll change the focus of step 3), and serve the same purpose doing the following:

  1. Install Windows.
  2. Install Linux.
  3. Configure the Windows boot manager to boot Linux.

This last step involves tools that don’t have anything to do with Open Suse, so some of you may think an Open Suse forum is not the right place to tackle with this subject. Even though I agree with that point of view, I think that an important number of potential Open Suse users will finally give the first step towards Open Suse or whatever Linux distro they wish if they know they can tweak such a delicate multiboot task using tools available in their Windows system they are more familiarized with.
Anyway, some tasks must also be performed from Linux to complement the multiboot deployment plan.

In order to achieve the task, we only need the Open Suse 11 DVD disk and a usb stick hosting a file system supported by the rescue mode kernel. Fat/Fat32 will be ok.

I’ll delve into details. Steps 1 and 2 are the same as always. I won’t tell you how to install Windows nor waste time and space telling you how to install Linux. There are quite a few excelents guides, documents and posts in the Open Suse site covering until the most tiny detail of that procedure.
I want to highlight, though, some points that may ease the process and you might want to be aware of:

a) Before trying to install Open Suse, boot Windows and take the needed actions you find appropriate to get the storage space that will be used by Open Suse: uninstall software, scan, defrag, disable/decrease virtual memory space, repartition and remove whatever FAT/NTFS partition you don’t need so that Open Suse see it as unused disk space. This will make the life easier to you and the yast disk module when the time comes to provision the disk space used by your new linux system.
Yes, I know, yast disk can manage that, and I must say it does a great job. However, in order to make Yast disk work smooth, you have to do all that disk preparations beforehand, so that, why don’t you take advantage of the fact you are logged to Windows and provision all the disk space needed by Open Suse?
Also, be advised that sometimes yast resizing operations performed on ntfs file systems fail mainly because of haven’t also failed to do as suggested at the beginning of this paragraph.

b) Regarding Open Suse 11 install process, double check that you configure grub to be installed in one of the partitions hosting file systems that will be mounted on /boot or on / , but never in the MBR of the disk where Windows is also living. If you do that, what I am about to tell you is not needed anymore, since you have wiped the windows boot manager.
Again, create a small partition (200-300 Mb) hosting an ext3 file system intended to be mounted in the /boot directory of the Open Suse system tree hierarchy. You will install grub into the boot record of this partition. Don’t accept the defaults offered to you by Yast, you will have to choose the expert mode of grub configuration to select the partition device name it must be installed to.

Needless to say, you create all the other partitions your system will need, select your software, do all the other things and finish the installation as ever. Take into account that once Open Suse installation is completed, grub will only be installed in the boot record of the partition you configured yast to do so. That means you won’t be able to boot Open Suse 11 when you reboot the machine, since grub was not installed in MBR and the Windows manager doesn’t know anything about it (yet).
Don’t panic, this situation will only last a few minutes more.

At this point in time we have two systems installed in our disk, but only Windows can be booted. Check that your Windows Vista is still there by booting it as you have always done…still there?..good.

Now, put the Open Suse 11 CD/DVD disk into the DVD driver and boot the machine from it in rescue mode.
If everything goes fine, after a while you will be prompted to type ‘root’ to enter the rescue environment.

A) TASKS TO BE PERFORMED FROM LINUX

Now you have a very basic linux system loaded and a command line shell prompt to type your commands.
Before running any command, plug the usb stick in one of the usb ports and wait a couple of seconds. Now run:

fdisk -l

You will see the device names corresponding to the disks and partitions detected by the kernel. If your system has only an internal sata disk, you will see the devices in them, named probably /dev/sda[1,2,…n] and /dev/sdb[1], the latter being the usb stick.

Now, mount the fat partition in the usb device (I’ ll assume it is sdb1) on the media directory of the rescue environment running this:

mount -o rw /dev/sdb1 /media

And, now run this command:

dd if=/dev/sda2 of=/media/opensuse.bin bs=512 count=1

Please, notice that the value of parameter ‘if’ I am using is the device corresponding to the partition in which grub was installed. Note that I am assuming /dev/sda1 is the bootable (active) partition where your Windows system is installed, while /sda2, … belong to Open Suse. Thus, be very careful when identyfing the partition where grub is installed.
To clarify, what I have done is getting a raw copy of the boot record where the grub loader was installed (sda2) to an external usb disk.
After that, unmount the usb stick, reboot the system, select Windows and log in as an Administrator user. Don’t forget to unplug the usb stick and remove the DVD disk.

**B) TASKS TO BE PERFORMED FROM WINDOWS VISTA **

Now you are back to Windows. All that is left to do in order to have the windows boot manager to load also Open Suse is to tell him about it.
First of all, plug the usb stick and copy the file opensuse.bin to the root directory of the windows active volume, normally C:.

-Now, get a dos command line prompt and tell windows manager to make an OS menu entry for Open Suse:
> bcdedit /create /d “Open Suse 11” /application BOOTSECTOR

-If everything goes fine, the command will give you an long entry ID string you better write down inmediatly, since it will be used in the following commands. It should look something like this: {18914bae-0e58-11aa-9ef4-000cdbc368a1} (mind the braces, they are part of the id).
And now, using the specific boot entry you got before, run (braces must be typed too):
> bcdedit /set {18914bae-0e58-11aa-9ef4-000cdbc368a1} device partition=C:

-Now make it know where the grub loader is stored:
> bcdedit /set {18914bae-0e58-11aa-9ef4-000cdbc368a1} PATH \opensuse.bin

-Tell the windows manager we want Open Suse loader be the last entry displayed in the Os menu:
> bcdedit /displayorder {18914bae-0e58-11aa-9ef4-000cdbc368a1} /addlast

-Finally, tell it to wait a given number of seconds for you to select the OS you want to boot:
> bcdedit /timeout 8

That’s all there is about it. Reboot the machine and check if it works.

Summarizing, what we have done is telling the windows manager to chainload to grub. Thus, even though the windows boot manager doesn’t know how to load Open Suse, it can be configured to delegate that task to other boot managers, like grub.

By the way, this is appliable only to Windows Vista. Doing the same thing for Windows XP is also likely but the steps to be performend from Windows XP are different.

Hope this helps.

Regards.

Is it really necessary when there are good boot managers very easy to configure without all the difficulties of bcd or grub, letting them do the dirty job of booting their native operating systems?
I used over the time bootmagic then xosl and now gag. I read of a lot of troubles preparing multi booting pcs. Problems that i never had. And what if someone wants to boot also solaris or osx86? Only my 2 cents

@carboncore -

Nice write-up, especially explaining using Vista’s default bcdedit tool, given that it is so bloody arcane.

Note that there is a freeware alternative which has gotten wide positive press. It’s EasyBCD from Neosmart. It provides a very friendly gui to do what bcdedit does. The only prerequisite is to have installed grub in the openSUSE partition boot sector (as you describe); however, copying the sector to feed to bcdedit is not required.

Yes easybcd is a lot nice choice but it is limited to vista linux and osx86 tiger. And anyway you have to relay on a running os:vista. Gag is independent from any os! This is why i prefer it

I understand why you like Gag; that’s cool. But EasyBCD is really targeted towards the typical Windows Vista user. (And it does also support W2K, XP, Server, Solaris, and BSD.)

Hi mingu. Thank you i did not know that easybcd was able to boot solaris. But i decided to trow it away when switching from osx86 tiger to osx86 leopard it was not able to boot the system. Any news? Note: at the time both gag and grub was able to boot all my os. But i agree: this is a kind of needings that outperform the ones needed by most of the users.

I would have done the same. I trust it with BCD, and it looks to have been built well, but I don’t know that I would use it for EFI.

Thanks for the great instructions! They were very clear and everything ran perfectly right up to the very end.

The problem is that when I rebooted my Windows Vista Ultimate 64 system, the boot loaded showed my two choices. If I pick vista, or leave it alone, it loads vista just fine. If I pick the OPENSUSE choice, I get a white on black text screen with four letters in the top left corner that say GRUB.

Then… nothing. Nothing ever happens after that. I have to reboot.

What did I do wrong? I was very careful to follow the instructions precisely. :’(

Attached is the output from fdisk -lu (obtained from booting in rescue mode).

Also, I have no grub.conf in /etc
I specified it to be installed under the /boot dir in the install. And I have no /boot dir. Dont’ know why :frowning:

/dev/sde4 is supposed to be my boot partition


Disk /dev/sda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders, total 320173056 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xfdf610dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   320167935   160082944    7  HPFS/NTFS

Disk /dev/sdb: 37.0 GB, 37019566080 bytes
255 heads, 63 sectors/track, 4500 cylinders, total 72303840 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x817862ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   144605183    72301568    7  HPFS/NTFS

Disk /dev/sdc: 37.0 GB, 37019566080 bytes
255 heads, 63 sectors/track, 4500 cylinders, total 72303840 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdd: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders, total 145226112 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xdbb4f8f8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048   145223679    72610816    7  HPFS/NTFS

Disk /dev/sde: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6ed6f8d2

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1              63     4209029     2104483+  82  Linux swap / Solaris
/dev/sde2         4209030    46154744    20972857+  83  Linux
/dev/sde3        46154745   247497389   100671322+  83  Linux
/dev/sde4   *   247497390   250067789     1285200   83  Linux

Disk /dev/sdf: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders, total 145226112 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xdbb4f8c5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1            2048   145223679    72610816    7  HPFS/NTFS

Disk /dev/sdg: 1000.2 GB, 1000215724032 bytes
255 heads, 63 sectors/track, 121602 cylinders, total 1953546336 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xcb28a5a2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1           16065  1953536129   976760032+   f  W95 Ext'd (LBA)
/dev/sdg5           16128  1953536129   976760001    7  HPFS/NTFS

Good news, bad news. The bad is that the instructions in this rather older thread (tech moves at the speed of light) really takes the long way around - at the time that made sense because, while Vista’s new boot manager is powerful and flexible, the utility program (bcdedit) that Microsoft’s provides for configuring bootmgr is just awful. Furthermore, the technique above requires making a copy of the openSUSE boot sector and putting that in the Windows directory; if that sector was copied from a different disk that can cause a problem.

The goods news is that there is now a much better, easier, and more reliable way to do this. First, we dispense with using MS’s horrific bcdedit tool altogether - we still use the Vista bootmgr and its bcd database, just with a vastly superior configuration tool. So go here and download this EasyBCD. The program is EasyBCD (you’ll note all the awards it has received). Before installing it while still on the site, go to the tutorial under the linux section. The key detail to understand is that you need to know which disk/partition your openSUSE grub is installed on, and that can be on any partition on any disk. You do not need to make a copy of the boot sector with dd and copy it to Windows, nor do you need to use a USB stick. So your first step is to just get EasyBCD installed. You could just go ahead and try doing the set up now in EasyBCD, but from your description I suspect there may be a glitch in your grub installation, so hold off on using EasyBCD for the moment. You are also eventually going to need to remove the bcd entry for that copied boot sector.

So the second step is to make sure that grub is installed correctly. Your fdisk shows 3 linux partitions on sde, which probably means you created a separate /boot partition. From the sizes (and where the boot flag is set, note the asterisk), it appears that the root is sde2, /home is on sde3, and /boot is on the small sde4. So boot from the DVD into Rescue System, login as root, and do the following:


mkdir /mnt/sde2
mount -t ext3 /dev/sde2 /mnt/sde2
mount -t ext3 /dev/sde4 /mnt/sde2/boot
cat /mnt/sde2/etc/grub.conf
cat /mnt/sde2/boot/grub/device.map

Post back the output of the two cat commands (unless there was an error on the mounts, in which case post that back). If the above confirms that there is no /etc/grub.conf, that means that grub was not installed at all during your openSUSE installation. If it is there, it will tell us how grub was installed. If need be, we can easily reinstall grub from the command line. What is critical is knowing what the openSUSE installation thought the boot disk sequence is.

Also would be helpful to know what the 37GB disks are for; it appears you are booting from the first one (sdb) and that the second is not being used (is has no partitions). Also, please remove that 1GB stick while we are getting this set up.

Mingus,
thanks for posting about EasyBCD. i have read a number of threads with you commenting about EBCD working well. .
I read about it before i installed Ubuntu on my vista box. I used Wubi to do it, but have been wanting to try Suse. I will have to give EBCD a shot with Suse.
Ultimately i want to install suse on my G4 PPC…

Hi, Mingus, thanks so much for helping!!

Regarding your question about use of discs, I have two raids controllers on my system. My Vista 64 boot is a raid1 set of two drives. Then I have two more discs configured as standalone ata drives on raid controller 2. All these discs are used by my Vista system. Perhaps because they are raid controllers the OpenSUSE is getting confused by them. Doesn’t matter, I don’t want to use them for OpenSUSE or for them to be accessed by OpenSUSE.

The /sde drive (Corsair drive) is a new drive totally dedicated to OpenSUSE, and /sde4 is the boot partition.

Here is the output of the two files you asked for:

grub.conf:

setup --stage2=/boot/grub/stage2 --force-lba (hd0) (hd0,3)
quit

device.map

(hd2)	/dev/disk/by-id/ata-WDC_WD360GD-00FLA1_WD-WMAKE1664304
(hd4)	/dev/disk/by-id/ata-WDC_WD740ADFD-00NLR1_WD-WMANS1333563
(hd0)	/dev/disk/by-id/ata-CORSAIR_CMFSSD-128GBG1D_09051315-108484
(hd3)	/dev/disk/by-id/ata-WDC_WD740ADFD-00NLR1_WD-WMANS1331702
(hd1)	/dev/disk/by-id/ata-Maxtor_6Y160P0_Y605SBQE
(hd5)	/dev/disk/by-id/ata-WDC_WD360GD-00FLA1_WD-WMAKE1627811
(hd6)	/dev/disk/by-id/ieee1394-00402602e001b138:00043c:0000

I have not yet changed anything on my Vista boot loader, per your instructions. It still shows both systems.

I’m not sure why grub.conf shows (hd0,3) instead of (hd0,4), unless it starts at zero and 0,3 is indicative of /sde4

Glad to be of some assistance . . .

OK, understand your disk layout. And you’re right, shouldn’t be a problem given you are not accessing the array from linux anyway.

For ref as to why what you did failed to work, 2 reasons: First, you copied a partition boot sector from a different disk than the boot disk. When grub stage1 is installed, embedded in the sector is the disk sector address of where grub should find its loader program (/boot/grub/stage2) on its disk. Grub stage1 has no way of knowing which boot disk it is on, and no way of knowing that the stage2 address is actually for a different disk. That is why you got “GRUB” and nothing more; that was the stage1 program running but hanging after being unable to follow the address. Second, during your installation grub was not installed to a partition boot sector, it was installed to the sde MBR, and multi-booting only works by chainloading to a partition boot sector; it does not working chainloading to the disk boot sector.

You guessed correctly re (hd0,3) - grub’s disk/partition notation begins with zero (Windows numbers disks from zero and partitions from one).

We could try to fix grub with the DVD repair, but I think the following hands-on method is better because (a) you have those arrays and we would end up getting into a lot of detail work in the repair module anyway, and (b) there is a bug in the DVD (since patched) which could get in the way.

Now, this next part is critical. When you installed openSUSE, it appears that you had the Corsair drive (sde) configured in the bios as the first boot disk, or perhaps your bios has an on-the-fly boot device menu and you selected that disk. This is reflected in device.map, where sde is aligned to grub’s (hd0). Grub relies on /boot/grub/device.map to determine the boot disk sequence because the bios does not pass this data. It will also use the device.map alignment for its menu control file (/boot/grub/menu.lst) to determine which disk(s) to boot from. So both of these files will need to be fixed, but that can be done later. For now, make sure that the bios boot disk sequence is now configured how you want to leave it, which I would assume would be the Vista disk first (sdb?) and the linux disk (sde) second. Then boot the DVD into Rescue System, and login as root. Then do:

grub
find /boot/grub/stage2

Note: Because /boot is on its own separate partition, the find command may need to instead be: find /grub/stage2

Since grub is not running from your installed SuSE instance (the DVD kernel and its file system is in ramdisk), it does not have device.map to reference and hence will guess what the boot disk sequence is. If it guessed right, the find command will return (hd1,3). If it does not, then do:

device (hd1) /dev/sde

Then try the find command again; it should return (hd1,3). Then do:


root (hd1,3)

That tells grub that its stage2 loader and the kernel is on sde4. The shell should return something like “Filesystem type is ext2fs, partition type 0x83”. Then do:

setup (hd1,3) (hd1,3)
quit

The setup command should return ~10 lines, saying that stage1 was found, stage2 was found, and stage2 was successfully installed. Now do:

shutdown -r now

Remove the DVD; the machine restarts. Boot into Vista, and run EasyBCD. Click on Add/Remove Entries, click on the Linux tab, in the pull-down find the sde4 disk/partition (the list uses Windows notation), the SuSE partitions will be labeled “linux native” - just be sure to choose the correct one. Type a name of your choosing and click Add Entry. You won’t see it yet in the list above; just reboot and it will then be in your Vista menu.

When you select the openSUSE entry, you should go to a grub menu. If you get a green boot menu, the selections will probably work. But I suspect you won’t; it will be a text menu (and you may see an error message flash like (/gfxmenu is missing"), and the selections will probably not work because the menu.lst control file is referencing (hd0,3) instead of (hd1,3). So press the ‘e’ key and the screen will switch to grub’s on-the-fly menu editor. Highlight the main entry, and press ‘e’ again; this time you’ll see all the lines in that boot stanza. Highlight the “root” line and press ‘e’ again; now you can edit that line. Just change (hd0,3) to (hd1,3) and hit Enter. Now hit the ‘b’ key and that stanza will boot SuSE.

Once in openSUSE, hit Alt-F2 and in the run dialog box that pops up, type:

kdesu kwrite /boot/grub/device.map

That runs a text editor opening device.map. Change it to reflect the correct boot sequence. Then open /boot/grub/menu.lst and change the (hd0) to (hd1) throughout. Now reboot and you should see the green boot menu and everything should work.

Good luck.

Thanks so much for your help, Mingus!

I posted earlier today - at least I thought I did but I don’t see my response now, so I’ll repeat myself. I think maybe I previewed it and forgot to hit the submit button.

I went through your instructions and I had to make a few small adjustments… but the result is that I can now dual boot my system and both operating systems work now. I really appreciate your fine advice.

Part of my original problem is that when I installed OpenSUSE I had disabled all other drives in my bios - I didn’t want any chance that the install would touch my windows boot sequence or any drives. After install, I re-enabled my other drives so that’s why the numbering was all off.

In device.map, I simply deleted all entries except the linux boot drive. I wasn’t sure about the “real” order of the drives so I figured since it was used during boot only I’d just keep my boot drive in there. I then made the modifications you suggested in menu.lst

Thanks again!

current device.map

(hd2)	/dev/disk/by-id/ata-CORSAIR_CMFSSD-128GBG1D_09051315-108484

current menu.lst

# Modified by YaST2. Last modification on Sat Feb 21 06:26:56 EST 2009
default 0
timeout 8
gfxmenu (hd2,3)/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 
    root (hd2,3)
    kernel /vmlinuz root=/dev/disk/by-id/ata-CORSAIR_CMFSSD-128GBG1D_09051315-108484-part2    repair=1 resume=/dev/disk/by-id/ata-CORSAIR_CMFSSD-128GBG1D_09051315-108484-part1 splash=silent showopts vga=0x314
    initrd /initrd

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 
    root (hd2,3)
    kernel /vmlinuz root=/dev/disk/by-id/ata-CORSAIR_CMFSSD-128GBG1D_09051315-108484-part2 showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
    initrd /initrd

You’re quite welcome. :slight_smile:

Yes, your mod should work fine, particularly given you’re using Vista’s bcd bootmgr which creates a unique identifier for each disk (as grub does) rather than relative numbering (as XP does). Device.map is actually primarily used at grub installation. Your method would be a problem were grub’s stage1 and stage2 not on the same disk, though. Bottom line . . . well done!