How To-Reinstall GRUB No Command line

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
pokemoncatdog
Level 2
Level 2
Posts: 53
Joined: Tue Dec 29, 2009 6:17 pm

How To-Reinstall GRUB No Command line

Post by pokemoncatdog »

Did you install windows after Linux wanting to dual boot and now you find you can't boot in to Linux because windows install over wrote the mbr (aka were grub is installed).

Most tutorials will have you boot the live CD and go to the Command line. There a faster and easier way.

SKIP TO STEP 3 if you have a super grub disk all ready.
1. Download super grub disk (CDROM) frorm http://www.supergrubdisk.org/index.php
You can make a usb or floppy super grub disk also if you want to: http://www.supergrubdisk.org/wiki/SGD_H ... Disk_Cdrom.

2. use imgburn or what you like to burn the iso to CD.

3. restart pc and boot to cd-rom. If windows boot read here: http://www.hiren.info/pages/bios-boot-cdrom

4. If the cd boots up you will see a grub menu.

5a. If your Linux is Ubuntu or Linux Mint, just pick "Boot Ubuntu Gun/Linux"

5b. If your Linux is not Ubuntu or Linux Mint pick "Detect any OS" Wait up to 10 sec. Now pick your Linux OS. (ESC to go back to first menu)

6. When you get booted in to your Linux load up "Synaptic Package Manager"

7. Quick search for "GRUB"

8. Find the Grub version you have installed. (look for the green box.) It will be "grub" or "grub2" or "grub-pc". For me the "grub-pc" is the one with the green box.

9. Right click on you installed Grub version (the green box) and pick "Mark for reinstallation"

10. Click "Apply" on tool bar. Summary box will open just Apply.

11. take out CD, and restart pc.

DONE.
Last edited by pokemoncatdog on Thu May 13, 2010 12:51 pm, edited 2 times in total.

User avatar
Kaye
Level 5
Level 5
Posts: 933
Joined: Fri Feb 06, 2009 5:05 pm
Location: Boston College
Contact:

Re: Reinstall GRUB No Command line

Post by Kaye »

Sorry.. downloading and burning an entire new CD? Maybe if the user lost their live CD, this method is somewhat feasible. If a user has their original live CD, there is simply no comparison between this method and the CLI method:
FedoraRefugee wrote:Boot the live CD. When the LIVE CD loads open a terminal. If you do not know your partition layout you can type:

Code: Select all

sudo fdisk -l
Mount your Mint partition in the mount directory:

Code: Select all

sudo mount /dev/sd?? /mnt
Replace the question marks with the partition letter and number, ie: sda2.

Now install Grub in the MBR of the first drive:

Code: Select all

sudo grub-install --root-directory=/mnt/ /dev/sda
then run

Code: Select all

sudo update-grub
"In somnis veritas"
Antivirus or defragging?
Image

User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstall GRUB No Command line

Post by Fred »

The so-called easy GUI method above only works for one specific configuration. If you need to install Grub to the partition you are stuck with a miss configured Grub.

So all that effort for nothing. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.

pokemoncatdog
Level 2
Level 2
Posts: 53
Joined: Tue Dec 29, 2009 6:17 pm

Re: Reinstall GRUB No Command line

Post by pokemoncatdog »

Fred wrote:The so-called easy GUI method above only works for one specific configuration. If you need to install Grub to the partition you are stuck with a miss configured Grub.

So all that effort for nothing. :-)

Fred
Why would you install grub to a partition?, because then you have to set-up a chain load to load grub. I don't know why users chain load boot loaders when you can boot right into grub or other boot loader of your choosing.

OR idea

Why not have an grub installer on the live cd that would only (re)install grub. I mean how does the Ubuntu/ Linux Mint installer install grub? I thinking of an installer that only excuses the grub install part of the Linux Mint full install.

1. load live cd
2. click icon on decktop (re)install GRUB
3. one page form for user to input user chosen defaults
4. click (re)install Grub
5. Restart pc, tack out cd

User avatar
Kaye
Level 5
Level 5
Posts: 933
Joined: Fri Feb 06, 2009 5:05 pm
Location: Boston College
Contact:

Re: How To-Reinstall GRUB No Command line

Post by Kaye »

That's actually not a bad idea at all. Perhaps the dev team will look into it if they take notice here.
"In somnis veritas"
Antivirus or defragging?
Image

Biker
Level 5
Level 5
Posts: 512
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: Reinstall GRUB No Command line

Post by Biker »

