Wizards that link to this one
This wizard explains step by step how to restore Grub to your machine thanks to Super Grub2 Disk and some extra commands in the command line. You can find more information about what problems you can solve with this wizard and what you get after performing the Wizard steps at: Wizard – Restore Grub .
Wizard steps to perform
When you boot in Super Grub2 Disk you will get into Super Grub2 Disk menu without the need of doing anything. When you boot thanks to YUMI by default is going to boot into your first hard disk. You have to select GRUB Bootable ISOs or Windows XP by using down arrow key and then return key. Then you get into GRUB Bootable ISOs or Windows XP screen. Use again the down arrow key and then return key to select Super Grub2 Disk entry. Finally you get into Super Grub2 Disk screen.
Super Grub2 Disk – Press return at boot
Booting with CDROM or with USB built with dd
Booting USB thanks to YUMI
When you boot in Super Grub2 Disk you will get into Super Grub2 Disk menu without the need of doing anything.
When you boot thanks to YUMI by default is going to boot into your first hard disk.
You have to select GRUB Bootable ISOs or Windows XP by using down arrow key and then return key.
Then you get into GRUB Bootable ISOs or Windows XP screen.
Use again the down arrow key and then return key to select Super Grub2 Disk entry.
Finally you get into Super Grub2 Disk screen.
Detect any Operating System
Select Detect any Operating System option.
Select the OS you want to boot
Among the different Operating system and kernels select the one that identifies your system.
Find out what your hard disk and root partition devices are
From your installed system you need to run either:
sudo fdisk -lu
(where you will have to write your user password blindly) as a admin user or:
as root user from a terminal.
A possible output might be:
Disco /dev/sda: 21.5 GB, 21474836480 bytes 255 cabezas, 63 sectores/pista, 2610 cilindros, 41943040 sectores en total Unidades = sectores de 1 * 512 = 512 bytes Tamaño de sector (lógico / físico): 512 bytes / 512 bytes Tamaño E/S (mínimo/óptimo): 512 bytes / 512 bytes Identificador del disco: 0x000221dd Dispositivo Inicio Comienzo Fin Bloques Id Sistema /dev/sda1 * 2048 41940991 20969472 83 Linux
In most of the cases you will see that you have a Linux system partition sda5, sda4, or whatever sdaX. That means that your hard disk (as it’s seen above) it’s sda.
In any case we recommend to check hard disk size next to Disk /dev/sdX at the output’s beginning so that you make sure that you select the exact hard disk that boots initially in your machine.
Now we are going to install grub back to the MBR, which it is what most people to do.
In the next command you will need to replace sda with your hard disk.
Either you run:
sudo grub-install /dev/sda
(where you might have to write your user password blindly or not) as a admin user or:
as root user from a terminal.
The most probable output for the command is:
Installation finished. No error reported.
That means that the installation was successful. When you reboot Grub menu should be alive again.
Update Grub configuration
Although strictly not needed is a good idea at this point to re-create the Grub configuration files. Either because you have added a Windows partition or because your Gnu/Linux partition is in a different partition (That latter case usually needs /etc/fstab to be edited too but that would be another howto.).
There are different ways of updating Grub configuration depending on you using Grub legacy, current Grub (Grub2), Debian based distributions, Fedora based distributions or custom distributions. We will try to cover most of the options. We will start just by the ones we think are the most common ones.
As I said this before this step is strictly not needed so you can skip it. Just go back to this step if after Restoring grub step (and rebooting) you see your former grub but somehow your Grub menu does not work as expected. You know, Gnu/Linux or Windows is not booting as it always happened.
Another alternative is using Rescatux which has an Update Grub option which tries to take care of all the possible situations.
If your distribution does not use sudo please run the command without the initial sudo and as a root user.
Debian or Ubuntu based systems
Fedora Grub2 based systems
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Most Grub2 based systems including Debian based ones
sudo grub-mkconfig -o /boot/grub/grub.cfg
SuSE Grub1 based systems
Although there are some unofficial scripts for this task the official way of changing them is: