Creating a Dual-Boot Windows XP and Ubuntu Laptop
Subject:   Problem: Mepis 6 Linux in extended partition
Date:   2007-01-09 03:51:11
From:   drfreak
With Linux in an extended partition the recipe would not work when installing Mepis. As I am not an expert on partitions and bootrecords I found the following workaround.

Working XP installation.
Linux live CD.
Linux on an extended partition.
A partition accessable by both Linux and XP

My situation:
XP in hda1
MEPIS /root in hda5 (extended)
FAT32 in hda2 (D: drive)

At the option of installing GRUB, skip this or install to /root. NOT to MBR !!!!
If you are in linux do the following
If not boot with the live CD and do the following.
All this is assuming that GRUB has not yet been installed to the MBR of hda and XP will start at the next boot. If GRUB has been installed to the MBR, then your MBR is overwritten and you have a problem.

# mkdir /mnt/share
# mount -t msdos /dev/hda2
# dd if=/dev/hda of=/mnt/share/xpboot.bin bs=512 count=1

This will copy the XP mbr to a file XPBOOT.BIN on hda2 (my D: drive)

Now go ahead and install GRUB to the masterbootrecord of hda. Mepis has an option for this under MEPIS Utilities. This will overwrite the MBR of hda with GRUB stage1.
Assuming you still have your terminal window open now do the following. (if not repeat line 1 and 2 of the above code).

# dd if=/dev/hda of=/mnt/share/mepis.bin bs=512 count=1

This will copy the GRUB stage1 bootloader to the file MEPIS.BIN on hda2.
Then copy back the XP mbr to hda with

# dd if=/mnt/share/xpboot.bin of=/dev/hda bs=512 count=1

Now the MBR on hda should be as it was before you started. The next thing to do is to bootup in XP and copy the MEPIS.BIN on D: to your C: drive.

The last thing to do is to configure the Windows bootloader which is outlined in the above article.

When you reboot you should now see the Windows bootoptions. If you choose XP - you boot in windows. If you choose Linux - you start GRUB and again have the option to boot in either Linux or Windows (at least in MEPIS 6). The MBR on hda has not been changed which was the purpose of this exercise.
This should probably also work for other flavors of Linux.

Regards and thanks.

1 to 1 of 1
  1. Problem: Mepis 6 Linux in extended partition
    2007-03-23 15:33:51  Kevin Farnham | O'Reilly Blogger [View]

1 to 1 of 1