Set Up to dual-boot Win7 and openSUSE 13.1

If the moderators do not object, I am posting this in the install/boot/login forum because I think it then stands a better chance of being seen by anyone with this goal.

I have just installed openSUSE on another laptop for another newcomer to Linux and openSUSE, and have discovered something that others seem to have run into here.

This is the first time I have actually installed the 64-bit version of openSUSE 13.1 in this kind of a situation, so at the moment, I do not know if this is a specific problem with the 64-bit version, or if it also exists with the 32-bit version (I do not recall if I have installed the 32-bit version in a similar case). I have not yet had time to run tests with the 32-bit version, but when I do, I will post a more complete updated guide for installing a Win7/openSUSE dual boot in the appropriate places.

In the past, I have installed openSUSE (not certain about 13.1 and newer) on such machines by creating an Extended partition as the 4th Primary partition, then creating the three standard Logical partitions ( / , /home , & swap) in there. I would then set the single Boot/Active flag for the drive on the Logical / partition, not on the Extended partition itself, and then install Grub to the / partition only. This always worked flawlessly in the past and avoided the problem of any Windows 7 updates or Recovery messing up the system in a way that made it difficult to repair (happens a lot when Grub is installed to the MBR).

However, this method did not work on my first install attempt with the 64-bit version of 13.1 yesterday, first time this method has ever failed me.

So, I did the following, which works flawlessly, and is my new recommendation for installing in similar situations (assuming an older PC or laptop without UEFI and Secure Boot, with Win7 installed at the Factory.).

In this case, it was an Acer with Win7 pre-installed.

It already had, of course, 3 Primary partitions (ms-dos partition table): The first, a Factory Recovery partition, the second, the small System Reserved partition (this is where the Win7 diagnostic and Startup Repair tools exist, AFAIR), and the 3rd partition was the Win7 System and Data. Boot/Active Flag is normally set on this 3rd system partition.

To install dual-boot on such a system:

Create the 4th Extended partition, as usual, but …

Create 4 Logical partitions in that Extended partition; a Boot partition, a root (/) partition, a /home partition, and a swap partition.

My recommendations are as follows:

Pre-create the partitions using GParted (from Parted Magic CD or some boot CD/DVD) – or use another Partitioner of your choice, but not Windows Disk Manager (it shows such a system completely incorrectly).

Boot = 1-G or 2-G, aligned to MiB or cylinder, formatted as ext2
Set the Boot flag to this partition.

root (/) = 20 to 40-G (how much are you going to install for additional applications, and how tight is your disk space are the deciding factors) formatted to ext4

swap = Twice your installed RAM, or if you plan to expand your RAM in the future, Twice what your RAM can be expanded to, allows safe hibernation when in the middle of a lot of complex and systems-intense work.

/home = The remaining space in the Extended partition (Unless, of course, you decide you want to add a 5th Logical NTFS partition to share Data between Linux and Win7. This is actually what I do.), formatted to ext4

When installing, use the advanced features in the Installer’s partitioner, right-click the Boot partition, choose Edit. In there, choose to mount it in fstab (the column on the right on that window) as /boot. Make sure it is still set to ext2, you can format it, or choose not to format, does not really matter if you already formatted it to ext2 when you created it with the 3rd party partitioner, earlier.

(Next steps, if you did not previously format the partitions, then you must do so in the next steps)

Now, right-click the root partition, choose to edit. No need to reformat it, so choose not to reformat it (unless you have not done so earlier) and make sure it is set to be mounted as root.

Right-click the /home partition, choose to edit. Again, no need to reformat it, so choose not to reformat it (unless you have not done so earlier) and make sure it is set to be mounted as /home.

Check that swap is set the way you want it.

On the install summary screen, click on the heading for the Bootloader/Grub install section. This will bring up the Bootloader settings.

In there, make sure you have it selected to install Grub to the /boot partition and to nowhere else!!!

Also in there, although you have already done so when you first created the partitions, you can again tell the Bootloader installer to set the Boot/Active Flag to the /boot partition.

Now, continue with the install.

This method will work, in this Win7 situation, for both the 32-bit and the 64-bit versions of openSUSE.

And, with the way the future is setting up, this separate /boot partition is becoming a more and more preferential method for installing Linux, or in particular, openSUSE.

I would like anyone who can to try this method and report back here, if they would be so kind.

32-bit or 64-bit should not make any difference, because the boot code is 32-bit (except for the part that is 16-bit).

On first read, it looked as if it shouldn’t work. But then a thought occurred as to why it might work.

I went to my laptop. I turned off the active flag for “/dev/sda3” (actually Windows), and turned it on for “/dev/sda5” (the “/boot” partition of one of my two opensuse installs. Note that this is MBR partitioning, so “/dev/sda5” is a logical partition (part of the extended partition).

Then I tried booting. And it booted to the Tumbleweed that uses “/dev/sda5” as “/boot”.

I’ll note that the opensuse installer put generic boot code in the MBR (against my wishes, but it ignored what I told it). So it is probably the generic boot code installed by an opensuse install that allows directly booting extended partitions. I doubt that this would work with the Windows-provided generic boot code, though I can test that if you want.

A further note to avoid confusion. My install of opensuse 13.2 uses “/dev/sda1” as “/boot”. But I normally have it boot to Windows, and use the Windows boot manager to select one of my two opensuse installs.

A further note: if your scheme depends on the opensuse generic boot code in the MBR, then Windows can still mess it up (and probably will at some future time).

To summarize the main point: The opensuse installed generic boot code for a MBR (legacy) partitioned disk can boot an extended partition. I gather (but have not tested) that the opensuse installed generic boot code for a GPT partitioned disk can boot any GPT partition. Apparently the installer uses different versions of generic boot code, and these supposedly come from “syslinux”.

Please do, if you have the time. I currently have several projects underway, so it may take a few days before I can get around to running that test.

I do not have that same system available, now, as I have already delivered it back to the owner.

(…who, BTW, is thrilled with openSUSE, his first Linux experience!)

I decided to test anyway, without waiting for your response.

I did:

# dd if=/boot/backup_mbr of=/dev/sda bs=440 count=1

to put back the Windows boot code into the MBR.

I then rebooted. And that gave me nasty messages about an unbootable disk.

Then I plugged in a USB (opensuse live rescue) and booted the USB. I then used “fdisk” to make “/dev/sda3” active and to turn off the active bit for “/dev/sda5”. And now it is back to normal.

Summary: directly booting a logical drive in the extended partition depends on the opensuse installer putting its generic boot code into the MBR.

Thanks for testing.

I also will be running additional tests.

But, it appears, back to the drawing board.

I suppose the safest way to do this, then, would be to leave a blank 1-Gig unallocated space in the front of the Extended partition before the first Logical partition, so that the necessary code will be guaranteed to fit in the Extended partition as it grows with future versions.

Posting this to get thread title updated, if I can.

Read this entire thread before you decide to use this method.

Hmmm.

Didn’t work.

Seems to me that in the past, the OP could change the title of the thread???