Announcement

Collapse
No announcement yet.

Need help creating a MBR

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

    Need help creating a MBR

    Ok so not sure really what happened other than my home server is just plain getting old and things are starting to fail. So on Thursday night I noticed that my file system had gone read-only. I rebooted and the system crashed.

    Turns out that one of my smaller drives has failed. Problem is that this was the drive that contained the MBR for the system. I can not leave the drive in because the system will not do anything with it in the case. Removing it and I can get to the Kubuntu splash screen, but then eventually acts like it is going to start the graphical end, but it just hangs and I have a black screen.

    I have used the LiveCD to verify that all of my root partition is intact and so are all of my other drives and partitions.

    So how can I create a MBR on one of the new drives and make Grub see it? I have been working on this for two days now trying to use Knoppix LiveCD, SuperGrubDisk and the Kubuntu LiveCD to no avail and well I am starting to get a little past frustrated.

    Any help is appreciated as I really don't want to re-install everything on this machine as it has all of my websites, MySQL databases, and my email hosting on it. I have a new server on the way that I am going to move to once it arrives, but I need this one to be up and running soon as the new server won't be here for a couple of weeks.

    Thanks,

    -Eric

    #2
    Re: Need help creating a MBR

    If you use GParted Live CD to partition that new drive, it will also create a MBR for it (in the first 512 bytes). It will then start your first partition at sector 63 (which is what you want -- fairly standard).

    After using GParted ---->
    you can install GRUB to any MBR using GRUB files in any Linux partition by "re-installing GRUB."

    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0
    SECTION 3: Re-installing GRUB: the cure for many problems.



    You won't need it, but just a mention of this:
    In Debian, there is a popular little program that creates MBR, I think called mbr (google it). I've used it for some esoteric application; it works fine.
    But I recommend you stick with GParted Live CD for what you need here.
    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: Need help creating a MBR

      GParted (Live CD, USB, HD)
      http://gparted.sourceforge.net/livecd.php
      New Manual. New man page. See Documentation:
      http://gparted.sourceforge.net/documentation.php
      News:
      http://gparted.sourceforge.net/news.php?alles=alles
      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: Need help creating a MBR

        Thanks for the speedy replies. A couple of quick questions prior to heading off.

        1. Can I use GParted LiveCD to do this WITHOUT killing all of my data on the drives safely?
        2. Am I correct then that I can not use the Kubuntu 8.04 LiveCD to do any of this then?

        Thanks,

        -Eric

        Comment


          #5
          Re: Need help creating a MBR

          Whoa!!! No.

          If the drive already has data on it, NO, do not try to use GParted to create a new partition table. Use GParted and mbr only on drives you will partition fresh, with no existing data on them.

          Hmmm.....

          Seems you should already have a MBR/partition table on a used drive.

          > If it (the MBR) good, but GRUB got messed up, use the link above to re-install GRUB.

          > If the MBR got goofed up, try TestDisk to restore the MBR:
          -- RESCUE Partitions & Data (More on PhotoRec: Reply #5; sidux Live UFD: Reply #6)
          TestDisk--PhotoRec--Knoppix
          http://kubuntuforums.net/forums/inde...opic=3091847.0
          I have used TestDisk to restore a partition table that I totally destroyed by writing zeros to it (as a test).
          Go to TestDisk site and read their very well-written how-to.


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

          Comment


            #6
            Re: Need help creating a MBR

            "So how can I create a MBR on one of the new drives and make Grub see it?"

            You said "new" drive, right? If so, no problem. Use GParted.

            If it is an existing drive, already partitioned, and has Kubuntu on it, it probably already has a good MBR on it. So, all you need to do is "re-install GRUB" (using that link above):
            re-install GRUB from the Kubuntu partition to the MBR of that drive.
            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: Need help creating a MBR

              Hey sorry for the confusion I see why you thought I said "new" drive. Yea the drives (3) are already partitioned off and have data on them. The drive that contained Grub failed I guess, but why wouldn't grub be installed on the same drive as my root partition? I see /boot/grub on the drive that holds my root partition, but for whatever reason the stupid machine just hangs and won't actually boot. It currently loads Grub and then I get the Kubuntu "splash" screen with the little blue bar racing back and forth. That goes on for a few seconds and then the screen switches to a blank black screen with a blinking cursor at the top left corner.

              So I guess maybe at this point, maybe it isn't a grub or MBR issue. Could it be that since I removed the dead drive that the mapping of the drives is screwed up? I think before that my root partition was located on (hd2, 0) but now after all the screwing I have done it might be on (hd0, 0). I know when I boot the LiveCD and attempt to mount the root partition I have to issue the command using /dev/sda1.

              Again thanks for all the help folks.

              -Eric

              Comment


                #8
                Re: Need help creating a MBR

                You can find out the mapping of the drives using the Live CD:

                In a live CD session,
                open Konsole
                type
                sudo grub
                grub>geometry (hd<press the TAB key now>
                (do not type the <,> symbols)
                and you can investigate each drive:
                grub> geometry (hd0)
                grub> geometry (hd1)
                grub> geometry (hd2)
                etc.


                Even if GRUB is installed to the root Kubuntu partition, you must still use those files to install GRUB (Stage 1) to the MBR, using that link.
                As follows:
                From Live CD:
                sudo grub
                grub>find /boot/grub/stage1
                That will return the drive(s) where GRUB files are found, like (hdx,y). Use that (or one of those (hdx,y)'s)) here:
                grub>root (hdx,y)
                grub> setup (hd0)
                grub> quit

                where (hd0) is the first BIOS boot drive (the first drive set to boot in BIOS).

                That will re-install GRUB to the MBR of the first BIOS boot drive using the GRUB files in (hdx,y).
                Of course, you will have to edit your BIOS setup so it boots from the correct drive (that you have in mind as the "new" boot drive). >>> The drive that BIOS boots from is always seen as (hd0) (by BIOS and by GRUB).


                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: Need help creating a MBR

                  Ok so I followed the instructions on how to re-install Grub and got that installed to the correct area. It seems that Grub is firing up just fine as I get the Grub Loading Stage 1.5 message and then I get the Starting up....
                  Loading.... messages followed by the Kubuntu splash screen.

                  This lasts for a few seconds as normal but then the screen goes to the black screen again with the blinking cursor in the upper left corner and just stops.

                  Everything that I can tell at this point tells me that the integrity of the drives are all fine and that the /dev/sda drive is being picked up as hd0 and that holds the root partition and the /boot/grub installation.

                  I have also tried running the TestDisk and writing a new MBR to the /dev/sda partition and still nothing.

                  Anyone have any other suggestions at this point?

                  -Eric

                  Comment


                    #10
                    Re: Need help creating a MBR

                    Where is your /home?

                    It looks like the boot process can not find it.

                    have a look at /etc/fstab and post it here so we can have a look as well.

                    You can use a live cd to do that.

                    also from the live cd open a terminal and do:
                    Code:
                    blkid
                    This will give you a list of all your uuid's.
                    Now compare the real state of your machine with what your fstab says.

                    Maybe your uuid's got screwed up and you will have to reassign /home to its real uuid in fstab.

                    Hope this helps
                    HP Pavilion dv6 core i7 (Main)
                    4 GB Ram
                    Kubuntu 18.10

                    Comment


                      #11
                      Re: Need help creating a MBR

                      Originally posted by EABonney

                      Starting up....
                      Loading.... messages followed by the Kubuntu splash screen.

                      This lasts for a few seconds as normal but then the screen goes to the black screen again with the blinking cursor in the upper left corner and just stops.
                      Actually (and assuming no subsequent changes to Grub or the MBR) this indicates a working installation of Kubuntu, but a video driver issue. Do it again, and when it stops with the blinky cursor, press Ctrl-Alt-F1. You should see the tty console login -- just login there.

                      We need to know about the graphics card, to advise you how to proceed. Without knowing it, you could try a
                      Code:
                      sudo dpkg-reconfigure -phigh xserver-xorg
                      -- that sometimes gets you a functional display.

                      Comment


                        #12
                        Re: Need help creating a MBR

                        @ EABonney -- Yes, your GRUB sounds like it's fine now. Since you had removed the controlling MBR (for GRUB), I felt it was necessary to first make certain GRUB was correctly re-installed to the right drive/MBR, and it sounds as if you've done that right.
                        Now, as dibl says, it's video (and may have been video before also, BUT you had not yet set up a new GRUB for booting, so we first did that). I think Fintan is concerned that a lot of your KDE settings are in your home, and maybe those aren't being located, too. So follow what these guys say to continue this ....
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          Re: Need help creating a MBR

                          Hi All just a quick update.

                          I was able to finally get a "working" boot early this morning. I had to use the Rescue kernel and only goto the command line. If I tried to go into the graphical desktop it looks like it starts, then blinks and drops me back out to the KDM login screen.

                          So I just left it running for now at the command line. Some of the issues where that the drive that died, contained the /tmp partition. The resulting tmp directory that was "created" was read only so I fixed the permissions on this directory and most things seem to be working. I am going to attempt a normal boot here later this evening and see how things go.

                          If all else fails, I will just leave it in the rescue mode so I don't lose my email/web server and just let it ride until the new server arrives. Then I can reinstall the old server from scratch once the new one is up and running.

                          I do think something might have happened to video but I am not so sure how or why. If it doesn't boot correctly I may try and investigate that more.

                          Thanks again to everyone for all the help and getting me at least to a "bootable" state.

                          -Eric

                          Comment

                          Working...
                          X