PDA

View Full Version : Dual Boot How-to



titan386
10-12-2002, 02:29 PM
I've also posted this over at the o/c forums. Figured someone over might get some use from it:

Back when I first installed linux, I was most afraid of the dual boot setup, and didn't like the idea of possibly trashing my drive. After doing it, I realize how easy and straightforward the process really is. So I'm posting this info to guide our newbs out there and dispell your concerns about dual booting. (I assume we already have windows installed and working).

Step 1: Partitioning

OSes don't like to share partitions. In the case of Linux and a M$ OS, they need to be formatted with different filesystems. Generally linux uses ext2 or ext3, and windows uses either FAT32 or NTFS. Therefore, we need to set up different partitions for each OS. This is the most important step, and we must plan it out carefully, lest we need to wipe the drive later. Most of you will have one big partition occupying the whole drive, or at least the entire drive formatted with windows partitions. You have two options here: pay $70 for partition magic and resize your partitions, or start over. I personally choose to start over, but thats cause I have no money. If you want to try Partition Magic, heres some linkage:
http://www.powerquest.com/partitionmagic/
Now, lets figure out how much space we need for linux. We will want at least two seperate partitions, one root and one swap. The root partition is used to store the OS files, programs and possibly your data as well. The swap partition is similar to the windows swap file; it emulates RAM if your memory fills up. I've found that if you have a reasonably spacious drive, its nice to allocate about 10 gigs for linux, this way you will have plenty of room in the future.

Now that we know how much space we need, lets open up some space on the drive. Either resize your current partitions with Partition Magic, or wipe the drive and make them anew. It is important that we leave the space we want to put linux on as unallocated space, in other words, in no partition at all. The partition will be created during the install.

A quick note: The bootloader you chose (I will get to this later) may affect your partitioning plan. Some distros only include LILO (because GRUB is not 'officialy' stable). If you plan to use LILO, keep in mind it is unable to boot off over partitions located above the 1023rd cylinder (aprox the 8 gig mark).

Another note: The filesystem you use for you windows partitions is also important. Linux can read and write FAT32 with no problem. However, it can only read NTFS (and usually requires a kernel recompile to do so). Keep this in mind if you wish to access your windows files from linux. (As far as I know, there is no way to see linux partitions from windows).

Step 2: The Install

Now, we have our partitions as we want them, and the area linux will go into is unallocated space. Its time to begin the install. Many distros boot off a cd, some off a floppy, inorder to begin the installion process. The "newbish" distros like Red Hat, Mandrake, etc have very user friendly installions. Red Hat even offers to partition automatically for you. You will need a root partition and a swap partition. Format your root partition in ext2 or ext3 (preferably ext3) and set the mount point to /. Format the swap in swap filesystem (there is no mount point for swap). Consult your distros documentation for more install info.

Step 3: Bootloader

At some point in the install, you will be asked to install a bootloader. Do some research beforehand on which one is best for you. Your choices will be either GRUB or LILO. I prefer GRUB because it has a few less restrictions than LILO, but either one will work. In the bootloader configuration, you will have to tell it which partitons you want to boot off of. For example, if my windows install is on my first partition (/dev/hda1/) and my linux install is on my second (/dev/hda2), I would have to give this information to the bootloader so that it knows what to do when you boot the machine. The newbish distros will have a very straightforward way of specifying these parameters.

You also have to choose where to install the bootloader. Your choices generally will be either the partition where linux is installed, or the master boot record (MBR). You will usually want the MBR, so that it boots directly off of your linux bootloader.

That's it. When the install completes and you reboot your system, you should see the linux bootloader. Check to make sure you boot into both windows and linux successfully. If you can, congratulations on a good well done. If you can't don't panic. If linux works but windows does not, you can probably fix the problem via the linux install. If windows works and linux doesn't, you may have to reinstall, hopefully finding and correcting the problem before. If windows does not work and you must get into windows for some reason, booting off a dos boot disk and running fdisk /mbr will erase the bootloader so you can boot straight into windows.

Heres some general information:
http://www.redhat.com/docs/manuals/...de/ch-grub.html
http://www.linuxjournal.com/article.php?sid=4622
http://www.acm.uiuc.edu/workshops/l...stall/lilo.html
http://www.linuxgazette.com/issue38/veselosky.html
http://linux902.tripod.com/dualboot-choosing.html
http://www.techtv.com/screensavers/...3397093,00.html
http://www.xminc.com/linux/WindowsXPGrubMandrake82.html

If I've left anything important out, or there are any mistakes, please notify me and I will fix them. Hopefully this can help some of you out there.

Smizack
10-12-2002, 05:57 PM
Gave it a stickey for ya. Some good info there.;)

