Thursday, December 22, 2005

How to install linux sucessfully on a system that has Windows XP preinstalled
Here in this tutorial we wil be discussing how to install linux sucessfully on a sustem that has Windows XP preinstalled.In this tutorial we wil be using Ubuntu as the linux distro(because that is what someone asked for) but please don't blame me if anything goes wrong.We will be here using Norton partition magic to create the Partition.Here are the steps

1.If you need Partition magic only for
partitioning ur HD then the boot image will just work fine.It
is a 2.87 MB of download.

  • Link1.

  • Link2.

  • if clicking on the links didn't download the file then copy paste the link in the address bar of your browser.That should work.

    2.After downloading the Zip file extract the ISO disk image
    from it and burn it on a CD(prferably RW CD if u don't want
    to loose a cd by just writing 2.87 Mb to it.LOL)

    3.Now Pop that CD into your CD drive and reboot your
    system.The System will boot from the CD Rom if it don't boot
    from the cd change the BIOS option and set the primary boot
    device as CD-ROM(this option is found under the advance bios
    setup in case of Award BIOSes).Now the "Norton partition magic"
    GUI will open.

    4.As u said You have windows XP preloaded.Depending on the
    type of file system Partition magic will show you the disk
    information.if win xp was installed in ur system using the
    default NTFS file system you will get some thing like this in
    your screen.Here i have three NTFS partitions and Win XP is on the first partition i.e. C drive.

    5.Before continuing to this step make sure that the last partition in my case the third parition,if you have some important data in it make back up.beacuse this is the partition we will format and install Ubuntu Linux.Now click on the delete partition button.(or else Operations->Delete...).It will come up with a confirmation dialog type "OK" and press "Enter"

    Now you will have unallocated space at the place where that partition used to be.As shown below.

    6.Click on the "Apply" Button.It
    will come up with a dialog saying "1 operations are currently
    pending.Apply changes now?"Click "Yes"(Obviously).

    It will start processing as shown below.

    and after all operations Completed successfully click "OK".Now Click "Exit".if you get a prompt for restarting.Clicking on
    "Details>>" will show details that why should you restart
    your pc.however Click "OK" to restart your PC.if no such dialog box appeares(didn't appeared in my case)else use Ctrl+Alt+Del to restart the system.Now if you still have the partition magic CD then it wil show you the
  • 1 NTFS primary,1 NTFS Logical and 1 unallocated space

    7.Now you have your desired partitions.Take out the Partition
    magic CD and put a bootable Ubuntu cd.Restart your system.wait for it to boot.You wil get the screen as shown below.

    I am using a original ubuntu CD.then pressing enter will start the loading the linux kernel.when the language selection dialog box appears chose your desired language(english in my case) then choose the country(india in my case) from the country selection list.then it will prompt for the type of keyboard choose (north american english in my case).Then it will start the hardware detection and load other modules.Then it will ask for the Hostname.Change it if required or continue as default (like me).Then it will start disks and other hardware.

    8.Now you will get the "Starting up the partitioner" screen.Then after the Partitioner gets loaded it will show up the "Partition Disk" screen as shown below.

    select "Use the largest continous free space".Then it will show what partirions will be created.Select yes to Begin formatting the partition.

    After the formatting it will start installing the base system.

    Then it will come up with a "copying remaining packages to hard disk" dialog box.
    PS-This is the the most painful linux installation i have seen yet.The easiest installation is Xandros followed by Linspire(If you really want to try a debian based linux system then go for Xandros or Linspire else you can try SuSE).Then comes Suse,Mandrake 10.1 and Fedora core 4.I have tried all these distros on my system(not on Virtual PC)I have Win XP,Win 98 and SuSE and a free partition on the second HD that i use to try out different distros.Secondly Ubuntu uses ext3
    Thwn it will ask for the "Time zone configuration".select "No" if you are not living on Greenwich.

    Then it wil ask for user account configuration.Enter the information as required.

    Then configures some other setings like the network and the secutiry agent.

    9.This is a very important step.Here it will ask you for installing the grub bootloader on the MBR(Master boot record).

    It means it will overwrite the Windows XP bootloader i.e. the ntldr bootloader of Win XP.If you install grub boot loader on your mbr i am not sure whether you wil be able to boot in to Win XP or not.I could not boot into win XP after installation of SuSE Linux as it installed the grub bootloader on the mbr and when selecting Windows from the grub menu used to show error.But we don't have any other way of installing it on the mbr.Or else you can't boot into the newly installed system i.e. ubuntu.
    PS-However there is a way but lets keep it simple.
    So select "Yes".It will start instaling the grub bootloader.Then it will come up with the "Finish installion dialog box"
    Select "Continue".It will finish the installion and reboot the system.

    10.This may be the last step if everything goes fine.means if we are able to boot into both ubuntu and Windows XP successfully.So after reboot you will get the grub bootloader menu.

    It will surely be able to boot into ubuntu.So lets se whether we can boot into Win XP or not if "Not" then we have to do something else i.e. we have to perform the step 11.Ok in my case it worked ferfectly without problem.I was able to boot into Win XP.Now lets see whether it can boot into Ubuntu or not(obviosly it will).Ok it worked fine for both the cases.So finally we are done installing Ubuntu Linux on our system without distrubing our existing OS(i.e. Windows XP).
    PS-The initial boot will install some more packages to the system.So please be petient.It will configure a lot of things.

    Then it will ask for the resolution i chose 800*600.The i will still continue configuring the system.(What a crap!Sorry Ubuntu lovers)

    11.This step is for those who failled in the previous step.It is divided into two parts.Lets name them as A and B.In the part A we will discuss how to successfully configure the grub bootloader so that it will be able to boot into windows XP and in the part B we will discuss How to successfully configure the Windows XP bootloader i.e. ntldr so that it will successfully boot into the linux partition.


    GRUB counts drives detected, by counting from ZERO like this 0,1,2 etc.
    So drives are (hd0) (hd1) (hd2) etc

    Don't forget the dual boot issues above.
    please note that C drive must be on a primary does not need to have a bootable flag as the MAKEACTIVE command fixes all.

    I tested with W98 and win xp and 2000.
    Until recently I used the rootnoverify with the hide command. I have decided to make it more linux like with the use of the root command but now greater use of the map command for drives and partitions.So add these lines to your menu.lst file.

    # file is /boot/grub/menu.lst

    title Windows
    root (hd0,0)
    chainloader +1

    We assume Windows on C drive? which is /dev/hda1 = (hd0,0) and in we are telling GRUB that irrespective of whether DOS had it bootable or not, make it bootable, then accept a new bootloader to complete the process.

    FOR MICROSOFT (MS) on first drive and NON-FIRST partition

    title MS on NON-FIRST partition
    root (hd0,7)
    map (hd0,7) (hd0,0)
    map (hd0,0) (hd0,7)
    chainloader +1

    title GO TO mbr instead
    rootnoverify (hd0)
    chainloader 0+1

    Here I no longer use the rootnoverify command but align to the linux way of defining root and verify that grub knows the filesystem fat.

    The 2 map commands are to swap TRICK MS into thinking your hda8 or sda8(for scsi drives) partition is actually first drive first partition. You need both swaps for it to work.
    It does not matter if you mention hd0,7 or hd0,0 as the first command as long as they both show a true SWAP.

    The title GOTO allows a sneaky way of getting to the mbr of the first drive, and then letting it boot to the C drive. Likely to be used by those who have MS on first drive and testing Linux on second drive.

    PS-Expert user can Try playing with the grub command shell to find their own way.
    This way you can configure the grub boot loader and choosing windows will start the ntldr bootloader of windows XP(in this case) which will lead to booting into windows XP.

    Following are the steps to get dual-boot working with GRUB; I
    figured out how to do this by looking at a
    similar procedure for LILO. I've verified that this works for
    Windows 2000 and Windows XP, and this should work on Windows NT
    (all 3 OSs use the same booting architecture).
    PS-I tried this on SuSE Linux 10,Ubuntu 5.1 and Xandros Desktop OS 3 Open circulation Edition.This trick worked fine for me in all the three cases.

    1. Install GRUB on the first sector of the /boot
      partition. DO NOT INSTALL IT ON THE MBR!.
      Since you already have Ubuntu Linux installed:

      • Run the following command (e.g. assuming /boot is
        /dev/hda2,Which is our case):

        open a terminal
        $ su
        $ root password
        $ grub
        (prompt or cursor changes to GRUB>.)
        $ root (hd0,2)
        $ setup (hd0,2)
        $ quit
        Or else you can also do this while booting.Press C to bring up the grub command prompt.write root (hd0, then press TAB.It will show you the existing partitions and their filesystem.In this case the partition 2 bears importance as it is the required linux partition we are looking for.The complete the command as root (hd0,2).The write the commands setup (hd0,2).

        This is my case may be different in your case
        If you don't know which partition contains /boot, run
        the df command and check the output.

      • Edit /boot/grub/menu.lst and make sure there is an entry for your version of Windows.As this will let you to boot to windows even if if you selected Linux in the boot menu

    2. Determine which partition contains the /boot partition by running the df command. You'll see output like this:

      Filesystem 1k-blocks Used Available Use% Mounted on
      /dev/hda3 8665372 1639580 6585612 20% /
      /dev/hda2 46636 5959 38269 14% /boot
      /dev/hda6 513776 189504 324272 37% /osshare
      none 256624 0 256624 0% /dev/shm

      From this output, we see that /boot is on

    3. Make a copy of the Linux boot sector onto a folder. We'll name this copy linux.bin.
      now create a directory say i create one on /home/jitun/osshare/.this is the path to which we will extract the boot sector of the llinux partition i.e. dev/hda2.So in order to do that run the command dd if=/dev/hda2 of=/home/jitun/osshare/linux.bin bs=512 count=1
      Now copy the file to a windows Partition any folder you like as long as you can remember its location.Alternatively you can give the path of that folder directly in the dd command (of=/Windows/C/AnyFolder/linux.bin this structure is for SuSE Linux,Don't know about Ubuntu.The bootsector will be extracted to The folder named "AnyFolder" on 'C' drive.)

      • Run the following command: dd if=/dev/hda2
        of=/home/jitun/osshare/linux.bin bs=512 count=1

        Substitute the path for the if= parameter (the input
        file) with the appropriate partition from the previous step. E.g.,
        set if= to /dev/hda2. Substitute the path for the
        of= parameter (the output file) with whatever is
        appropriate for your system. The example here
        (of=/home/jitun/osshare/linux.bin) is for copying onto a directory called osshare.

    4. Insert the windows XP Bootable disk in your cd drive and boot from it.when asked for what to do i.e. install or repair choose repair(means press 'R')Then the recovery consol will open and ask you for the windows installion you want to repair.Obviously it will show 1.C:\ it and log into it.Then write the command fixmbr to get the ntldr bootloader again on your MBR.

      Reboot and you will land into Windows XP.

    5. Copy the linux.bin file to C:\

    6. Run notepad and edit C:\boot.ini. Note that
      C:\boot.ini is a hidden system file, so it probably won't
      show up in Windows Explorer. To edit the file, try:
      Start->Run and enter: notepad C:\boot.ini. Add
      the following line at the end: c:\linux.bin="Ubuntu linux"
      If your C: filesystem is NTFS(As in this case)
      (not FAT32), you must edit C:\boot.ini as a user with
      administrator-level privileges.

      To make C:\boot.ini writable,
      you can either :

      • Use Explorer:

        • Go to Tools->Folder Options->View and select
          Show hidden files and folders and deselect Hide
          protected operating system files (Recommended)

        • Right-click on the file, view the Properties and
          uncheck Read-only. You can now edit the file.

        • After editing the file, restore the settings to their original

      • Use the command-line:

        • Make the file writable: attrib -R -S -H

        • After you've finished editing the file, put the settings back:
          attrib +R +S +H C:\boot.ini

    7. Reboot again.You will get a Boot menu like below.

      You should be able to pick either Windows or
      Linux. Selecting Linux will start GRUB


    Post a Comment

    << Home