View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Dual booting

From LQWiki

Jump to: navigation, search

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.

In these instructions we will assume that Windows is installed on hard disk hda and that Linux is installed on a separate hard disk, hdb. It is also possible to install different OSs on the same hard disk, but on different partitions. We will also use Lilo as the bootloader.

Contents

With Windows NT / 2000 / XP

The bootloader of Windows NT (ntloader) expects to be the one in charge. Windows 2000 and XP use the same bootloader, so they behave in the same way. The normal way of dual booting NT with Linux is to add Linux as an option in the NT boot menu. In this way the NT bootloader will allow it to load the Linux bootloader.

The first thing you must check is that LILO is configured so that it will write the Linux boot sector to the beginning of the Linux partition, hdb1. If the Linux boot sector is written on the Windows NT partition, ntloader will not load and thus you cannot dualboot. You will also have extra trouble recovering the overwritten NT MBR. In /etc/lilo.conf check that the boot entry is

boot=/dev/hdb1

Next run lilo to install the boot sector. Reboot to Linux. You need a boot floppy, because ntloader has not been configured to boot Linux. Under Linux, use the dd command to copy the Linux boot sector to a file.

$ dd if=/dev/hdb1 of=/bootsect.lnx bs=512 count=1

Copy the bootsect.lnx file to the root of the Windows boot partition. Either mount the NT volume under Linux or use a floppy disk. Then boot to Windows NT.

There should be an invisible file called boot.ini on the root of C:. First modify the attributes of the boot.ini -file from the command line, so that write-protection is removed:

C:> attrib -s -r c:\boot.ini

Then add the following syntax to the end of the boot.ini file

C:\bootsect.lnx="Linux"

Third, restore the original attributes of the boot.ini file:

C:> attrib +s +r c:\boot.ini

You should be finished now. Reboot to check that everyting works ok. Every time you modify the lilo.conf -file, you have to run lilo and copy the bootsect.lnx file to the Windows partition.

With Windows 95 / 98 / Me

Windows 95 and 98 may be booted from Lilo. You should install Lilo in the MBR of hda and add Windows as a boot option in the Lilo menu.

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 dirctory 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, your finished. Boot options will display at the next boot.

No changes are made to the Windows MBR.

Link http://www.mepis.org/docs/en/index.php/Boot_Mepis_from_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?

See also

External links


Personal tools