Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Grub2 and Windows XP Bootloader (NTLDR)

  1. #11
    Join Date
    Nov 2009
    Beans
    2

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    Okay, after fighting with this myself for the past few days, I thought I'd post some specfics on how to accomplish this, since I've been messing about with this for the last 3 days, there may be a step or 2 missing, please report back if this doesn't work for you.

    In my case this is on an Asus EEE PC netbook, with windows installed in

    /dev/sda1
    /dev/sda5
    /dev/sda6

    Unbuntu is installed in

    /dev/sda7 (single root partition)
    /dev/sda8 (swap)

    Currently when machine is started it boots right into windows with no option for linux.

    1) boot karmic live CD
    no problem there, however I open a terminal and type "sudo -s" so I don't have to keep typing sudo before any of the commands below.

    2)read MBR to file1 (with dd, iniital 512 bytes of disk)

    I mounted a sdcard as /media/scdard1

    dd if=/dev/sda of=/media/sdcard1/xp.mbr bs=512 count=1

    note, to verify you have a proper file (my first attempts came out blank), run

    xxd filename.mbr

    it the result is all zeros you did it wrong, you should see lots of hex codes and in the asci text to the right you see mention of missing operating system and things like that.

    3) mount karmic partition and /dev and chroot to it (hints how to do it without chroot did not work for me! so don't waste your time)

    chroot is NOT necessary, however you will have to mount the root partition, in my case

    mkdir /media/sda7
    mount /dev/sda7 /media/sda7

    NOTE: when a friend and I were looking at this, we found that the stage1, stage1_5 and stage2 files were missing from /boot/grub directory, I had to manually copy them (from memory) from /usr/share/grub, this might not be necessary.

    4) reinstall grub, this time to MBR (!) ("grub-setup /dev/sdx" is enough)

    based on #3

    grub-install --root-directory=/media/sda7 /dev/sda
    Optional
    if you reboot at this point, grub should come up, since I didn't have a menu.lst file setup, I had to type the following to load it up, taken pretty much verbatim from the Grub Grotto site at

    grub> root (hd0,6)
    grub> kernel /vmlinuz root=/dev/sda7
    grub> boot
    This is what I added to my menu.lst file

    timeout 2
    default 0

    title Ubuntu 9.1.0
    root (hd0,6)
    kernel /boot/vmlinuz-2.6.31-14-generic root=/dev/sda7


    5) read MBR to file2

    again using mounted sd card

    dd if=/dev/sda of=/media/sdcard1/ubuntu.mbr bs=512 count=1

    6) reinstall MBR from file1

    dd if=/media/sdcard1/xp.mbr of=/dev/sda bs=512 count=1

    7) give file2 to NTLDR (boot.ini)

    as per this slashdot article

    http://linux.slashdot.org/comments.p...5&cid=13422290

    I enter the following at the bottom of boot.ini

    C:\ubuntu.mbr = "Ubuntu 9.1.0"

    copy the ubuntu.mbr file to the root of c: drive

    8) reboot, now the NTloader menu has both a windows and a linux option, choosing the linux option, gets you to the grub menu and a few seconds later boots up Ubuntu
    Last edited by sibble-comp; November 17th, 2009 at 10:24 PM.

  2. #12
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    12,816
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    With all the respect and the possibility of having stones thrown my way, all of this procedure just to avoid grub2 booting both windows and ubuntu?
    I understand everyone has his reasons but this just creates more possibilities for problems. Not to mention it's far from understandable for newbies (not that grub2 is ). And it really enlarges the procedure you need to perform to get you bootloader back in case there is problem with it.

  3. #13
    Join Date
    Nov 2009
    Beans
    2

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    Sure, that's true if you assume there is no other reason for not booting with grub, in my case using PGP WDE (whole disk encryption) means having the PGP BootGuard bootloader/authenticator in the mbr, it does not work the other way with grub in the mbr

    https://pgp.custhelp.com/app/answers...ot/r_id/105251

  4. #14
    Join Date
    Nov 2009
    Location
    Munich, Germany
    Beans
    12
    Distro
    Ubuntu 12.04 Precise Pangolin

    Exclamation Re: Grub2 and Windows XP Bootloader (NTLDR)

    Well, if fully admit that grub2 in the more powerful bootloader and can handle everthing much better than NTLDR.

    Nevertheless there are three not so newbie like arguments:

    1. the linux community kept blaming MS for fiddling around with an installed linux during windows install. So it a shame that ubuntu does exactly this without option to avoid. That ubuntiu does integrate windows into grub and keep it bootable is not an excuse. For me personally I have working XP system I use heavily for serious stuff. If I play with ubunutu etc. on another partition I does like to have my workhorse affected and I do not trust anybody not even ubuntu. Its a question of principles. And they should be the same for everybody.
    The really bad thing is that you tell ubuntu to install into boot partition instead of MBR and it just does not do it without error message.

    2. As XP is the stable OS and workhorse while linux is changed frequently it would be painful t rely on a boot loader that is suddenly gone with the linux and leaves the preexisting windows unavailabe.

    3. I have regularly other people from the family working on the PC (using XP). Confronting them with an unknown boot screen

    And BTW @darkod: I guess you better be careful calling other people newbies. There is life outside THIS forum as well which you don't no much about

  5. #15
    Join Date
    Nov 2009
    Beans
    4
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    This works like a charm. I would have to add that if you have only 1 hard drive (not sure about the case when ubuntu is installed on a separate drive) that you should do the following.

    1. Create the partitions for ubuntu using some partitioning utility that supports linux swap and ext3 before backing up the mbr for ntldr (gparted will probably suffice).

    2. back up your mbr using dd in the live cd session and save to a usb drive or a shared fat32 partition to file 1

    3. install ubuntu using live cd to those partitions and set your respective mount points.

    4. when installations is complete don't restart machine just continue with live cd session

    5. Then proceed with step 3 posted by pft42

    Quote Originally Posted by pft42 View Post

    The way that worked for me was this:

    1. boot karmic live CD
    2. read MBR to file1 (with dd, iniital 512 bytes of disk)
    3. mount karmic partition and /dev and chroot to it (hints how to do it without chroot did not work for me! so don't waste your time)
    4. reinstall grub, this time to MBR (!) ("grub-setup /dev/sdx" is enough)
    5. read MBR to file2
    6. reinstall MBR from file1
    7. give file2 to NTLDR (boot.ini)
    8. bingo

    I say this because if you don't create the partitions first.. upon restoring the mbr for ntldr the partitions for ubuntu will vanish. Well it did in my case on my laptop.


    I'm been trying to get ntldr to boot kubuntu for a while with no success so I stuck with fedora since I was always able to get ntldr to chainload to grub. Now that I can chainload and boot kubuntu I am eager to see what this distro is all about.

    I see there is much more support and forums like these for ubuntu than for fedora.

  6. #16
    Join Date
    Nov 2009
    Beans
    4
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    Quote Originally Posted by pft42 View Post
    Well, if fully admit that grub2 in the more powerful bootloader and can handle everthing much better than NTLDR.

    Nevertheless there are three not so newbie like arguments:

    1. the linux community kept blaming MS for fiddling around with an installed linux during windows install. So it a shame that ubuntu does exactly this without option to avoid. That ubuntiu does integrate windows into grub and keep it bootable is not an excuse. For me personally I have working XP system I use heavily for serious stuff. If I play with ubunutu etc. on another partition I does like to have my workhorse affected and I do not trust anybody not even ubuntu. Its a question of principles. And they should be the same for everybody.
    The really bad thing is that you tell ubuntu to install into boot partition instead of MBR and it just does not do it without error message.

    2. As XP is the stable OS and workhorse while linux is changed frequently it would be painful t rely on a boot loader that is suddenly gone with the linux and leaves the preexisting windows unavailabe.

    3. I have regularly other people from the family working on the PC (using XP). Confronting them with an unknown boot screen

    And BTW @darkod: I guess you better be careful calling other people newbies. There is life outside THIS forum as well which you don't no much about

    You are so right.... and hit this on the nail. Especially the part when you tell ubuntu to install grub to a boot partition instead of mbr. When I installed grub to the boot partition in fedora then used the dd command on that partition and then gave that file to ntldr it always worked. When I did this with ubuntu upon selecting it in ntldr I would get a GRUB _ on the screen with no response. Basically it does nothing. Still, your arguments for sticking with ntldr really do hit it on the nail. With all that said I ask now what is the advantage or reason to have a separate /boot partition in ubuntu. With fedora the reason was clear (installing the boot loader) with ubuntu since the boot loader will only install to the MBR then whats the point of a /boot partition?
    Last edited by jtGohan; November 24th, 2009 at 04:18 PM.

  7. #17
    Join Date
    Mar 2009
    Beans
    1

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    I had a similar problem - the load process stopped with a blinking cursor.
    Supposedly the boot sector was all zeros.

    Turns out that grub2 uses 1-based numbering for the partitions, which is obviously different from the previous 0-based counting.

    This confusion resulted in my grub install partition being off by one.
    Using the correct partition for grub install fixed the problem for me.
    (I reinstalled the whole OS from scratch - instructions for how to reinstall just grub2 are elsewhere).

    Hopefully that fixes it for other people too.

  8. #18
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    12,816
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    Quote Originally Posted by jtGohan View Post
    This works like a charm. I would have to add that if you have only 1 hard drive (not sure about the case when ubuntu is installed on a separate drive) that you should do the following.

    1. Create the partitions for ubuntu using some partitioning utility that supports linux swap and ext3 before backing up the mbr for ntldr (gparted will probably suffice).

    2. back up your mbr using dd in the live cd session and save to a usb drive or a shared fat32 partition to file 1

    3. install ubuntu using live cd to those partitions and set your respective mount points.

    4. when installations is complete don't restart machine just continue with live cd session

    5. Then proceed with step 3 posted by pft42




    I say this because if you don't create the partitions first.. upon restoring the mbr for ntldr the partitions for ubuntu will vanish. Well it did in my case on my laptop.


    I'm been trying to get ntldr to boot kubuntu for a while with no success so I stuck with fedora since I was always able to get ntldr to chainload to grub. Now that I can chainload and boot kubuntu I am eager to see what this distro is all about.

    I see there is much more support and forums like these for ubuntu than for fedora.
    Can you please be more specific when saying YOU SHOULD DO THE FOLLOWING? The threads are read by many people not all of whom wish to chainload grub2 to windows bootloader. And if they are new to dual booting this is definitely much extra work than they need because grub2 will just work for them unless they have specific requirements to keep windows bootloader.
    Plus your advice of creating ext3 partitions in advance will not let them use ext4, the latest filesystem with 9.10 version and also will additionally confuse someone new to linux and dual booting because that doesn't work like in windows. For windows if you create ntfs partition in advance you just tell it to use it. Because linux works with mount points, it will consider any existing partitions as unavailable. You would need to go into manual partitioning and reselect them again. And most people new to ubuntu do not even want to go in manual partitioning.
    The above can get someone in lot of trouble if they think this is what they SHOULD do...
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  9. #19
    Join Date
    Jul 2010
    Beans
    6

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    Ok, can anyone help me with this one. It is along the same lines as the above posts. I wish to use Windows XP NTLDR to boot Kubuntu 10.04. Here's my setup. 2 x 40 gig hard drives, first HD Windows XP, second HD Kubuntu. Reported by Linux as /dev/sda (Windows) and /dev/ sdb (Kubuntu). Kubuntu installed as follows: /dev/sdb1 (boot), /dev/sdb5 ( / ), /dev/sdb6 (swap).

    I wish to chainload Grub2 from NTLDR, however the methods I've tried don't work (dd if....... etc), I either end up with a flashing cursor, or a grub prompt.

    I have tested my Kubuntu installation by altering the BIOS settings to boot from the second hard disk, this works fine. How do I get a copy of the second HD's MBR into a file so that I can copy this to the Windows root directory and instruct boot.ini to load Kubuntu?

    I installed Grub in the MBR of /dev.sdb as it was suggested by the partitioner, however I am starting to think I shouldn't have done this, is there a way to get around it without having to reinstall from the Live CD again?

    I'm at my wits end as I've tried all sorts and so far have installed and reinstalled Kubuntu 5 times trying different locations for the Grub files. most of the time I break the Linux installation and have to reinstall from the Live CD, this takes ages!

    Any help?
    Last edited by Clydeuk; July 3rd, 2010 at 01:22 AM. Reason: additional information

  10. #20
    Join Date
    Jul 2010
    Beans
    6

    Re: Grub2 and Windows XP Bootloader (NTLDR)

    By the way, I installed Kubuntu on a Vista laptop and used EasyBCD to adjust Vista's BCD to boot Kubuntu, this worked great, and I'm loving Kubuntu!

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •