Fixing vista multiboot with openSUSE

Note: this is only for Vista, not for 2000/XP
There are of course other bootloader problems; this is simply one of the common ones.

Situation: Vista is installed first on OEM computers. You install openSUSE and Vista won’t boot from the Grub bootloader.

Problem: Yast automatically configures Grub for us in a fashion that used to work with Win 98, 2000 and XP. It puts an entry like this in the Grub configuration file menu.lst located at /boot/grub/menu.lst:

title windows
rootnoverify (hd0,8)
chainloader (hd0,0)+1

The “root” is set to the root partition of the openSUSE installation, in this example partition sda9 [in Grub speak that’s (hd0,8)]. That works for earlier versions of Windows but it doesn’t work so good for Vista.

Solution: You have to edit the file menu.lst with this command in a console for KDE:

kdesu kwrite /boot/grub/menu.lst

or if you have Gnome use this:

gnomesu gedit /boot/grub/menu.lst

and change the windows entry from like this:

title windows
rootnoverify (hd0,8)
chainloader (hd0,0)+1

to like this:

title windows
rootnoverify (hd0,0)
chainloader (hd0,0)+1

Variation for some notebooks: Compaq and some other notebooks don’t preinstall Vista on the first partition [which is designated (hd0,0)]. They have a utility partition as the first partition and Vista on the second. For those cases the correct entry in Grub looks like this, reflecting sda2/(hd0,1):

title windows
rootnoverify (hd0,1)
chainloader (hd0,1)+1

Further problems: This is just one of the quirks that you can get when multibooting Windows and Suse. There’s a fuller rundown on fixing those problems here: GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.

Happy Vista-ing with openSUSE

Thank you. Your inputs have always been great contributions.

swerdna, are you sure this bit is right? Should it not be sda9? (Grub counts from 0 so always lags (or leads?) the sda/hda numbering).

OOOPppss, thanks Paul – fixed

Here is my two cents…

I use two drives. This makes everything cleaner in my opinion. Well at least until I bought a crumby motherboard (K9A) that will not boot the second drive directly. Instead you change the drive order in the BIOS to switch witch drive you would like to boot.

So having already installed Vista on the first drive, and after installing openSUSE on the second drive and changing the drive order to boot the newly installed openSUSE11 [second drive mapped to first drive in BIOS]. It was no surprise I had some trouble multibooting with grub.

So here is the trick that worked for me.

Grub.lst




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


For whatever reason Yast would not let me write “rootnoverify (hd1,0)” and would repeatedly change it back to “rootnoverify (hd0,0)”, [GRRR] so I had to do that by hand.

Now I could boot Vista, but had some troubles with setting Vista to “sleep” mode. My guess is that vista is unhappy booting from what the BIOS tells it is the second drive and that breaks RAM contents redundancy stored on disk. Luckily disabling “Hybrid Sleep” mode allowed sleep mode (S3) to work again.

Have Fun!

Good info but I would like to know if there i a way to keep grub/suse from changing the windows entry every kernel update, rebuild etc? As it is now every time you update the kernel it resets the menu.lst windows entries for vista back to something incorrect. It just gets annoying.

I hadn’t heard of that and don’t know of a way to make it fixed. Interesting. Thanks.

Swerdna – something to add

Situation = new HP dv9700z with Vista on 1st partition; HP Recovery on 2nd partition (all on disk 1). In windows, they have it so that disk2 is seen as a storage disk only. BTW, there is essentially no bios controls. I didn’t get a Vista install CD/DVD; only the recovery disks I made.

Fortunately, 11.0 sees & installs to drive 2.

Now, I want to multi-boot Vista, winxp, OpenSUSE 11.0 (and others eventually).

OK, I use Parted Magic to shrink the Vista partition & move the Recovery partition next to that; make a partition for winxp & install winxp on disk 1. Now thinking my OpenSUSE 11.0 installed on disk2 will detect vista & xp, I install 11.0. Grub will only see/boot xp because it overwrote the mbr.

As I don’t have a Vista install disk, I searched & found “Windows Vista x64 Recovery Disc.iso” (a google search should find that for you). That is essentially the boot recovery part of the Vista disk. That fixed my Vista boot problem from Grub.

Then, I start to work on XP. Grub wants to boot it, but, I start getting errors like missing NTLDR, ntdetect.com, etc. Not to worry, I use 11.0 & copy all that from the XP CD to the winxp root. Then, I get \system32
toskrnl.exe corrupt; replace that & get the same error msg. I finally got tired of messing with it.

I finally came to the conclusion that the Windows Vista x64 Recovery Disc I used to get Vista to boot rewrote/deleted some of the XP files and took charge of the boot process.

Long story > short:
I found "EasyBCD @ Download EasyBCD 1.7.2 - NeoSmart Technologies which allows Vista to dual boot winxp.

