TechSpot

Dual Booting Windows and Linux: 2 different drives

By Windows2Linux
Mar 22, 2005
Topic Status:
Not open for further replies.
  1. Hello,
    I have Windows XP Home installed on one 40 gig drive
    I installed Redhat Linux on a second 40 gig drive

    When I rebooted I got the boot option to run either Linux or DOS
    I chose DOS to boot to XP (which obviously isnt right) and I was given the choice to do a System Recovery or System Restore.....

    Is there a way to change the boot.ini file in xp to include Linux ? Or a way to get Linux to include "Windows XP" rather than "DOS" in the boot menu?

    Thanks for any input

    Windows2Linux
  2. Phantasm66

    Phantasm66 TS Rookie Posts: 6,504   +6

    go into linux.

    ensure that /etc/grub.conf is correctly pointing to your linux installation.

    /sbin/grub-install /dev/hdb1

    where hdb1 is your linux /

    then:

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

    creates bootsect.lin file in pwd, copy this to c:\

    boot into DOS, run this command:

    fdisk /mbr

    reboot, you will go straight into XP.

    with bootsect.lin file in c:\, edit boot.ini to have the following line at the end:

    c:\bootsect.lin = "Linux"

    Save and reboot, you will be able to boot linux from the XP boot menu.
  3. Windows2Linux

    Windows2Linux TS Rookie Topic Starter

    grub.conf file

    Phantasm,
    Thanks so much for posting. This is obviously a very concise fix to my problem, yet being new to Linux (and lucky I was able to even install it <LOL>, I regret that it is over my head.

    Here is my grub.conf file but I wasn't sure what to do with this "ddif statement". From what I could gather online, it is a copy command, so I kinda see where this is going, but on a very limited scale.

    # 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 (hd1,0)
    # kernel /vmlinuz-version ro root=/dev/hdb2
    # initrd /initrd-version.img
    #boot=/dev/hda
    default=0
    timeout=10
    splashimage=(hd1,0)/grub/splash.xpm.gz
    title Red Hat Linux (2.4.20-8)
    root (hd1,0)
    kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
    initrd /initrd-2.4.20-8.img
    title DOS
    rootnoverify (hd0,0)
    chainloader +1

    If this does look legit, then do you mean I should add the "ddif statement" in the grub.conf file somewhere or should it be somwhere else.

    Thanks Phantasm
  4. Technel

    Technel TS Rookie Posts: 28

    Like you said, DD is a Linux command used to copy and convert a file. You should type that command into the terminal (not add it to the configuration file). See this article. Also, type "dd --help" in terminal for more information on the command.

    Hope that helps.
  5. Phantasm66

    Phantasm66 TS Rookie Posts: 6,504   +6

    You will need to boot into the various different environments I mentioned, Linux to do the following, in a terminal window as root.

    /sbin/grub-install /dev/hdb2

    command, which will install the grub bootloader to the / partition

    dd if=/dev/hdb2 of=bootsect.lin bs=512 count=1

    creates a file called bootsect.lin in the current directory, which is a binary copy of the first 512 bytes in your / partition (which is hdb2 from your grub.conf file) which we will use with the XP bootloader.

    then boot into DOS, using a Windows 98 boot floppy, or as I recall the Windows 98 CD was bootable, and do this:

    fdisk /mbr

    Or, as I recall, if you don't have a win98 disk, you could boot up from the XP disk, go into recovery console, and do:

    fixmbr

    and

    fixboot

    but I think that the fdisk /mbr command is needed. Maybe the recovery console supports that, I don't know. In any case, you need to remove grub from the master boot record. here are some instructions : http://portal.suse.com/sdb/en/2002/09/fhassel_deinstall_grub.html

    when this happens, you should find that you boot straight back into XP. If not, boot from the XP CD and do the fixboot, fixmbr etc.

    then, copy the bootsect.lin file you created earlier into the c:\ directory.

    Go into windows explorer, settings and make sure you see all hidden and system files, then a file called boot.ini will show up in c:\

    edit that file in notepad to have

    c:\bootsect.lin = "Linux"

    at the end of the file. reboot and you should be able to select linux from the boot menu.
  6. Nodsu

    Nodsu TS Rookie Posts: 9,431

    The DOS entry in boot menu is just a name. You can change it to read "Windows" in grub.conf if you like. As far as I can see from your grub.conf file everything is just fine.

    Maybe the thing you booted from under DOS was some system recovery partition?
    Try changing the rootnoverify line to read (hd0,1) instead of (hd0,0)
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.