Tuesday, November 2, 2010

Dual booting for linux

Dual booting means that there are two or more operating systems installed on the same computer and that the user is given the choice by the bootloader at boot time to choose the OS to use. Usually the choice for the other OS besides Linux is a version of Windows.

With Windows

First, install Windows, then install Linux. For all modern distributions (tested with SUSE  and Ubuntu ), the Linux installer will offer to create a grub bootloader that lets you choose at computer startup if you want to run Linux or Windows.

With MacOS

The bootloader for Mac OSX is yaboot. It has support for dual booting.

Tricks if things don't work

You don't need the installer if you have a Live CD which can boot you into a desktop/kernel command prompt.

The standard method to get to into a distress Linux is by "change root" whereby you "jump" from the Live CD Linux into another Linux installed in a hard disk.

After you boot to a Live CD, click terminal, do a su and supply the root password if demanded, make a tempoary directory in /mnt, mount it, chroot and enjoy the access to the distressed Linux. Assuming your Linux / is in hda2. You type

mkdir /mnt/hda2
mount /dev/hda2 /mnt/hda2
chroot /mnt/hda2

At this point onward you are inside the Linux installed in hda2 and can do whatever you like with it. With a bit of luck you can even access to the desktop by just typing

startx

Here's how I found out by trial and error. Assuming you have Windows and a Linux distro installed on the the same drive or two drives as I have. Check this link for getting boot loader back onto the first sector. http://geocities.com/epark/linux/grub-w2k-HOWTO.html When you have that set up,

  1. Boot Windows
  2. Obtain bootpart.exe (http://www.winimage.com/bootpart.htm) You need a zip utility for this.
  3. Extract to C:\
  4. Open a command prompt, type bootpart
  5. Note the number that corresponds to Linux (usally 1 or 2)
  6. At the command promt, type:
    bootpart 2 bootsect.lnx YourDistro (mine's Fedora)

    (Replace the "2" with the appropriate partition number noted in step 5
  7. Reboot, you are finished. Boot options will display at the next boot.

No changes are made to the Windows MBR.

Another thing I found out about Vista. I had WindowsXP obn the first sector of my first hard drive and Fedora on a second drive. After installing Vista, on re-boot there was XP and Fedora, Vista found them and now I can boot into Fedora or XP from Vista, neat eh?

No comments:

Post a Comment