Now I have an OpenSUSE 11.0 Grub that boots the Vista bootloader which allows me to select either Vista or winxp. Yeah, it’s a two step process. but, it sure is easy:)

Note: how it does that & Grub’s boot yields xp file corruption is beyond me.

@snakedriver
This might explain what happened:

The active partition plays a big role for microsoft distros. You started with sda1 active, containing vista, and installed xp on sda3. During the xp install, xp sought out the active partition (sda1) and put its ntldr, ntdetect.com and boot.ini files there. And it wrote a bootstrap code into the MBR that is different from the bootstrap code vista put there earlier – different in this regard:

  • Bootstrap MBR code of vista instructs to seek the active partition and find the file bootmgr.
  • Bootstrap MBR code of xp instructs to seek the active partition and find the file ntldr.

So: after you loaded xp, the bootstrap code sought the xp ntldr on sda1 and those files won’t boot vista [because ntldr & boot.ini don’t know about vista because they were born before it was invented].

So that’s why you had to use the recovery CD of vista to get vista back. Now – vista was born after xp so its parents taught the file bootmgr of vista always to look for the file boot.ini on the active partition just in case vista had relatives on the drive.

So once you fixed vista with recovery it should then have been able to multiboot xp.

Thus when you installed Suse, which is from a different tribe to microsoft and doesn’t know about vista or xp, it said “heck i’ll include both the ntfs partitions into Grub’s menu.lst, it’s all I can think to do”. But we know now that there are no files like ntldr on sda3 because xp put them elsewhere deliberately during installation. So when grub points to sda3 you should get the response “like missing NTLDR, ntdetect.com, etc”, because they are missing by design.

So to cut a long story short – there is no file corruption and everything went according to plan.

Simple isn’t it http://www.swerdna.net.au/forumpics/smiley/laugh.gif

Swerdna, you write a mighty good explanation!

Thanks:)

I shall add my 2 cent as someone else said already (granito de arena por aka)

I just have a brand new laptop from dell, as many other “big brands” the hard disk comes with the OS already installed and a partition to “rescue” or to bring back your laptop as if it just had come out of the factory. So I had some problems trying to figure it out.

:smiley: what worked for me was adding this to the “menu.lst”:

title windows
rootnoverify (hd0,2)
chainloader (hd0,2)+1

it appeared with two of those ones ^ so I deleted one, changing the one left with those values, now is working just fine.:slight_smile: (I hope I explained Myself)

I remember with OpenSUSE 10.3 (or was it 10.2?) I messed up my own and a friends Windows boat sequence… we also got a scary ‘chainloader’ error message.

but we fixed it by changing the bios setting of LBA (Logical Block Adressing) to ‘enable’ or ‘disable’. Could be it’s no longer necessary though. But I thought I’d mention it for the sake of completeness.

Actually, it still is, quite so. It depends on the disk, and the partition layout. The setting involves the issue of addressing the disk beyond the 1024 cyclinder boundary, and where the boot files are relatively located. In short, sometimes LBA needs to be set for grub to work (because grub uses the geometries passed by the bios). Additionally, depending on the system, it will be required for an OS to see the entire disk.

Good explanation Swerdna! This info needs to go on a multiboot wiki. It would help with the confusion about vista vs xp boot processes.

Sorry to jump again on this topic but I had an asus notebook with vista pre-installed, I installed suse 10.3 and no way now to boot correctly on vista.

The only thing I can do is boot the “recovery partition” located on hd0,0 in GRUB “language” (sda1 in fdisk)

fdisk -l indicates that the root “/” partition for linux us sda3 and the windows vista’s “C” (where the vista system is located) on sda2.

When trying

title windows
rootnoverify (hd0,1)
makeactive
chainloader +1

It doesn’t boot windows displays a screen telling that something were wrong and asks to choose for “safe mode” or “normal boot”, none of them can boot vista.

Linux suse boots normally.
I didn’t find nothing to solve the issue but worse, how can I restore MBR ? Yast2 indicates that the /dev/sda2 is locked and there is no way to write MBR (fstab won’t mount /dev/sda2 as /windows/System for example) it is said “in use” (???)
After two days of headache I decided to ask help to solve this… and by the way how can I rollback to the original partition scheme before suse splited windows ones to install ? First I got 2 partitions in NTFS one for the system and the other for the datas, linux has been installed on the first partition but took 20 Gb… how can I merge those once suse uninstalled ?

Thank you

Have you tried using the recovery utility to repair the windows MBR?

How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows Vista

Given that:

  1. You know the partitioning is (a) Vista recovery, (b) Vista OS, (c) openSUSE installed; and
  2. openSUSE can boot and the grub configuration looks correct; and
  3. You cannot now access the recovery partition; and
  4. Apparently you allowed openSUSE to downsize your Vista partition to create a new partition for openSUSE . . .

