Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Apr 3 '11 at 13:25

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

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?

share|improve this answer
    
HI @Matt :: Thanks for spotting the difference. – Sachin Doiphode Apr 3 '11 at 19:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .