Announcement

Collapse
No announcement yet.

<SOLVED> GRUB problem after reinstall of WinXP in dual boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    <SOLVED> GRUB problem after reinstall of WinXP in dual boot

    I'm running WinXP on the internal HD of my desktop, with Kubuntu 9.04 installed on a USB HD. This had been working fine for me for months. Then I recently accidentally wiped out my WinXP partition. It's reinstalled, and now of course it's the only thing that will boot.

    So, I've followed carefully the instructions in the "Re-installed XP and now can't boot Kubuntu" section of the marvelous "HOW TO: GRUB Methods - Tookit' at http://kubuntuforums.net/forums/inde...opic=3081671.0

    Twice I've done this and twice I get an error 21 upon trying to boot from the result.

    I'm trying not to spend two days studying up on GRUB. Don't really have the time. But, I'm stuck.

    Reply #21 to the How To talks about Grub errors. "This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk."

    At the time I reload GRUB usng the procedure in GRUB Methods Toolkit, this is the output of the "sudo fdisk -lu" command (digested a bit):

    Desktop internal HD:
    * sda1 - NTFS (my WinXP partition)
    * sda2 - Linux (not really, but that's what it said - it's an empty ext3 partition)

    Flashdrive (holding the Kubuntu LiveDisk ISO): sdb

    External USB HD (where I have Kubuntu 9.04 installed) - plugged in
    * sdc1 - linux swap
    * sdc2 - extended
    ** sdc 5 - (holds the Kubuntu OS)
    ** sdc 6 - (/home)

    I'm looking for ideas about why the grub won't work, and guessing that I need to edit the /boot/grub/menu.lst, BUT I cannot find it. Where is it? All discussion I can find of grub file editing seems to assume that it's on a linux partition - But I cannot see it. It's on the desktop's internal HD, yes? but where? I've looked at both partitions with Dolphin set to show hidden files...no show. There's such file on my USB HD which has the Linux OS, but that's not where grub got reinstalled, yes?

    This is all very confusing to me.

    Can someone help me out?

    T.

    #2
    Re: GRUB problem after reinstall of WinXP in dual boot

    You're confused? Ha! So am I!

    It looks to me like you do NOT have any Kubuntu installed to any internal HD.
    That you use your Kubuntu's from external USB drives (flash and external) only.

    When you re-installed GRUB using the how-to, I assume you did so using the Kubuntu on your external HD (i.e., not the Kubuntu on your flash drive).
    So
    root (hdx,y)
    referred to the Kubuntu partition on your external hard drive.

    THUS, the relevant boot menu, /boot/grub/menu.lst will be located in the same (hdx,y) (in Kubuntu on the external HD).

    GRUB's Stage_1 got installed to the MBR of your first BIOS boot drive, which I'm assuming is your XP drive (i.e., BIOS is set to boot first from the XP drive). That stage_1 points at the /boot/grub/menu.lst on the external drive.

    => The relevant, controlling menu.lst is in the Kubuntu partition of the external HD. That's the one you edit (i.e., you edit the (hdw,z)'s until they are all correct).


    Now, you didn't ask, but before I'm pulled away here this morning ...

    Your device names (hdx,y)'s will depend on what drives are plugged into your PC when you re-install GRUB. For example, as you have it now, with all 3 drives plugged in, you have hd0 (I assume is the XP drive from which the PC boots), hd1 and hd2 (where hd1 and hd2 will be the flash drive and the external drive, I assume hd1 may be the flash drive and hd2 may then be the external drive). BUT, you must get these straight! And if you ever boot the PC without all 3 drives plugged in, you MAY get an error upon booting (since the hdx's will have changed at boot time, UNLESS, by pure chance, you are lucky).

    The way you know what drives are what hdx's is by booting the PC and getting a grub> and using the geometry command (as explained in the how-to). -- Just an fyi.



    I'm guessing, as is:
    hd0 = XP drive
    hd1 = flash drive
    hd2 = external drive

    BUT only geometry command can know for sure.

    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: GRUB problem after reinstall of WinXP in dual boot

      . . . and so, for example (I'm guessing at the current setup, but assuming all 3 drives plugged in),

      say from a live CD, re-install GRUB:

      Konsole
      sudo grub
      grub>root (hd2,4)
      grub>setup (hd0)
      grub>quit

      where:
      (hd2,4) is your Kubuntu installation on the external HD (with all 3 drives plugged in), (hd2,4) = sdc5).
      (hd0) is the MBR of the XP drive which the BIOS is set to boot from.

      Then from live CD, edit (as root) menu.lst on the external HD Kubuntu at /boot/grub/menu.lst
      so it refers to the proper device names:
      XP on (hd0,0)
      Kubuntu on (hd2,4)

      and re-boot to test it.


      Now, if the BIOS is set to boot from the Kubuntu external drive, everything changes.
      That external dive becomes hd0; Kubuntu on (hd0,4).
      Windows would be on (hdx,0) where x = 1 or 2 (probably x=1; but geometry, from the live CD, or better yet from Kubuntu--using SGD to boot into it, tells the story which one).
      Then, also, XP is on a non-first HD and so you must use the map commands in the menu.lst entry for XP (located in the Kubuntu partition on the external HD). (map commands explained in the how-to also).

      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        Re: GRUB problem after reinstall of WinXP in dual boot

        Qqmike -

        Thanks for your lucid, helpful response. I woke up this morning with two thoughts: (a) the /boot/grub/menu.lst file I needed to edit HAD to be on the Kubuntu partition on my USB HD (where else?), and (b) all those devices I had plugged in were messing my device mapping, which led to the bad menu.lst file I was creating.

        Solution: pull all the flashdrives (at one point I had 2 plus my USB HD plugged in, with the Kubuntu Live Disk ISO on one of the flashdrives), leave the USB HD plugged, and restore the grub from a CD ISO. I shouldn't need to edit the menu.lst file. Of course, it worked just fine. Booted up correctly immediately after I restored the grub.

        What you wrote told me my insecure reframing of the problem was correct (amazing!), so getting back to normal was quick, once I found the time.

        Again, thanks for just being there, and being master of your subject. People like you are what make the Linux community the special place it is!

        Tom

        Comment


          #5
          Re: &lt;SOLVED&gt; GRUB problem after reinstall of WinXP in dual boot

          Tom, good job, glad you got it. I think your explanation was far more lucid than mine. Short and sweet. Or, one could refer to it as the effect of "drive-shifting," especially in the presence of USB drives (flash & external). Again, nice work, Tom. Thanks for your feedback. --Mike
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment

          Working...
          X