Page 4 of 26 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 253

Thread: HOWTO: Restore GRUB (if your MBR is messed up)

  1. #31
    Join Date
    Oct 2005
    Beans
    18

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by ghostintheshell
    Aaargh!! Thank you guys!! Very very very much!! You saved my virtual life!

    I lost my Grub / MBR and YOU restored it!

    After searching too much time on the web, I fell on this topic. I read it completely and applied a mix of your solutions.

    Here's the steps I followed to restore GRUB / my initial MBR:

    1. Boot with any live CD (I've done it with Ubuntu Live DVD)
    2. Get a root shell -> Applications / System Tools / Root Terminal
    3. Make a folder -> mkdir /mnt/ubuntu
    4. Check the Ubuntu partition -> fdisk -l (Mine is /dev/hda4)
    5. Mount the root partition of Ubuntu -> mount -t ext3 /dev/hda4 /mnt/ubuntu (replace /dev/hda4 by your Ubuntu partition determined at the step 4)
    6. Chroot the mounted partition -> chroot /mnt/ubuntu
    7. Restore Grub / the initial MBR -> grub-install /dev/hda
    8. Exit the shell
    9. Reboot

    That did the trick for me.

    Thank you very much again to all of you! ( :bigsmack: )
    Hi All,

    I ran out of space on my original HD and am trying to get a cloned version on a larger drive running but am hitting a large brick wall. The closest I seem to have come so far is to boot with the live CD and try the suggestion above. The problem that I'm running into however is that it won't seem to let me mount the partition. Using fdisk -l to get the partition info to mount I see /dev/hda5 as Linux LVM with an id of 8e. When I try and mount /dev/hda5 I get: /dev/hda5 already mounted or /mnt/ubuntu busy

    Any suggestions would be greatly appreciated...

  2. #32
    Join Date
    Nov 2005
    Beans
    8

    Unhappy Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by vnbuddy2002
    Restore GRUB quite simple in Ubuntu, instead going through all the "gain root access" and play with shell commands, you can use the Ubuntu installation CD to restore it without going through all kinds of hassles.

    Here are the steps:

    1. Boot your computer up with Ubunto CD
    2. Go through all the process until you reech "[!!!] Disk Partition"
    3. Select Manual Partition
    4. Mount your appropriate linux partions

    /
    /boot
    swap
    .....

    5. DO NOT FORMAT THEM.
    6. Finish the manual partition
    7. Say "Yes" when it asks you to save the changes
    8. It will give you errors saying that "the system couldn't install ....." after that
    9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
    10. Jump to "Install Grub ...."
    11. Once it is finished, just restart your computer

    Good luck!.

    hello there!
    at first time my GRUB works fine...but when i get back to Windows XP and use partitionmagic to do some partioning on some unused space (not the linux drive or swap), then my GRUB failed to work...=( at start i get an ERROR 22.

    @vnbuddy2002: i think i'll better follow your instructions as the only LIVE cd i've got is the one that comes with OpenCD. also, i'm not yet really familiar with commandlines thingy in Linux.

    just like to ask what do you mean by number 4 in your instructions above?
    do you mean the error in number 8 is like 'cannot install because no root directory is found'?

    thanks for any help. cheers!

  3. #33
    Join Date
    Nov 2005
    Beans
    7

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by rodent43
    ok thought i would update this but i am still having problems if anyone would care to help me out

    i also have 2 IDE drives on a PCI ide card in removable drive bays...if i take those out and install ubunut, grub works fine but once i put those back on grub reports

    error 17

    any help?
    Sounds like the same problem I'm having. Unfortunately, I can't unplug the drives on the PCI IDE controller (Promise FastTrack66) because one of them contains my Ubuntu installation.

  4. #34

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    i dont want to uplug either as they contain my files and games etc...

    i am kinda stuck now and either going to try another flavour of linux or just stay on windows :'(

  5. #35
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    When I install ubuntu I do the default of putting grub in the MBR. Once that is up and running I make sure that my floppy drive is listed in /grub/boot/device.map as
    (fd0) /dev/fd0
    and if it's not there I add it exactly as shown. (If you don't do this the next bit will fail).

    I then do a
    sudo grub-install fd0
    which gives me a floppy grub boot disk from which I can start up if the mbr gets messed up in some way. Once you've started up you can put grub back on the mbr by doing a
    sudo grub-install /dev/hda

    OK, I realise this is only any use for people with a floppy disk drive and it can get messed up if you update your linux version and that doesn't update grub for some reason, but so far, touch wood, it's always worked for me, and as long as you know what the linux version update was you should be able to edit the grub menu by highlighting the specific entry in the menu and hitting e, and then changing the numbers on the particular linux entry.

    Hope this helps and that I have got things right. Perhaps if my understanding of things is a bit flaky, someone can let me know.

  6. #36
    Join Date
    Nov 2005
    Beans
    19

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Ok, I know I'm new at Linux - I've tried several of the different suggestions posted and still no luck dual booting. From the install CD the only thing I can manage is a complete install - nothing with just install GRUB. No luck with the various command line options from the live CD either - although I admit there is bound to be some user error there. Any other suggestions to my specific circumstances will be appreciated. Kubuntu is up and running no problem just can't get back to WinXP.

    IDE1 Slave (hdb) (old salvaged HD currently NTFS but plan to reformat for FAT32 once I get dual boot working for file sharing)

    SATA (0,0,0)(sda)
    #1 Primary NTFS (my WinXP files)
    #2 Primary NTFS (kind of an accidental partition but empty at the moment)
    #3 Primary ext3 (Kubuntu)
    #5 logical SWAP

    I've tried the default setting for GRUB at least 3 times during install with no luck, last try was to /dev/sda3 also nothing at boot I get no options and LILO comes up and Kubuntu starts no problem.

    Have not tried correcting problem via WinXP re-install for fear of ruining my files (I did back up the key stuff prior to partition) and having a system that is totally dead.

    Any help will be greatly appreciated.

  7. #37
    Join Date
    Nov 2005
    Beans
    19

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Here are the contents of my menu.lst if that will help:

    # menu.lst - See: grub(8), info grub, update-grub(8)
    # grub-install(8), grub-floppy(8),
    # grub-md5-crypt, /usr/share/doc/grub
    # and /usr/share/doc/grub-doc/.

    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    default 0

    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout 10

    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu

    # Pretty colours
    #color cyan/blue white/blue

    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line) and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    # password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret

    #
    # examples
    #
    # title Windows 95/98/NT/2000
    # root (hd0,0)
    # makeactive
    # chainloader +1
    #
    # title Linux
    # root (hd0,1)
    # kernel /vmlinuz root=/dev/hda2 ro
    #

    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below

    ## DO NOT UNCOMMENT THEM, Just edit them to your needs

    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specifiv kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    # kopt=root=/dev/sda3 ro

    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd1,2)

    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ## alternative=false
    # alternative=true

    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ## lockalternative=false
    # lockalternative=false

    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ## altoptions=(recovery mode) single
    # altoptions=(recovery mode) single

    ## nonaltoption boot targets option
    ## This option controls options to pass to only the
    ## primary kernel menu item.
    ## You can have ONLY one nonaltoptions line
    # nonaltoptions=quiet splash

    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ## howmany=7
    # howmany=all

    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ## memtest86=false
    # memtest86=true

    ## ## End Default Options ##

    title Ubuntu, kernel 2.6.12-9-386
    root (hd1,2)
    kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/sda3 ro quiet splash
    initrd /boot/initrd.img-2.6.12-9-386
    savedefault
    boot

    title Ubuntu, kernel 2.6.12-9-386 (recovery mode)
    root (hd1,2)
    kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/sda3 ro single
    initrd /boot/initrd.img-2.6.12-9-386
    boot

    title Ubuntu, memtest86+
    root (hd1,2)
    kernel /boot/memtest86+.bin
    boot

    ### END DEBIAN AUTOMAGIC KERNELS LIST

    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title Other operating systems:
    root


    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title Microsoft Windows XP Home Edition
    root (hd1,0)
    savedefault
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader +1

  8. #38
    Join Date
    May 2005
    Location
    Karditsa , Greece
    Beans
    107
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by remmelt
    I may be missing your point though, if so, please forgive me
    This way the user must know the correct hd(0,6) .
    So I believe that this way is actually more complex
    salagata

  9. #39
    Join Date
    Nov 2005
    Beans
    19

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Ok, sort of figured out my problem. The offender was a 2nd PATA drive I had salvaged from an old computer and installed in my machine. When I removed that and did a clean install of Kubuntu on the partition I had made previous on my SATA drive - the defaults for GRUB worked fine. I can now get back into Windows (who ever thought I would be so happy to the see the Windows welcome screen...) and can also boot to Kubuntu.

    Going to try and few other things and see if I can't get that old PATA working and remort it for FAT32 - should be able to use it to share files between Win/Linux right?

    Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?

  10. #40
    Join Date
    Jul 2005
    Beans
    70

    Re: HOWTO: Restore GRUB (if your MBR is messed up)

    Quote Originally Posted by jars_u
    [...]

    Now for the easy question - how do I extend the default time that GRUB gives you to make a selection?
    Code:
    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp
    sudo gedit /boot/grub/menu.lst
    and modify here:

    Code:
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout        1
    timeout X ==> X sec.
    -- sorry for my crappy english

Page 4 of 26 FirstFirst ... 2345614 ... LastLast

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
  •