Page 26 of 26 FirstFirst ... 16242526
Results 251 to 253 of 253

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

  1. #251
    Join Date
    Oct 2008
    Location
    British Columbia, Canada
    Beans
    51
    Distro
    Kubuntu 16.04 Xenial Xerus

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

    Thanks, pritam_par, for your excellent instructions!

    Your method worked well when I tried it, except for a small change
    needed in step 9:

    You posted,
    9. Verify the install
    Code:
    sudo grub-install
    It worked for me when I left out 'sudo'

    Code:
     grub-install
    Thanks again!

    Trent T

    Quote Originally Posted by pritam_par View Post
    Here are the few steps in which you can install Grub from CD

    1.Boot from the Ubuntu Desktop

    2. In Terminal tpye sudo fdisk -l .
    It will display all partiton of the disk.
    3. Mount the ubuntu partition drive
    sudo mount /dev/sdXX /mnt

    4.Only if you have a separate boot partition:
    sudo mount /dev/sdYY /mnt/boot.
    5. Mount the virtual filesystems:

    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys

    6.
    To ensure that only the grub utilities from the LiveCD get executed, mount /usr
    sudo mount --bind /usr/ /mnt/usr
    sudo chroot /mnt

    7.
    update-grub
    or update-grub2
    8.Now reinstall Grub
    grub-install /dev/sdX (eg. grub-install /dev/sdaDo not specify the partition number.
    9. Verify the install
    sudo grub-install --recheck /dev/sdX
    10. Exit chroot : CTRL-D on keyboard.
    11. Unmount virtual filesystems:
    sudo umount /mnt/dev
    sudo umount /mnt/proc
    sudo umount /mnt/sys

    12. Unmount the LiveCD's /usr directory:
    sudo umount /mnt/usr

    13. Unmount last device:

    sudo umount /mnt

    14. Reboot.
    sudo reboot.

  2. #252
    Join Date
    Apr 2011
    Beans
    9

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

    Hi everyone I've got a very bad situation.
    I have a Dell inspiron 15r.
    It had dual boot windows7 and Ubuntu.
    I wanted to make a fresh install of both windows and Ubuntu.
    When i booted win 7 DVD i accidentally deleted the Ubuntu swap partition.
    Now the laptop doesn't turns on.
    it's stuck at the boot screen.
    I even removed the hard disk and tried to connect it to my desktop using sata to USB converter but it's not being detected it's spinning even showing an icon as if there is a USB device connected but no partitions showing.
    I live booted Ubuntu without the hare disk plugged in and it works fine but obviously since no hard disk is connected there is no place to install.
    Even when it's live booted up when i connected the hard disk nothing shows up.
    Please help....

    See the progress at the page below.
    i apologize for repeating my problem but I'm helpless..

    ubuntuforums.org/showthread.php?t=1916953
    Last edited by divyanshu308; January 31st, 2012 at 02:14 AM.

  3. #253
    Join Date
    Mar 2007
    Beans
    30

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

    Quote Originally Posted by wernst View Post
    Don't forget that this method, as described, puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root parititon. This is fine for most people, but not if you already have an alternative boot manager.

    In other words, if you use something like Boot Magic or System Commander, the commands you've just read will overwrite what you've got.

    If you've installed GRUB into the Root Partition instead of the MBR, the commands are a little different. Here's are the instructions that I have for my system:

    How to Restore the Grub Menu after a Re-Ghosting:

    1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

    2. Open a Terminal. Go SuperUser (that is, type "su"). Enter root passwords as necessary.

    3. Type "grub" which makes a GRUB prompt appear.

    4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.

    5. Type "root (hd0,3)".

    6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".

    7. Type "quit".

    8. Restart the system. Remove the bootable CD.

    Hope this helps. Since I use Norton Ghost to make regular backups and restores (I do a lot of testing), I do this all the time...

    -Warr
    Hey man, I did these steps but error 2 keeps getting displayed. I installed puppy linux, lucid pup, and it does install a bootable grub. The mint installer is the one that cannot do this. Any ideas?

    Just a FYI, lucid puppy does install well and boots off ok, so I guess this is a problem with the mint installer.
    Last edited by sheds; March 27th, 2012 at 05:55 AM.
    Building for a shallow grave
    -- Jim Morrison

Page 26 of 26 FirstFirst ... 16242526

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
  •