pokemoncatdog wrote: Why would you install grub to a partition?, because then you have to set-up a chain load to load grub. I don't know why users chain load boot loaders when you can boot right into grub or other boot loader of your choosing.
Because some installations aren't read properly with GRUB, and it's easier to chain load those instead of pulling your hair out and trying to fix a borked MBR. I know a lot of folks who still use LILO on a floppy to manage their boot routines.
Linux User #384279

User avatar
DrHu
Level 17
Level 17
Posts: 7525
Joined: Wed Jun 17, 2009 8:20 pm

Re: How To-Reinstall GRUB No Command line

Post by DrHu »

pokemoncatdog wrote:Why not have an grub installer on the live cd that would only (re)install grub..
For grub2 this is no problem, in a terminal the command is
  • sudo update-grub
Does absolutely everything have to happen within a GUI to be a viable solution ?
pokemoncatdog wrote:Why would you install grub to a partition?, because then you have to set-up a chain load to load grub. I don't know why users chain load boot loaders when you can boot right into grub or other boot loader of your choosing.
..I don't know why users chain load boot loaders...
Just for this reason
  • Installing onto a partition instead of the MBR avoids messing with the MBR
  • Chainload can boot that other OS partition easily
If you don't do it that way, then you need to reGRUB your MBR or have another boot loader handle the new additions/menus ?
  • Bootman
    Easybcd
    Even NTLDR from windows OS
    -- although that is just as technical to setup as grub2, perhaps even more so, since it uses arc paths for devices, that many people won't understand..
    --and so on
http://en.wikipedia.org/wiki/Comparison_of_boot_loaders

User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: How To-Reinstall GRUB No Command line

Post by Fred »

pokemoncatdog wrote:
Why would you install grub to a partition?, because then you have to set-up a chain load to load grub. I don't know why users chain load boot loaders when you can boot right into grub or other boot loader of your choosing.
Honest question. I will give you an example from my own play/test system. I may have 2 to 6 distros installed at any one time. They constantly change as I see something that strikes my fancy. I have a dedicated grub partition. Actually it is from Mint 4 KDE. The grub kernel is in the MBR and points to the menu.list in my dedicated grub/boot partition. I then chainload all the distros from there. This requires each individual distro to have it's grub in the partition rather than an MBR. The advantage is that if I break an install or choose to delete it, it doesn't affect my ability to boot any of the other distros. All the distros are completely isolated from one another. Actually it is a very simple and serviceable setup.

So there are good reasons for chainloading. It is just another tool that is available to the Linux user if needed. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.

pokemoncatdog
Level 2
Level 2
Posts: 53
Joined: Tue Dec 29, 2009 6:17 pm

Re: How To-Reinstall GRUB No Command line

Post by pokemoncatdog »

DrHu wrote: Does absolutely everything have to happen within a GUI to be a viable solution ?
No, but I know some users that will not mass with the command line. I know that some times the command line can be easer. Like you said "sudo update-grub" then enter. That very easy, but some don't see it like that.

Edit: I just test "sudo upate-grub" on the live and it will not reinstall grub to the MBR. I get "grub-probe: error: cannot find a devices for /."
I know it can be easy to reinstall grub form command line, but this "how to" is about the fact that some users just don't want to use the command line.

vincent
Level 8
Level 8
Posts: 2217
Joined: Tue Feb 09, 2010 4:10 am

Re: How To-Reinstall GRUB No Command line

Post by vincent »

Actually, "sudo update-grub" doesn't re-install Grub anyways. It just runs a series of scripts located in /etc/grub.d/ to probe other OS'es and create menu entries and the like.
Debian Testing x64/LM9 Main x64/Windows 7 x64 - LG R580 laptop w/ Intel Core 2 Duo T6500 2.1 GHz, 4 GB DDR2 RAM, Nvidia Geforce G 105M, Ralink rt2860 802.11n, 300 GB WD HD 5400 rpm

Biker
Level 5
Level 5
Posts: 512
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: How To-Reinstall GRUB No Command line

Post by Biker »

pokemoncatdog wrote: I know it can be easy to reinstall grub form command line, but this "how to" is about the fact that some users just don't want to use the command line.
If a user is that adverse to using the CLI, then Linux is not the OS for them.
Linux User #384279

User avatar
Pierre
Level 19
Level 19
Posts: 9817
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How To-Reinstall GRUB No Command line

Post by Pierre »

I will give you an example from my own play/test system. I may have 2 to 6 distros installed at any one time. They constantly change as I see something that strikes my fancy. I have a dedicated grub partition.
somewhat like my test box - except that I don't have a dedicated grub partition. :(

some thing that I should do - probably doesn't have to be more than a few ten's of Mb, either. :)

currently I just dump the new grub onto hd0
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

Post Reply

Return to “Tutorials”