How to Reinstall the grub?

Hi All,

I was using open suse with win 7 in a PC with dual boot (grub). But my Hard Drive has 170GB of free space (please, do not ask why I left this empty space :smiley: ). Onde day I needed to use this free space and formated it using the windows. It worked fine, but when I reestarted the notebook my grub did not opened!

To solve the problema I tried to recovered it but with no sucess, so I found a tutorial to reinstall the grub, It worked partialy, becouse my open suse partition was not detected and I can’t acess it! :frowning:

I preciate some help!

>:(

Please boot from a LiveCD, open a terminal window and do:


su -c 'fdisk -l'

Copy and paste output here

Hi Knurpht,

Thank you very much for replaying!

I did it using a ubuntu live CD (that is what I have at moment), but I cold not use the super user, is that some problem?


ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5b81278b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1175     9432064   27  Unknown
/dev/sda2            1175        1188      102400    7  HPFS/NTFS
/dev/sda3            1188       31132   240525336    7  HPFS/NTFS
/dev/sda4   *       31132       60802   238324737    5  Extended
/dev/sda5           31132       31679     4393984   82  Linux swap / Solaris
/dev/sda6           31679       36542    39061504   83  Linux
/dev/sda7           36542       37758     9764864   83  Linux
/dev/sda8           37758       60777   184904704    7  HPFS/NTFS
/dev/sda9           60777       60802      195584   83  Linux

I have heard somewhere that there is a limit of partition and OS that grub can manage. Is it true? Because I am think in have 3 operational systems and a data partition, is it possible?

Thanks again!

you can not reinstall openSUSE Grub from an Ubuntu live CD. This is not the same Grub version

Don’t worry about the limit! You won’t reach it.

Absolutely. Notice that you can share the swap partition between all installed Linux distros.

I know that I can’t reeinstall with the ubuntu live CD, I used it just for give you the fdisk comand.

Thanks

As you said you couldn’t access your openSUSE partition, you should check your Linux partitions from the live CD. Don’t mount them! Run the following commands:

fsck /dev/sda6
fsck /dev/sda7
fsck /dev/sda9

Then, from openSUSE live CD (or another live CD using Legacy Grub, like PartedMagic or Fedora), type the following commands (the text in blue) in a root terminal (su -l):


grub
> **find /boot/grub/stage2**
(hd0,5)
> **root (hd0,5)**
Filesystem type is ext2fs, partition type 0x83
> **setup (hd0,3)**
....
> **quit**

The example above assumes that your Linux root partition is sda6 (sda6 = (hd0,5) ). This will be the partition where /boot/grub/stage2 is located. The fisrt command is used to find the partition. In your case, it will be (hd0,5), (hd0,6) or (hd0,8) but none other partition!