Announcement

Collapse
No announcement yet.

MBR GRUB messed up

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

    MBR GRUB messed up

    Used my Kubuntu PC to install Mint Linux to a USB hard drive from the Miny Live CD.

    Next time I tried to boot Kubuntu, nothing happened. It just hung with a message of a Grub 1.5 failure.

    So then I really messed up. I inserted a Mepis CD ( because Mepis has a Grub repair function) and tried to repair Grub on the MBR. OOPs, now all the grub entries are listed as Mepis, and when I try to boot any of them, it fails.

    How can I repair Grub to boot my Kubuntu or Windows XP partition? Is there a way with the Kubuntu CD?

    #2
    Re: MBR GRUB messed up

    You will find help and instructions in Qqmikes HOW TO: GRUB Methods - Toolkit
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: MBR GRUB messed up

      Tried that, but when I followed the instructions and got to grub> setup ( hd0), I get an
      error 17: Cannot mount selected partition

      Comment


        #4
        Re: MBR GRUB messed up

        Originally posted by eppoh
        grub> setup ( hd0), I get an
        error 17: Cannot mount selected partition
        If you put a space after the ( as shown above, that would explain that error. The command should be:
        Code:
        grub>setup (hd0)
        Note that here is no space in (hd0)
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: MBR GRUB messed up

          I had it correct in the shell. Typo here

          Comment


            #6
            Re: MBR GRUB messed up

            What partition did you have Kubuntu installed on?
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Re: MBR GRUB messed up

              okay found it on hd0,4
              managed to get grub re-installed but when it tries to boot ubuntu I get:

              Error 2 Bad file or directory type

              Comment


                #8
                Re: MBR GRUB messed up

                You can use the Kubuntu Live CD to fix this.
                Fire it up.
                Open K > System > Konsole
                Type
                sudo grub
                At the grub> prompts type these commands:
                grub> root (hdx,y)
                grub> setup (hdx)
                grub> quit

                # then re-boot to test it.

                where you must know x and y.
                hdx is your drive where you have Windows and Kubuntu. If you have only one drive, it is hd0 (x=0).
                y is the partition number of your Kubuntu on drive hdx, counting from zero. So, if Kubuntu is on the second partition, y=1; if it is on the 3rd partition, y=2; etc.

                Or, use Super Grub Disk Live CD to boot into your Kubuntu on the internal hard drive and then fix it at Konsole (same as above).

                If you need to fix that Mint menu.lst and the boot so that you can boot correctly into Mint, see my How-To about that:

                http://kubuntuforums.net/forums/inde...opic=3081748.0
                How to install K/Ubuntu 7.04 to an external USB hard disk drive (HDD), 8-14-07, Reply #1.

                If you have questions, post back here.

                When your PC boots by the external hard drive, BIOS sees it as hd0. So the menu.lst on your external hard drive must refer to the partitions there as (hd0,y). But when you installed Mint to the external, it was seen as hd1 (assuming you have only the one other internal hard drive). So all you gotta do is edit the Mint menu.lst using statements that look like:
                root (hd0,y)

                (If you put Mint on the first partition of the external, then it would be root (hd0,0).)

                It's all explained in the How-To.
                Post back here.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: MBR GRUB messed up

                  Well, something is wrong on (hd0,4), or you got the wrong partition.
                  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: MBR GRUB messed up

                    I think something is wrong on the partition. Is there some way to repair the Kubuntu installation? I really don't want to loose everything in a re-installation.

                    Comment


                      #11
                      Re: MBR GRUB messed up

                      Hard to say what's going on. You can try a couple things, hoping to get some insight into what's up:

                      > Use GParted Live CD to take a look at your drive and partitions. See if everything looks OK. Click on each partition and see if you get any weird messages or icons or ?

                      > Use Super Grub Disk Live CD and try to boot your operating systems. See what SGD sees. See if it is able to find and boot them without error. BTW, when you are in SGD, if you press the "c" key at certain menus, you can get a GRUB prompt, grub>, and use the geometry command to explore your drives:
                      grub> geometry (hd0)
                      will tell you what BIOS and GRUB see on that drive.
                      Then, I think, if you press ESC, you'll get back to a menu.

                      > You can run sudo fdisk -lu (from live CD or otherwise) to get another picture of the drives.

                      Are you sure the OS is on (h0,4)? That would be the first hard drive (listed in BIOS boot order), the *fifth* partition (since GRUB counts drives and partitions from zero). In Linux notation, it would be (hd0,4) = sda5 (or hda5).
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Re: MBR GRUB messed up

                        Okay, went back and looked at everything with Gparted Live. No disk errors that I could see.

                        On this disk I have Win XP, PClinux OS, and Kubuntu. When I edited the grub list all the linux entries point to hd0, 4 and when I try them, they boot PCLOS.

                        I am pretty sure Kubuntu is on hda3 ( which would be hd02) if I recall. Would that be right?

                        If so, I think I would need to manually make a grub entry to point it to hda3, to boot Ubuntu. How can I do that? I do not know the commands.

                        Comment


                          #13
                          Re: MBR GRUB messed up

                          Open K > System > Konsole
                          Type
                          sudo grub
                          At the grub> prompts type these commands:
                          grub> root (hd0,2)
                          grub> setup (hd0)
                          grub> quit

                          # then re-boot to test it.

                          That will make the GRUB that is in (hd0,2) be the one that controls the show when you boot up. The "main" boot menu will be the file /boot/grub/menu.lst in Kubuntu in (hd0,2). In that menu.lst, you can include boot entries to boot all the other OSs. Does PClinux OS use GRUB? If so, it will have its own /boot/grub/menu.lst, and from that you can copy the boot entry that will work to boot PClinux OS and paste it into the menu.lst in (hd0,2). A boot entry starts with title and has root and kernel and initrd (at a minimum). the file menu.lst must be edited as root and then save your changes by File>Save and File>Quit. In the menu.lst on (hd0,2), don't mess with anything that is between the *** Begin Automagic kernels list and the ** End Automagic kernels list. Put any new boot entires for other OS either before or after that section.
                          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: MBR GRUB messed up

                            note the space after root and the space after setup
                            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                            Comment


                              #15
                              Re: MBR GRUB messed up

                              Somehow the partition that had Kubuntu was messed up by the Mint Linux install to the usb drive.

                              I finally gave up and reinstalled Kubuntu over the old one.

                              Thanks for the help.

                              Now, it will be interesting to see what happens when I install the new PCLOS on the other partition. It uses GRUB also.
                              Fingers crossed

                              Comment

                              Working...
                              X