Differences between revisions 7 and 15 (spanning 8 versions)
Revision 7 as of 2009-09-25 19:44:27
Size: 2411
Comment: fix supergrub url
Revision 15 as of 2014-03-19 14:21:43
Size: 3037
Comment: Deal with old version of Grub
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from GrubRecover
Line 2: Line 3:
= Recover Grub =
Imagine for any reason you have any other crappy OS installed next to Debian. And for any reason you need to reinstall it because is really broken. Again, imagine this crappy OS has a crappy installation and overwrites the disk MBR to own the full computer. What's next? Reinstall Debian? No.
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/GrubRecover|Français]] - [[it/GrubRecover|Italiano]] - [[ru/GrubRecover|Russian]]-~
----
= Recover GRUB =
Imagine for any reason you have any other OS installed next to Debian. And for any reason you need to reinstall it because is really broken. Again, imagine that OS has a crappy installation and overwrites the disk MBR or GPT to own the full computer. What's next? Reinstall Debian? No.
Line 5: Line 8:
In any case, you can use [[http://www.supergrubdisk.org/|SuperGrub]], a boot utility that can restore and repair overwritten and misconfigured GRUB installs or directly boot various operating systems. In any case, you can use [[http://www.supergrubdisk.org/|SuperGRUB]], a boot utility that can restore and repair overwritten and misconfigured GRUB installs or directly boot various operating systems.
Line 39: Line 42:

If you have grub-legacy <<FootNote(If you have stage1, stage2 and menu.lst files in /boot/grub/ then you probably have a working grub-legacy. If you have several *.mod files and a grub.cfg file in /boot/grub/ then you have the new grub.)>> and your root partition is /dev/sda3 then you can re-install grub in the MBR of your hard drive by typing the following commands :
Line 40: Line 45:
grub
grub>root (hd0,3) //assuming your root partition is /dev/sda3
sudo grub
grub>root (hd0,2)
Line 46: Line 51:
choose "Reboot the system", everything should be fine. Note that in grub-legacy (hd0,2) is the third partition.

Then
choose "Reboot the system", everything should be fine.

----
CategoryBootProcess

Translation(s): English - Français - Italiano - Russian


Recover GRUB

Imagine for any reason you have any other OS installed next to Debian. And for any reason you need to reinstall it because is really broken. Again, imagine that OS has a crappy installation and overwrites the disk MBR or GPT to own the full computer. What's next? Reinstall Debian? No.

In any case, you can use SuperGRUB, a boot utility that can restore and repair overwritten and misconfigured GRUB installs or directly boot various operating systems.

Standard procedure

The Debian Installer (DVD, netinst CD, floppy, netboot, etc.) can be used to rescue systems, for example if they fail to boot after an upgrade. You should read and follow the instruction "Recovering a Broken System" section of the Installation Guide1 (look for it in the index) [link to stable/i386].

Troubleshooting : 'grub-install /dev/sda' failed.

If D-I's "Reinstall GRUB boot loader" option fails, with error message

Unable to install GRUB in /dev/sda
Executing 'grub-install /dev/sda' failed.
This is a fatal error.

Also, the d-i log console (Alt-F4) displays

grub-installer: /dev/scsi/host0/bus0/target0/lun0/disc does not have any corresponding BIOS Drive

You can still use the following method to reinstall GRUB. Choose "Execute a shell in Your root partition" in the d-i rescue menu.

Locate your root partition :

fdisk -l

Disk /dev/sda: 39.9 GB, 39996820992 bytes
255 heads, 63 sectors/track, 4862 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         111      891576    7  HPFS/NTFS
/dev/sda2             167         230      514080   82  Linux swap
/dev/sda3             231         784     4450005   83  Linux
/dev/sda4             785        4862    32756535    f  W95 Ext'd (LBA)
/dev/sda5             785        4862    32756503+  83  Linux

Reinstall GRUB bootloader (grub manual)

If you have grub-legacy 2 and your root partition is /dev/sda3 then you can re-install grub in the MBR of your hard drive by typing the following commands :

sudo grub
grub>root (hd0,2)
grub>setup (hd0)
grub>quit
exit

Note that in grub-legacy (hd0,2) is the third partition.

Then choose "Reboot the system", everything should be fine.


CategoryBootProcess

  1. http://www.debian.org/releases/ (1)

  2. If you have stage1, stage2 and menu.lst files in /boot/grub/ then you probably have a working grub-legacy. If you have several *.mod files and a grub.cfg file in /boot/grub/ then you have the new grub. (2)