sjohnson
12-05-2002, 06:24 AM
Free disk partitioning and multiboot tools are available: <A HREF="http://www.ranish.com/">Ranish</A>, <A HREF="http://www.winimage.com/bootpart.htm">Bootpart</A>,
<A HREF="http://diskman.no-ip.com/">Diskman</A>, <A HREF="http://www.zeleps.com/">zeleps</A>, <A HREF="http://www.geocities.com/SiliconValley/Haven/3190/zpart-ja.htm">zpart</A>,

Attitudx
04-08-2003, 11:49 AM
ok i have a question what happens if you install the bootloader on the other harddrive not where your windows partition is?? I did that and now i get booted straight into windows

Smizack
04-08-2003, 02:14 PM
It just bypasses it. And goes... "straight into windows";)

Attitudx
04-08-2003, 03:55 PM
thanks for that tech info LOL umm after a format dangit i dont want linux

Attitudx
02-24-2004, 12:18 AM
SMIZZZZZZZZZZ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Dude i am stuck in thiz linux with no way back into windows......I have it on a different partition but i want back into windows i need some boot configuration help!!!!!!!!!!!!!! I cannot format cuz i have things i cannot lose.... I know you can fix it for me

Smizack
03-13-2004, 05:31 PM
In Titan386's words:

You need to open your /boot/grub/menu.lst file. Use root to do this. For example, to open it for editing with the text editor pico, this is what you would do:
su
type your root password. You are now root.
pico /boot/grub/menu.lst
This should open the file for you. Its possible your file is elsewhere, in which run a search for menu.lst to find its location. You need to add the folllowing lines to the bottom of the file:
title Windows XP
rootnoverify (hd0,0)
chainloader +1

I'm assuming that XP is on the first partition of your primary master harddrive.

Once you've added those lines, press ctrl x and hit enter serveral times to verify the promts it gives you. Then reboot and see if it worked.

Here is my menu.lst file for reference. Mine boots from 4 different images, 3 different linux kernels, and windows xp.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=3
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.19)
root (hd0,1)
kernel /vmlinuz-2.4.19 ro root=/dev/hda3
title Red Hat Linux (2.4.18-10)
root (hd0,1)
kernel /vmlinuz-2.4.18-10 ro root=/dev/hda3
initrd /initrd-2.4.18-10.img
title Red Hat Linux (2.4.18-3)
root (hd0,1)
kernel /vmlinuz-2.4.18-3 ro root=/dev/hda3
initrd /initrd-2.4.18-3.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1


And this works great.

Demon_Hunter
04-01-2004, 10:21 AM
Oh my god, dont use this crapy grub man, use Lilo, oh it is so faster, better and easily to configure. It's waste of time try grub

see ya

Attitudx
04-14-2004, 06:12 PM
actually grub works pretty smoothly i have found... but in my installing Slackware 9.1 I found that LILO isnt that hard to use if you just do it... I know have slackware and xp dualbooted and done it all by accident

boshi
05-04-2004, 07:01 PM
Originally posted by Demon_Hunter
Oh my god, dont use this crapy grub man, use Lilo, oh it is so faster, better and easily to configure. It's waste of time try grub

see ya

GRUB actually has many desireable merits, such as the fact that it loads its cconfiguration from a file on a partition.


Originally posted by Smizack
In Titan386's words:

You need to open your /boot/grub/menu.lst file. Use root to do this. For example, to open it for editing with the text editor pico, this is what you would do:
su
type your root password. You are now root.
pico /boot/grub/menu.lst
This should open the file for you. Its possible your file is elsewhere, in which run a search for menu.lst to find its location. You need to add the folllowing lines to the bottom of the file:
title Windows XP
rootnoverify (hd0,0)
chainloader +1

I'm assuming that XP is on the first partition of your primary master harddrive.

Once you've added those lines, press ctrl x and hit enter serveral times to verify the promts it gives you. Then reboot and see if it worked.

Here is my menu.lst file for reference. Mine boots from 4 different images, 3 different linux kernels, and windows xp.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=3
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.19)
root (hd0,1)
kernel /vmlinuz-2.4.19 ro root=/dev/hda3
title Red Hat Linux (2.4.18-10)
root (hd0,1)
kernel /vmlinuz-2.4.18-10 ro root=/dev/hda3
initrd /initrd-2.4.18-10.img
title Red Hat Linux (2.4.18-3)
root (hd0,1)
kernel /vmlinuz-2.4.18-3 ro root=/dev/hda3
initrd /initrd-2.4.18-3.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1


And this works great.

You will also have to appropriatly change this to fit your configuration.

datachild
05-05-2004, 04:23 AM
hey gay :D

[XC] moddolicous
04-07-2005, 07:46 PM
Just to make sure, u can dual boot with 2 linux OS's, 1 windows & 1 linux, or two windows right? It doesnt have to be anyweird combination does it?

shadowing
04-07-2005, 08:19 PM
Just to make sure, u can dual boot with 2 linuxOs's, 1 windows & 1 linux, or two windows right? It doesnt have to be anyweird combination does it?

You can do it any way.

I'd rather much use GRUB.

And Windows can detect Linux partitions. Only if the Linux partitions are ext2. But that would require a driver to be installed in Windows...

