Gentoo Wiki


This article is part of the Dual Boot series.
Install Linux after Windows Install Windows after Linux Using Windows Loader Using GRUB or LILO coLinux



This is a simple dual boot tutorial, it should give you a good idea how to install Gentoo with another OS, namely Windows XP. If you are interested in running more than two operating systems, information in this article will provide the foundation to install a multitude of operating systems..

Partition Recommendations

/dev/hda1 Primary - WindowsXP - 3GB minimum
/dev/hda2 Primary - /boot - 32MB
/dev/hda3 Primary - swap - 2x ram
/dev/hda4 Extended - extended partition - maximum available size
/dev/hda5 Logical - / - 2.5GB minimum
/dev/hdax Logical - Any other drive(s) you wish to have

On one hard drive you can have a maximum of four primary partitions (hda1, hda2, hda3, hda4). Extended partition is a primary partition that contains any number of logical partitions (hda5, hda6, ...). Only one extended partition is allowed on single hard drive.

Partioning Your Drives

Single Drive install

Note: This install will delete everything on the drive
  1. Boot the gentoo livecd (This also works with most other livecds.)
  2. Setup the partitions
    • Run cfdisk, and configure your partitions (see the Handbook for partition sizes)
    • If Windows is one of the operating systems you wish to install, install Windows on the first partition on the drive.

Single Drive Install (Windows Pre-Installed)

Warning: Resizing partitions can be dangerous and may lead you to lose your data. Please back up important files BEFORE proceeding.
  1. Run Disk Defragmenter on Windows to minimizes risk of losing data when resizing while increases your ability to successfully resize the drive.
  2. Boot to a Knoppix CD or any other liveCD that contains "ntfsresize"
  3. Run qtparted, and resize your partitions
  4. Partition the newly-created space for gentoo, see the Handbook for appropriate sizes.
Note: You can use Partition Magic if you are willing to pay for it. Just make sure you DO NOT follow the instructions for dual booting with the program. Specifically, you should not hide any partitions when setting up a dual booting system.
Warning: DO NOT use PQBoot to resize your partitions.

Multi Drive Install

No special partitioning is required with this type of install. Just need to partition all the drives accordingly. The key to making this work is knowing how your bootloader refers to partitions, and which partitions has an operating system.

Note: It may be necassary in some instances to trick your Windows OS into believing it is the primary, if it is not on the first hard drive (hd0). To do so, use the following in your grub.conf file:
title Windows XP
#:1 <-- type: 0 => linux, 1 => windows, 2 => other
rootnoverify (hd1,0) #Windows is secondary drive, Linux is primary
chainloader +1
map (hd0) (hd1) # Tell the first hard drive to pretend to be the second
map (hd1) (hd0) # Tell the second hard drive to pretend to be the first

You can avoid the mapping trouble by installing your Windows operating system on the first hard drive seen by the BIOS.

Installing the Operating Systems

  1. Install Windows first (if it is not already installed, and you wish to run Windows). You must install it to the first partition of a hard drive.
  2. Install Gentoo, please refer to the Handbook.

Configuring The Bootloader

Now that you have both operating systems installed, it is now time to configure the bootloader you will use to start up Gentoo.


Setup your lilo.conf as described in the Handbook. Then add the following lines to make Windows bootable from Lilo.

other = /dev/hda1  # Partition and drive windows is on
       label = Windows # label for the selection screen
       table = /dev/hda # set this to the drive windows is on

Run lilo :)


Set up Gentoo's entry in your grub.conf as is described in the Handbook. Then, add these lines

File: grub.conf
# For booting Windows NT or Windows95
title Windows
rootnoverify (hd0,0)
chainloader  +1
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos

Now just reboot to change OSs

Using NTLDR to boot Gentoo via Grub

  1. Obtain a copy of Grub4DOS from the Grub4DOS homepage, and install it.
  2. Obtain a copy of WinGrub from the old Grub4DOS Sourceforge homepage, and install it.
  3. In WinGrub, go to Tools->Install Wingrub to boot.ini to add Grub to boot.ini and create a C:\grub directory that holds all of Grub's files.
  4. In Tools->Partition List, arrange your partitions in the same order as your BIOS sees them. You can use your BIOS to view the boot drive order that BIOS will use to boto your computer.
  5. Open C:\grub\ to find the /dev/hdx Gentoo was installed on.
  6. Edit C:\grub\menu.lst and add the entry for Gentoo
File: menu.lst
-timeout 40
-title BackTrack
-root (hdx) <--x is the disk NUMBER from
-chainloader +1
7. Save, restart, and there should be a "Start GRUB" option at the NTLDR boot screen.

Finishing up

Now that you have your system setup, you should be able to reboot and choose your OS from the menu.

Transforming a Dual Boot System into a Multi-Boot System

This guide has given you the two concepts necessary of installing a plethora of operating systems on a single computer:

  1. Partitioning hard drives to hold an operating system
  2. Making bootable partitions visible to a bootloader

As long as you can point a bootloader to a bootable partition, the booting operating system will boot as if it is the only operating system on the computer.

Things to Keep In Mind

See Also

Retrieved from ""

Last modified: Tue, 06 May 2008 11:20:00 +0000 Hits: 72,875