4

At first, Windows 7 was the only OS in the drive.

Then I installed Linux Mint. I accidentally formatted the sda1 partition (where the Windows 7 bootloader was stored) as ext4, being the mount point of /boot. As a result, I couldn't boot Win7 any more.

(By the way, Mint was installed in the sda5 partition)

Afterwards, I repaired the Win7 bootloader successfully, which deleted the GRUB(2?) loader, resulting in me being unable to boot Mint.

I tried running:

sudo mount /dev/sda5 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda

Resulting message is:

grub-probe: error: cannot find a device for /boot (is /dev mounted?).
Installation finished. No error reported.

And after reboot, I get the grub> prompt, but no OS options whatsoever.

(Keep in mind, there's no partition assigned for /boot)

2

Don't use grub-install, enter the grub interactive shell and use these commands to install the bootloader correctly. Use your correct partition numbers.

root (hd0,0) (where is /boot with /boot/grub/grub.conf and grub stages files ?)
setup (hd0) (where do you want to install the bootloader?)
exit

grub-install probably needs a /etc/mtab. If you wish to use grub-install, firstly copy /etc/mtab into /mnt/etc/mtab (don't worry about overwriting the older file, it's updated on every boot) then chroot into /mnt, and run your MINT grub-install script, inside the chroot.

1
  • 3
    A note on partition numbers: hd0 = sda, hd1 = sdb, etc.; (hd0,0) = sda1, (hd0,1) = sda2, etc.
    – Kevin
    Aug 17 '12 at 22:09
1

First, make sure that you have grub (if using Mint, apt-get install grub). Then run what Spidey posted. If you get error 15, quit the shell and run update-grub. It should ask you if you want to make a menu.lst, confirm yes. After that, try what Spidey posted and it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.