KingGuru
06-16-2005, 04:06 AM
it's a lot easier if you want dualboot, to start with windows.. cuz it tend to overwrite mbr

[XC] moddolicous
07-29-2005, 04:54 PM
Alrite, I'm gonna try linux on my box downstairs, so can I have a few questions.
1: I can load linux now after a windows install, or should I do it before a windows install.
2: I'm trying gentoo (I know, not for a beginner) so I downloaded the x86 version and it had 1 670mb iso and one 60mb iso. Which do I boot from?
3: Is it true that I have to make a swap drive or something (a partition of my hard drive for files & stuff).
If I think of anything else I'll post here. Thanks for your help.

masterofpuppets
07-30-2005, 02:43 AM
My guide to booting Windows using GRUB:

1. Install your Linux distro as you normally would. Preferably on a second volume, rather than another partition.

2. Install Windows on the second disk.

3. Open grub.conf (or menu.lst, depending on your installation)

4. Add this entry:

title Microsoft Windows
rootnoverify (hd1,0)
make-active
map (hd0) (hd1)
map (hd1) (hd0)
chainload +1

Now, the first line, creates an entry in GRUB. The second line, sets the partition to boot from, without verifying what filesystem it contains, otherwise NTFS filesystems throw out an error. Since Windows will crash and die if it isn't the primary active partition, the next 3 lines set the root to active, then map the root to hd0, fooling Windows into thinking it is the first active partition. The final line executes the first block on the partition, loading the Windows bootloader.

5. Reboot, when GRUB loads, you should be able too boot into Windows using this new menu entry.

Note: If you want to have Windows as a partition on the same disk as Linux, just remove the map commands, and change the root accordingly.


PS: moddolicous, use the 60MB one, imo. The 700MB one contains a stage and a portage snapshot, which is convenient, but oh so out of date. You don't need a swap drive, you need a partition. Just RTFM word by word, then you can't go wrong.

KoHaN69
03-05-2006, 12:30 AM
THANKS!! this helped me A LOT too :D

frak
01-30-2007, 06:28 PM
Umm... Why didn't you use the built in partitioner, built in to almost all Linux distros, its usually safer, faster, and easier than doing it separately with another program.

Webster
04-23-2007, 07:07 PM
I have a box dedicated to Linux.

Dual boot was just got too boring after a while. I got bored one day and now I guess you could classify it as a Hendeca(11)-Boot system

There are still a few i just havent gotten around to adding yet, i think i have all of the following

XP
Fedora Core 6
Ubuntu 6.10 (need to upgrade)
PCLinuxOS 2007 RC3
Mandriva 2007
Sabayon 3.3
Slackware 11.0
simplyMEPIS 6.4
Debian
Vector
Knoppix

Waitin on SuSE 10.3

Thats on like 2 Hard Drives

weitaohd
08-29-2007, 08:56 AM
hey gay

Arkangyl
09-13-2007, 09:07 AM
okay, I could really use some help here. I knew I wanted Linux eventually (and maybe vista) so I originally setup my computer as such

160gb SATA HD (sda)
-80gb Windows XP, NFTS
-40gb blank for Vista
-40gb blank for linux

500gb SATA HD (sdb)
-500gb NTFS (had some large files at FAT32 couldn't hold and decided I'd rather deal with not being able to write in Linux)

then I installed XP (a few months ago), recently I got around to Linux (Ubuntu 7.04, 32-bit) and using the LiveCD installer did the following

-deleted the linux and vista partitions
-made a 1024mb Swap partition
-made a 79gb ext3 Linux partion that I installed Ubuntu on
-tried to install nvidia drivers, had to rebuild the kernel, kind of messed everything up (gksudo opened blank files so I couldn't alter anything)
-re-installed Ubuntu (deleted & reformatted the linux partion, still ext3)
-gksudo now works! edited menu.lst as perscribed above such that:

title Windows XP
rootnoverify (hd0,0)
chainloader +1

aaaaand, it says starting system after I select it in Grub and then... nothing, it just hands there saying "starting system"

so, did I do something wrong or is my Windows toast? I can still see all the files thru Ubuntu so I'm thinking Windows is still fine, it's just pissy that it's not the 'main' OS on the HD. Any ideas about what I can do to fix it? I really need to get back to Windows for schoolwork (probably a dumb time to start messing with this, but ehhh, too late)

thanks

KingOfToasty
07-08-2008, 07:44 AM
SMIZZZZZZZZZZ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Dude i am stuck in thiz linux with no way back into windows......I have it on a different partition but i want back into windows i need some boot configuration help!!!!!!!!!!!!!! I cannot format cuz i have things i cannot lose.... I know you can fix it for me

You could put in your windows install disk, start up in recovery mode and run the command FIXMBR from the command line. Should repair your MBR and let you boot back into windows. You would have to reinstall your linux bootloader, though as this would no longer allow you to boot into linux