Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-26-2007, 01:57 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
Smile making a dual boot system..using grub in ubuntu 7.04

hey gyes .....
hi to all.....
actually am using linux for the first time ...n i hav sucessfully instaled ubuntu 7.04 on my hard drive of 10 Gb ...i hav a win xp prof installed on my 80 Gb hard i hav to make dual boot systenm giving windows default preferance ...i search a lot over net, there i found that i need to make changes in grub boot loader ,is it true???if, then plz tell me the details like how to do it ...n wat the shit this boot loader is ....n also tell which hard disc i should make master n which i should make slave ....thank u am waiting for the reply ...bye have a nice day..whosever sees it ..\
Old 07-26-2007, 04:41 AM   #2
Registered: Jul 2007
Distribution: Slackware 13
Posts: 178

Rep: Reputation: 29
I don't use grub, but in a nutshell, Windows' bootloader will not boot anything but Windows or DOS, a Linux bootloader (such as GRUB or LILO) will boot anything.

Some basics about dual-booting:

Your "master" and "slave" have nothing to do with dual-booting or setting up a bootloader. It is how the hardware itself is installed. You have to make sure the jumpers on the back of the hard disks are set properly before you insert and connect them and close your computer case. Refer to your hardware manufacturer website for instructions and call them for help.

If you could see both disks from your operating system, they were most likely correctly installed. You will also see messages from your motherboard BIOS (Basic Input-Output System) while it was detecting hardware, before any operating system started.

You have to have a bootable operating system on the "master" hard disk. In fact, I think they may both need to be on that disk. With Linux it is easy to have multiple disks or partitions combine to make up a filesystem, (e.g., the filesystem split across multiple hard disks/partitions). So your core system can be on one partition, most applications on another, users' "home" directories on another. You can't do that with Windows, but at least, if you have XP Pro (not Home), you can put users' "My Documents" folders on seperate partitions or disks.

So, in this way, you will get the usage out of both disks. It is also faster for performance, because both disks can be seeking or writing at the same time. You will never run two operating systems at the same time, but you will certainly run an operating system while you are writing files!

No matter how you set up the partitions, the Linux bootloader (GRUB) must be configured and installed after you install Windows. It must be able to find the partition with the Windows OS in order to add it to the list of OSs to boot!

You can install the bootloader to the partition on which Linux is installed, or you can have it written to the MBR (Master Boot Record, a special section of the hard disk), and this has to be on your "Master" hard disk. Installing to the MBR is the most common choice, but is potentially dangerous if you mess it up. However, installing it correctly is easy to do (at least it is with LILO)...if you mess up it would be a matter of not knowing what you're doing first!

An outline of tasks to install a dual-boot system:
  1. Read the documentation for your Ubuntu. It will explain all this in detail. Each distro has their own install routines, choices of methods, etc.
  2. Plan your "partition scheme" on paper.
    • I don't care what Microsoft says about their system requirements, even in certification, it is wrong. Assuming all of Windows is in 1 partiton (including users' "My Documents"), you need to keep at least 20 GB for Windows XP. Otherwise, if you let it get too fragmented, defragmentation will fail! (That happened to me with 15 GB, with MySql running, thanks to all the database changes.)
    • Some Linux guides will say 2GB is enough for the "/" (main) directory, as long as you keep the "/home" on a seperate partition, some say 4 GB I noticed Slackware took up 2/3 of 4 GB right after install, so I re-did my system and gave it 8 GB.
    • You need to have a "swap" partiton. It's like how Windows uses Virtual Memory, only better, because being confined to a specific partition, it can never take space from your other files or cause more fragmentation. It should be equal to 1 or 2 times your computer's RAM (memory). Should not need more than 2 GM, though.
    • How big the partition for "/home" is depends on your habits for collecting documents, pictures, music, video, etc.
    • Some people suggest having "/usr/local" on a seperate partition, because most user applications go there, so it will grow over time.
  3. Backup whatever you need to before partitioning. I generally zip up My Documents, and also another folder where I save all program installers (I don't run them from the web, I'd rather keep them). I put these on CD or DVD. But you will need to export/backup specific profiles for some applications, like Outlook Express, Firefox, Thunderbird, Internet Explorer, unless you don't mind losing all your bookmarks, addresses, and emails. For Firefox and Thunderbird, there is a new extension FEBE (Firefox Environment Backup Extension), which you can use to backup entire profiles. Look for it on
  4. Use a tool to partition your disk(s). "Parition Magic" is a popular 3rd-party tool, "fdisk" and "cfidsk" come with most distros, "qtparted" is a menu-driven tool that comes with some distros. I prefer "fdisk" because it is the most straightforward. Start it with "fdisk /dev/hda" because you must specify a hard disk to even start the program (use "/dev/sda" if disk is scssi), then type "m" for help menu, which is just a list of the other commands.
  5. You can have up to 4 primary partitions on 1 disk, (or 3 primary and 1 extended). If you need more than 4 on a disk (I doubt it), then you make 3 primary and 1 extended, the extended is just a "container" for smaller "logial volumes", which you also create.
  6. With this tool, you must also choose what "type" of partitions these will be (not actually format, though), and mark the OS partitions as bootable. For example, you will chose HPFS/NTFS (Windows), linux, linux swap.
  7. Mark the OS partitions as bootable. Only primary partitions can be bootable. Save your changes.
  8. Put in your Windows CD and install Windows to the first partition on the master hard drive. You can format as FAT or NTFS. NTFS is better because you have more control over file permissions. If you are going to use an extra partition (later, by hand) for My Documents, format that partition, now, too. A bonus with FAT is that Linux can read and write FAT as well. It can still read NTFS.
  9. When you are all done with Windows setup and configure (generally you are not done after you are able to log in, it will reboot and do things a couple more times), put in the Linux CD, and reboot.
  10. Follow your distro's instructions to install, and you may be able to install several ways (usually levels of difficulty/customization).
  11. Follow instructions to configure and install the bootloader.
  12. Even if bootloader configuration is menu-driven, you will need to make some correct choices -- identify the bootable Windows and Linux partitions, choose a name for them, set a timeout and which OS to boot if a user doesn't make a choice on startup, identify the other partitions, specify what part of the filesystem will be on the partitions (in Linux).
  13. For dual-boot systems, the norm is to install to the MBR. Consult your documentation.

For an example, here is a handwritten copy of my "fstab" (filesystem table) from fdisk:

Device        Cylinders    Boot Id  Type
/dev/sda1        1-3736     *    7  HPFS/NTFS
/dev/sda2     3737-4733     *   83  Linux
/dev/sda3     4734-4983         82  Linux swap
/dev/sda4     4984-9729          5  Extended
/dev/sda5     4984-6229         83  Linux
/dev/sda6     6230-9729         83  Linux
* Windows Media Center
* "/" (Linux OS)
* Linux swap
* extended
* "/usr/local" (Linux)
* "/home" (Linux).

My plan called for 5 partitions. But I can only have 4 primary because I have 1 hard disk. So the 4th must be an "Extended", which is just a container for the last 2.

You don't need to know GB-to-cylinders conversion, only GB-to-MB, which is 1024. For each parition, you can choose a default "first" cylinder by pressing Enter, and for "last" cylinder use +4096M (means make it sized 4096MB = 4GB). Actual space will be a little less in the end because partitioning takes up a little info itself, but you don't need to worry about that.

At boot, I am given a choice between my Windows OS, which I named "WindowsMC" (for Media Center), and "Slackware12". There can be no spaces in the name in the bootloader. If no choice is made in 30 seconds, the bootloader chooses one (you define this in your when you configure the bootloader).

You may decide, based on how big you want various partitions, to change which hard disk is the "Master" and which is the "Slave". To do that, you have to read the manufacturer's documentation (copy their phone # in case you need it), power off and unplug your computer, open the case, remove the hard disks, and actually change the jumpers on them, then put everything back. You have to do this before you do all your partitioning and installing.

I really think you will need to make the 80 GB hard drive the Master. I can't imagine 10 GB even for Windows all by itself.

Here is a rough plan for my desktop (when I'm done with my laptop):

Device        Cylinders    Boot Id  Type
/dev/hda1        ???        *    7  HPFS/NTFS
/dev/hda2        ???        *   83  Linux
/dev/hda3        ???        *   83  Linux
/dev/hda4        ???            82  Linux swap
/dev/hdb1        ???             7  HPFS/NTFS
/dev/hdb2        ???            83  FAT
/dev/hdb3        ???            83  FAT
/dev/hdb4        ???            83  Linux
Disk 1 (40 GB):
* Windows XP -- 20GB
* Slackware 10.2 -- 10GB
* future other linux -8GB
* Linux swap -- 2GB

Disk 2 (120 GB):
* Web -- 40GB (webserver, database, websites)
* Downloads -- 40GB (downloaded programs, registry backups, backups of web templates, etc. Yes, I really have a seperate partition for all that stuff! It doesn't even fit compressed onto a CD, only a DVD.)
* My Documents -- 20GB
* Linux "/home" -- 20GB

I can only imagine that since you will probably need your larger hard drive for your OS partitions, if you don't want to limit your personal files, documents, music, etc., you'll end up with those filesystems on the same disk as the OSs, and maybe use the 10GB for a mixture of swap and "/usr/local", or something like that. It depends what you use your computer for.

Last edited by ShellyCat; 07-26-2007 at 04:49 AM.
Old 07-26-2007, 11:07 AM   #3
Registered: Jan 2007
Posts: 50

Rep: Reputation: 15
excellent work ShellyCat.
tons of knowledge.
Old 07-27-2007, 01:19 AM   #4
Junior Hacker
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I couldn't be bothered to waste my time reading the "cut/paste" lecture in the prior post.

Most people prefer to shoot first, then ask "why does it not work" questions after. This link shows how to install Ubuntu after Windows on the same drive, but should be generally the same as using a second hard drive for Linux. Just have to remember to install the boot loader in the MBR of the drive set to boot first in the bios, which is usually Windows as I'm guessing the 10GB hard dive was added after and should be set to slave. In this "proper" method, you would install the boot loader to /dev/hda for an IDE drive or /dev/sda for a SATA drive during the Ubuntu installation, which is the MBR of the Windows drive if my assumption is correct. Then you just boot her up and pick the one you want.
But most newbies to Linux are afraid to overwrite the MBR of the Windows drive and install the boot loader to the slave "Linux" drive instead, because they don't know that they can actually restore the Windows boot loader in it's MBR in two minutes using the Windows installation CD or the neighbors Windows installation CD if they wanted to reverse the setup. Then they spend a couple days/weeks trying every other backwards method and eventually reinstall and do it right "the second time" rather than do it right the first time.
In the link provided it this post you can find how to edit the boot loader to make Windows the default.
Old 07-27-2007, 03:06 AM   #5
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
In order to boot windows by default, you need to edit the "default" item in /boot/grub/menu.lst. Right now it should look like this:

default 0

This means that grub will boot the first entry from the list of operating systems in menu.lst; as Ubuntu is at the top of the list, this obviously means that it will be booted unless the windows item is manually selected instead. Now, if you want to boot any other OS entry, you simply replace 0 with the number corresponding to that entry (remember, grub starts counting from 0 - so a third entry, for example, would be 2).

One other thing you could try is editing the timeout value. Just as there is a default item in menu.lst, there is also a "timeout" value, which is usually set to 3 by default. This means that grub gives you exactly three seconds to change your mind and act on it or it boots Ubuntu. If you think this delay is too short (it often is for me when I'm having one of those confused days), then you raise this to anything you like: 15 means 15 seconds, 15000 means - well, someone else do the calculation - all I know is that it will be quite a while before grub boots the default OS (unless the user intervenes and makes a manual selection, of course, which simply overrides any timeout value). If you're fond of weird options, set the timeout to -1, then the default OS will boot in -1 second. Huh? No, not really, if you use -1 grub will never boot anything until the user makes a selection; this too can come in quite handy, for example when you really haven't got any preference at all, or if you're just a bit slow-witted and it takes you minutes to figure out just which Os you'd like to have today .

And now for the editing:
sudo gedit /boot/grub/menu.lst

Have fun!

Last edited by jay73; 07-27-2007 at 03:09 AM.
Old 07-28-2007, 03:02 AM   #6
LQ Newbie
Registered: Mar 2007
Posts: 6

Original Poster
Rep: Reputation: 0

hey shelly ....thanks a lot .......
u did a splendid job ...
tons of knowledge ...others too contributed a lot ....thanks again ....bye ,....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make XP boot as default OS in WinXP-Ubuntu dual boot system svin Ubuntu 14 11-04-2009 04:49 PM
grub dual boot ubuntu/windows dellcom1800 Linux - General 1 01-25-2007 06:02 AM
Is Grub necessary for Dual boot system JOR000 Linux - General 6 09-02-2005 12:28 PM
Grub will not load Windows XP with Ubuntu dual boot Alex4R Linux - Software 1 03-26-2005 11:29 AM
help! grub does not boot the system! dual HD, 3 OS parv Fedora 3 08-31-2004 08:40 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration