How to restore grub 2 for ubuntu 10.10?

1

After installing XP my grub is lost. How to restore it? I refer to a site and did below but that is not solving my problem


ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 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: 0xdcfddcfd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2433    19543041    7  HPFS/NTFS
/dev/sda2            2434        7969    44467889+   f  W95 Ext'd (LBA)
/dev/sda3            7970        9728    14129167+   7  HPFS/NTFS
/dev/sda5            2434        4866    19543041    7  HPFS/NTFS
/dev/sda6            4867        7299    19543041    7  HPFS/NTFS
/dev/sda7            7300        7919     4980118+  83  Linux
/dev/sda8            7920        7969      401593+  82  Linux swap / Solaris

Then I mounted my linux partition

 ubuntu@ubuntu:/media$ sudo mkdir mnt1
 ubuntu@ubuntu:/media$ sudo mount /dev/sda7 mnt1

Then

 ubuntu@ubuntu:/media$ sudo grub-install --root-directory=/mnt/ /dev/sda
 /usr/sbin/grub-probe: error: cannot find a device for /mnt//boot/grub (is /dev mounted?)`

getting error as above .. How can I solve it?

Sachin Doiphode

Posted 2011-04-03T13:20:34.553

Reputation: 113

Answers

3

Let's see if you can spot your error:

ubuntu@ubuntu:/media$ sudo mkdir mnt1
ubuntu@ubuntu:/media$ sudo mount /dev/sda7 mnt1

followed by:

ubuntu@ubuntu:/media$ sudo grub-install --root-directory=/mnt/ /dev/sda

Where is your root directory mounted? Is it /mnt? That's not where you mounted it just now...

ubuntu@ubuntu:/media$ sudo grub-install --root-directory=/media/mnt1 /dev/sda

Might be a better choice...

Facepalm time now?

Majenko

Posted 2011-04-03T13:20:34.553

Reputation: 29 007

HI @Matt :: Thanks for spotting the difference. – Sachin Doiphode – 2011-04-03T19:57:05.377