Announcement

Collapse
No announcement yet.

Solved: lost grub after xp reinstall

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

    Solved: lost grub after xp reinstall

    I know this question has been asked a million times (at least)
    But I have tried all the answers and none of them seem to work for me. I lost grub after xp reinstall (yet again). I followed the advice here http://kubuntuforums.net/forums/inde...opic=3081671.0

    and always got the the reply to:

    sudo grub
    grub> find /boot/grub/stage1
    Error 15: File not found

    So I thought it was a permissions problem so from a console on the live cd I tried:

    Code:

    sudo mkdir /mnt/root

    $
    Code:

    sudo mount -t ext3 /dev/sda2 /mnt/root

    $
    Code:

    sudo mount -t proc none /mnt/root/proc

    $
    Code:

    sudo mount -o bind /dev /mnt/root/dev



    $
    Code:

    sudo chroot /mnt/root /bin/bash


    #
    Code:

    sudo grub


    grub> find /boot/grub/stage1

    And got the dreaded:

    Error 15: File not found

    So I tried:

    grub> geometry (hd1,
    Possible partitions are:
    Partition num: 0, Filesystem type unknown, partition type 0x7
    Partition num: 1, Filesystem type unknown, partition type 0x93
    Partition num: 2, Filesystem type unknown, partition type 0x92

    Now I know that /boot/grub/stage1 is on
    /sda2/boot/grub
    which correponds to:

    Partition num: 1, (I think, as this is the only hdd I have with 3 partions on it, num:0, = xp, num:1 = /, and num:3 = swap)

    So why can't I find it with grub and reinstall it?



    #2
    Re: lost grub after xp reinstall

    You get an "A" for independent effforts to resolve your issue!

    It's not a permissions problem, at least not the initial failure to boot.
    There's something haywire with the designation of partitions. In the file /boot/grub/menu.lst on that second partition, which you'll have to access from the Live CD, you need to look at the line "groot=(hd0,x)" and then also look at the kernel boot line in the menu itself, toward the end of that file. It sounds like the correct partition would be (hd0,1), but the installer and Grub sometimes don't agree on this point, so you might want to do an experiment and try it as (hd0,0), just for fun.


    EDIT: As Qqmike and toad suggest, why don't you try, at the grub prompt, "geometry (hd0)" and see what it finds.

    Comment


      #3
      Re: lost grub after xp reinstall

      Hmmm...

      sda2 is “usually” (hd0,1). But you think you found it on (hd1,1)? Confusing, indeed.

      But, even more confusing ...
      What happened to stage1 GRUB files (and all the rest of the GRUB files)! Did it not get installed? Why can't GRUB find any stage1 files anywhere? Usually this would occur if the user told the installer to NOT install GRUB.

      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: lost grub after xp reinstall

        I just cruised across your post, but I noticed that you got hd1 instead of hd0 - it should read hd0,1 shouldn't it?
        Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

        Comment


          #5
          Re: lost grub after xp reinstall

          Thaks for replies. here is fdisk output

          sudo fdisk -lu

          Disk /dev/sda: 80.0 GB, 80025280000 bytes
          255 heads, 63 sectors/track, 9729 cylinders, total 156299375 sectors
          Units = sectors of 1 * 512 = 512 bytes
          Disk identifier: 0x76d876d8

          Device Boot Start End Blocks Id System
          /dev/sda1 63 103731704 51865821 7 HPFS/NTFS
          /dev/sda2 103731705 154223999 25246147+ 93 Amoeba
          /dev/sda3 154224000 156296384 1036192+ 92 Unknown

          Disk /dev/sdb: 250.0 GB, 250058268160 bytes
          255 heads, 63 sectors/track, 30401 cylinders, total 488395055 sectors
          Units = sectors of 1 * 512 = 512 bytes
          Disk identifier: 0x8e0a8ddc

          Device Boot Start End Blocks Id System
          /dev/sdb1 63 488392064 244196001 7 HPFS/NTFS

          Disk /dev/hda: 80.0 GB, 80026361856 bytes
          255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
          Units = sectors of 1 * 512 = 512 bytes
          Disk identifier: 0xd1416798

          Device Boot Start End Blocks Id System
          /dev/hda1 * 63 156296384 78148161 7 HPFS/NTFS


          /dev/hda is first pata hdd (80GB) with Vista on it (1 partition)
          /dev/sda is first sata hdd (80GB) with xp,and Kubuntu (3 partitions)
          /dev/sdb is 2nd pata hdd (250 GB) for storage (ie, rubbish) 1 partition

          Also, why does my / root partition (sda2) say file system is amoeba and
          not ext3? Is this anything to do with it

          At the moment only xp boots, if I want vista I change boot sequence in bios
          (pain in the you know where, but it works) but I really want Kubuntu back.

          Thankyou

          Comment


            #6
            Re: lost grub after xp reinstall

            toad -- I'm still concerned about where stage1 files are -- looks like there aren't any.

            @ phatsteve
            You could use a live CD to peek into Kubuntu and see if you have GRUB files under /boot/grub.

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

            Comment


              #7
              Re: lost grub after xp reinstall

              Ahhhhhhhhhhh -- the "rest of the story" ......

              OK, you need to understand that in the new world of the libata hard disk driver, all hard drives are "sd_". So, you have fallen victim to the prior rule that hd_ is one kind of drive, and sd_ is another kind of drive, and they were numbered independently. They're all sd today. So you have sda, sdb, and sdc, and that's it. That's why grub found (hd1) to be the candidate to have a bootable stage 1.

              The drive you thought was sda is really sdb, and sdb=(hd1).

              Maybe that's enough information to enable you to change the grub menu ....


              p.s. Listen to Qqmike -- he knows this grub stuff better than me.

              p.p.s -- If you use UUID to designate partitions, in both menu.lst and /etc/fstab, you can avoid problems with the /dev/sdx thing.



              Comment


                #8
                Re: lost grub after xp reinstall

                /boot/grub/stage1 is definately on
                /sda2/boot/grub

                Comment


                  #9
                  Re: lost grub after xp reinstall

                  phatsteve -- OK, so now use what dibl said about device naming (i.e., using the right (hdx,y)) in the GRUB work you were trying to do (re-install GRUB, etc., whatever).
                  It might take some messing & trial & error.
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    Re: lost grub after xp reinstall

                    The other thing that occurs to me is the famous "mixed IDE and SATA drives" problem.

                    The *buntu installer has a helluva time installing grub on the MBR of a SATA drive when a PATA (IDE) drive is connected. I vividly remember spending an entire day with Kubuntu Dapper Drake, attempting to force it to put the Grub menu on a SATA drive while Windows XP was installed on the PATA drive. Bottom line -- you can't do it, on this computer -- I have to disable the IDE drive whenever I need to install grub.

                    So, you might want to review the boot sequence in your BIOS, and make sure that it isn't hanging on that IDE drive and never looking at the SATA drive where you have the bootable OSs.

                    Comment


                      #11
                      Re: lost grub after xp reinstall

                      Qqmike before I start, do I take it that my first pata hdd is sda,
                      my 2nd hdd (ie 1st sata hdd) is sdb, and my 2nd sata hdd is sdc?
                      So where I was trying to find stage 1 on sda it is actually on sdb?

                      (and if I'm not confused now I never will be?)

                      Comment


                        #12
                        Re: lost grub after xp reinstall

                        dibl, I'm fairly confident that my 1st ide drive (80GB pata with vista on )
                        is ok regards mbr and booting because if I change boot sequence in bios, vista boot fine.

                        Comment


                          #13
                          Re: lost grub after xp reinstall

                          "(and if I'm not confused now I never will be?)"

                          Ha! I'm starting out here with two cups green tea to get going, but I think it might be time to switch into black coffee ...

                          Device naming. Sometimes tough. Sometimes it's best to guess at it until you hit the right one. So which is hd0, hd1, hd2 ,...? Best way I know of is to use the GRUB geometry command (it's in that how-to, somewhere toward the end, briefly).
                          You must first get the GRUB prompt, grub>:
                          sudo grub
                          grub>
                          then type
                          grub> geometry (hd0)
                          and see which one hd0 is;
                          then
                          grub> geometry (hd1)
                          and see if you can identify the drive;
                          etc.
                          Typing
                          grub> geometry (hd<Press the TAB key now>
                          (don't type the symbols < or >)
                          will list all your drives as BIOS & GRUB see them.

                          You can work from within Kubuntu or from a Live Kubuntu CD, open Konsole, and start with
                          sudo grub
                          etcetera.
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #14
                            Re: lost grub after xp reinstall

                            So, if you set it in BIOS to look at the SATA drive first, then it will boot XP?

                            Hmmm, so the problem might be that when you installed Kubuntu, the installer put grub in the MBR of that IDE drive, instead of on the SATA drive -- that's what it does to me if I have the IDE drive connected. But, when you set the IDE drive to be first in BIOS, then it boots Vista. Hmmmmmmmmm.

                            If I had your problem, I think I'd disconnect the IDE drive, then boot the Kubuntu Live CD and use that to re-install grub on the MBR of the SATA hard drive. Then (with the IDE drive still disconnected) you could boot the SATA drive and confirm that you have a boot menu and set it so it will boot XP or Kubuntu.

                            Then, after you reconnect the IDE drive, you may find you still have to change the (hd_) number one more time, but at least you'll know that you have a baseline bootable setup on the SATA drive, which I kinda doubt you have at the moment.

                            Comment


                              #15
                              Re: lost grub after xp reinstall

                              Go with dibl on this "mixture of IDE & SATA" stuff!
                              He's been there!
                              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