Installing Vista after openSUSE 11

Alright, so I have a computer that has only ever run opensuse 11. Now, for school, I need to install Vista. Since I have only ever installed any linux distro after installing and running XP, I figured I had probably better do research, seeing as I do not want to loose my opensuse installation. Turns out that installing windows second is usually not the order of things anywhere and that Vista pretty much screws whatever linux distros and grubs you may have running before it’s installed.

Now, with all that in mind, I still need to install Vista for school, but I only have this one computer. Therefore, I was wondering if anyone has been in this situation before (that is, installing vista on a pc that has only ever ran opensuse before) and succeeded in dual-booting opensuse 11 and vista, using any bootloader. Any help would be greatly appreciated; I have only been experimenting with linux for about six months.

You could always use Virtual Box if your system could manage it.

What you ask, should be possible. But I have never tried it.

Maybe swerdna will know - or others?

My system is fairly new: Intel Celeron E1200 1.6 GHz dual-core on a Intel Classic Series DG31PR motherboard w/ 4 GB RAM and the onboard GMA G31 video card - which suse detects as a G33. It should be able to handle Virtual Box. I would really prefer to install it to the hard-drive instead of as a virtual machine, however.

And I’m very new to the openSUSE forums; I hardly know anyone as of yet and this is only the second thread I’ve posted in - although I’ve read many others. I don’t recall this swerdna though; how would I go about asking them for help, if it wouldn’t be rude?

You can install vista on any primary partition, it doesn’t have to be the first. It will wreck your Grub in the Master Boot Record, but that’s easy to fix. But the important thing is the spare primary partition. So what is your partition line up. Perhaps you could post the response you get in a console to this command:

sudo /sbin/fdisk -l

That will list the partitions on your drive/s. And post with that a description of what you are using each partition for. We could then advise on what to do to get vista installed with minimal disruption.

Here’s what sudo /sbin/fdisk -l returns:


Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00022c06

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2   *         263        2873    20972857+  83  Linux
/dev/sda3            2874       30401   221118660   83  Linux

I have almost no experience with partitions: the most I’ve done is partition a Windows drive when installing linux and deleted linux partitions when I was done. I don’t know how to tell which partition above is the primary, or exactly what a primary partition is.

You have three primary partitions. So the fourth could be for vista. Currently you have approximately this:
sda1 is the swap partition approx 2 GB
sda2 probably the root partition “/” approx 20 Gb
sda3 probably /home approx 226 Gb

You could shrink sda3 by any amount e.g. 20 Gb and then install vista in the 20 Gb blank space you have made at the end of the drive.

To do this you would log out, log back in as root, unmount the partition sda3 (provided that it really is the home partition), shrink sda3 in Yast by 20 GB, reboot to check everything. Then you would be able to install vista.

If you proceed with this it is paramount so important for you to back up your /home data on a medium different from the drive we’re talking about.

To add to swerdna’s post, you can use ‘df -l’ to get the local mount points if you need to be sure.

Back in '06 I had installed the Vista RC out of curiosity alongside Slackware. I don’t unfortunately remember all the steps exactly but I do recall that Vista will install its own bootloader over anything else, and there’s no getting around that. I think I had to put Linux in the windows bootloader menu, which then brought up lilo (Slackware’s booter)… uggh, it’s ancient history but I guess my point is this:

BACKUP EVERYTHING AND VERIFY before even trying. It’s very possible that things will break at least once before they work. This is always a good idea anyway whenever you are making changes to the partition table.

Also, depending on what you need to do under Vista, a virtual machine (per caf4926) or something like wine might be worth looking into.

If you do end up mucking with your partitions, I recommend downloading the GPartEd (gnome partition editor) Live CD. It’s very user friendly and works well.

(this is my first post. Hi!)
Am I dating myself?

I dual boot Vista with OpenSUSE 11, but have never had any success with installing Vista after OpenSUSE, have always had to install Vista and then OpenSUSE.

@swerdna’s method will work. You will have unallocated space in which the Vista partitioning should be able to create a 4th primary and install to it. Vista will install its own MBR boot code, will mark the 4th primary as “active”, and Vista will boot. openSUSE will not be in the boot equation at that point.

For booting openSUSE, you have 2 choices. You can re-install openSUSE’s grub to the MBR; how you do that depends on what installation media you have.

Alternatively, before installing Vista, go into YaST Boot Loader and install grub to the root partition, /dev/sda2. Then after installing Vista, from within Vista you can just change the “active” flag from the 4th Vista partition to the 2nd openSUSE root partition. When you restart the machine, openSUSE will boot.

Either method you will need to add a stanza to /boot/grub/menu.lst for chainloading to boot Vista.

So I understand the concepts of what swerdna is saying about freeing up space for a fourth primary and installing vista to that free space; I’ve just had to do a bit of research on partitioning.

@bustamelon: I’m running KDE; does this GPartEd Live CD work anyways? It sounds like it will, I just don’t want to make any stupid mistakes and ef this all up.

@mingus725: The second method sounds a lot simpler than the MBR method that swerdna describes on his website. From what I understand, this would cause the box to first boot the grub w/ an option to boot the vista bootloader? And besides, what will I have to add to /boot/grub/menu.lst in order to enable chainloading Vista?

I recommend you avoid gparted in this case. I’ve outlined a route that allows you to shrink the third partition from within the running Suse operating system. That will allow Suse to fully recognise and integrate the changes to partitions. There’s a chance that if you resize from gparted, Suse will get confused – slim chance but a real one.

Alright, thanks. I found what you were talking about earlier in Yast. Is the backup program available there the best option, as well?

Yes. The Windows bootstrap code in the MBR is very simplistic - it looks down the adjacent partition table for the first bootable flag (i.e., “active”), jumps to the boot sector of that partition, transfers control to the code there. So before installing Vista, use YaST Boot Loader to install grub to your root sda2 partition.

Then install Vista to the unallocated space you created previously as @swerdna recommended, making the 4th partition which Vista will set as active. Here I need to amend one previous statement: While testing this, I found that Vista, unlike XP, will not change the active flag on a partition that it does not own. So, just boot a Live-CD or from your installation DVD into Rescue, get to a command-line prompt, switch to root, and do

sfdisk -A2 /dev/sda

That will switch the bootable flag from the 4th to the 2nd partition. Now reboot, and the grub menu will appear.

Now to make Vista boot from openSUSE’s menu, you need to edit grub’s menu.lst file as root. With KDE you can do that by pressing Alt-F2 which brings up a Run dialog box. Type in

kdesu kwrite /boot/grub/menu.lst

And then add this to the file

title Windows Vista
rootnoverify (hd0,0)
chainloader (hd0,0)+1

That chainloader command will transfer control to the Vista partition boot sector, precisely the same as when the Vista partition was marked active.

Thanks, that helps a lot. Now all I have to do before I start partitioning and installing Vista is backup my machine. :slight_smile:

Oh, I forget you asked about the YaST System Backup, too. That is a very simple backup tool - it copies your entire installation into a tar file (you can specify which type, for higher compression if you wish) that it will put wherever you tell it to. There are of course much more sophisticated tools available.

I also meant to mention previously: Before you change the bootable flag with sfdisk as described above, run the “fdisk -l” command to look at the partition table. You should see an asterisk next to sda4, showing Vista as active. Then run fdisk -l again after having run sfdisk; the asterisk now shows beside sda2. That will confirm for you that the bootable flag was set as expected before and after your change.

Ok, thanks. And for more sophisticated backups, how would you rate SystemRescueCD/partimage?

Hmmm . . . backups is a very large topic. One of the most important basics to understand is the difference between file system type backups vs bit image backups (partimage is in this category).

In the former, files are copied using the file system, and they are restored using the file system, essentially the file system is rebuilt a file at a time. The copied files are placed in a container to be managed as a set, the container is compressed to save space - such as the .tar file YaST Backup uses. You can use it, see inside of it, extract specific files from it, just like any other compressed container file, like .zip or .rar. This is the traditional method of backups. It is also slower than imaging both for backup and recovery, as there is overhead reading the file system during backup plus doing the compression, and there is overhead rebuilding the file system during recovery.

With a bit image, the partition (or with some tools, the entire disk) is simply copied sequentially sector by sector, front of disk to end. One long string of bits. It is literally an “image” of the partition or disk. Typically the resulting image is smaller than the method above, although with recent compression methods the results are fairly close. Imaging is typically used for disk cloning, it is often used by PC manufacturers to “re-image” the OS rather than re-installing it, it is useful for “snapshot” backups because imaging is faster than the file system method. But there are several downsides, too. First, if the image somehow gets corrupted or there is some incompatibility with the device the image is being copied to, the restore/clone may not work. Bad blocks on the disk may (this varies by tool) be copied to the image, and transferred to the new disk when restored. And there is no visibility inside the image nor method for recovering individual files from the image; it is all or nothing - but this issue is addressed by some tools which create a catalog of the files in the image, allowing selective recovery. Finally, since the file system within the image is restored exactly as it was (rather than being rebuilt, as happens with the other method), it will be sized to whatever the source partition was; hence if you restore an image created from a 100GB partition to a 200GB partition, only half the partition can be used without taking further steps.

What you use depends entirely on your needs and preferences. Partimage is one of several linux imaging tools, probably the most widely used. I don’t use imaging any longer, so I can’t comment on it. I would say that it is prudent to test an imaging tool with one’s own particular setup, before using it for production; years ago I failed to do this with a commercial tool, only to lose everything as a result.

There are a lot of tools which take various approaches to the traditional file system backup. In the openSUSE repository, there is DAR, rsync, rdiff-backup which are well thought of. Usually you can find a gui front-end, although the command line will be more powerful. But there are others, too - I haven’t used those, so can’t comment. (I use rysnc to mirror all our systems - extremely fast, flexible, powerful - but there is a learning curve.)

Hope some of this helps. You can find loads of opinions on this topic on these forums and others.

@mingus725: Maybe you mean (hd0,3)?

Now wiping egg from face lol!

Yes, of course (hd0,3).

Don’t imagine for a moment that I was chuckling as I typed.