It is quite possible that the problem is with the partition table. Unfortunately, Microsoft has said little about the fact that Vista creates partitions differently than any other version of Windows (or any other OS). There are several Microsoft kb articles about this causing serious problems with, for example, dual installations with XP, or with certain bios’s, or with 3rd party partitioning tools (several vendors have already been stung by this issue; it is discussed here: Multibooters - Vista’s New Partitioning Rules).

In this recovery situation, Microsoft recommends using “Startup Repair” from the Vista Recovery Environment. You have an oem system, so the RE may be (a) on a Vista installation disk, (b) on a custom recovery disk produced by the oem, (c) loaded on the hard disk and no separate media was provided (this sounds like your situation), or (d) you have to request the RE media from the oem. The Startup Repair is an automated process; there is also an RE option to go into a command line shell, as is described in @deano’s link posted above.

If you cannot get into your RE and/or don’t have Vista media, you can download it from the web. I haven’t been able to find it on Microsoft’s site (not even TechNet or MSDN), but there is an active bittorrent to get it. It’s 120MB and seeded well; on broadband <10 minutes. Get the torrent here Windows Vista Recovery Disc Download

Once repaired, if you would like to keep openSUSE, install the Neosmart (same site as above) EasyBCD tool - it is excellent, by far the best tool to configure the Vista boot manager. You would need to boot into the openSUSE DVD, choose Repair, go to the Boot Manager repair, and instruct it to install grub on the openSUSE partition (NOT the MBR). Then reboot into Vista, run EasyBCD, and add openSUSE to the Vista BCD. There is a tutorial on the Neosmart site; it is very easy.

If you want to remove openSUSE after Vista repair, just go to Administrative Tools/Computer Management/Disk Management, and reformat it with NTFS. Physically merging that space with the existing Vista partition may not be an option with Vista (I haven’t tried that). The reason is that the Vista partition is mounted, and a mounted partition cannot be physically altered. A 3rd-party partitioner (like Partition Magic) can do this before Vista starts up; I doubt Vista has such an option. But at the minimum, you would have a usable partition for Vista.

Finally, just for reference: The partition showing as “in use” means that it was mounted by Vista and then had an abnormal unmount; to clear this flag requires booting into Vista. And, not being able to mount this partition has absolutely nothing to do with the MBR; the MBR resides at the first sector on the disk, before any of the partitions.

@lordhurukan -

Two afterthoughts . . .

  1. There could be (note, “could be”, not “will be”) an important difference between the vanilla RE on CD as opposed to the RE installed on your hard disk by Asus. Vista’s installation setup (which is what the RE uses to set up its environment) does not have drivers for all SATA disk drives. If the disk controller is included in the motherboard chipset, Vista will see the controller because it has the chipset drivers. But if the controller is on a separate device (like on one of my Asus mobo’s, it’s a Silicon Image device), Vista’s setup may not see it. If so, when you boot the RE, it will not see the disk, and it will prompt you to install the driver from other media. You can probably verify what is in your machine on the Asus website, looking under the laptop or under its motherboard specs. If a separate driver is required, there will very likely be a download for it.

  2. It is possible that Startup Repair may destroy the Linux partition(s). If you want to re-create a partition to re-install openSUSE, you can do that with Vista (actually, 2 partitions, including 1 for swap; you don’t mention that partition in your post above). You would then just format the existing partitions for openSUSE. Under no circumstances should you use any other tool to physically alter the Vista partitions, except Vista itself OR a Vista-certified tool.

I installed openSUSE on a partition on my second hdd (Vista was on the first hdd) after which Grub failed to boot back Vista. Solved this by editing the menu.lst by replacing what it had for the windows boot commands with:

rootnoverify (hd0,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

Hope it helps anyone with the same kind of problem.

I have read the posts above nothing “seems” to be my problem. 1st - newbie to openSuse, but want start using *nx distros. I’m not new to computers etc. OK my question
1 - I have Vista Ultimate drive 1 /dev/sdd1
2 - I partioned (in Vista) one of my 500 Gig drive giving suse 250Gig of space. /dev/sdb2.
3 - I want to install suse to /dev/sdb2 and this appears to work. I DO NOT install to the master boot record so I can use EasyBCD to control the boot process.
4 - I now have the following devices:
sda1 - 466 Gig Vista,
sdb1 - 256 Gig Vista
sdb2 - partitioned hopefully Suse
sdc1 - 150 Gig Vista/program drive
sdd1 - 250 Gig Vista Ultimate Boot Device

Results:
However, the install goes great up to the point I get a generic logon screen Logon-{varies each time} and my root ID and password I setup do not work. I have to reboot.

I then try to put my entry in EasyBCD and I get a message screen about no boot found when trying to boot OpenSUSE.

I know it’s user error but any expert advice would be great.

AMD X2 6400+
4 Gig of RAM
2 nVidia 8800GT in SLi
2 500Gig SATAII
1 150GiG SATAII
1 250Gig SataII
2 4X Liteon R/W DVD Drives
Vista Ultimate

Thank you
-Tripcatrotfl!