I have had a nightmare trying to set up dual booting between Win XP and Linux Mint. One of my early attempts to overwrite the MBR on Windows totally wrecked my Windows partition and made it unreadable and unrecoverable from the Recovery Console so much of my time was spent reinstalling Windows (which, incidentally, is a lot more work than installing any Linux distro on the planet). I had many attempts at installing Mint and I have seen a fair few grub errors now. My problems were based on the fact that I was trying to put Windows and Linux on different disk drives and, presumably because two of the drives were on a RAID card, the order that the BIOS saw the drives in was different than the order that Linux Mint saw the drives (gparted was different again-very confusing).
I ended up buying System Commander 9 thinking that it would make the process easier but actually this didn't help at all. The boot manager still requires you to fix whatever grub errors you have before it will work and the partitioning tool it contains is not as good as gparted anyway. I was less than impressed with that.
What did help me enormously was the post below from mbwardle over on the Ubuntu forums regarding grub error 17. I carried out all of these steps and it fixed the booting problem with Linux Mint. In my case the 'setup (hd0)' step failed, returning 'error 17: Cannot mount selected partition' but I think that might have been because I still have System Commander installed but it didn't matter because it boots perfectly now anyway.
I don't think I'll be playing with the boot sector again for a while but I am very happy to finally have Linux Mint up and running!
a better solution
I got this error after installing the Ubuntu 7.10 release candidate.
The error usually happens because Linux and your BIOS detect your hard disks in different orders. GRUB tries to translate between the two using the device.map file in /boot/grub/device.map, which is automatically generated. Chances are, it guessed wrong.
In my case, I have three SATA hard disks.
My BIOS sees them as:
HDD1 - 80 GB - Windows
HDD2 - 80 GB - Linux
HDD3 - 250 GB - Media
Linux sees them as:
/dev/sda - 80 GB - Windows
/dev/sdb - 250 GB - Media
/dev/sdc - 80 GB - Linux
So it generated device.map assuming that order was correct, i.e.:
When the installer installed GRUB using that data, it tried to install the first part of GRUB on /dev/sda and told it to look for the OS on /dev/sdc. Unfortunately, this translated to "install on (hd0) then look for the OS on (hd2)", so it was looking for the OS on the wrong drive.
To fix it, you have to teach GRUB which order the BIOS uses. To do this, follow these steps:
1) Boot from the Ubuntu CD
2) Open a Terminal (Applications->Accessories->Terminal)
3) Run "sudo -s"
4) Run "mkdir /ubuntu"
5) Run "mount /dev/sdc1 /ubuntu" (where /dev/sdc1 is your Linux root partition)
6) Run "chroot /ubuntu"
7) Run "cd /boot/grub"
Edit device.map (using vi or another text editor)
In my case, my new device.map was:
which told GRUB that sdc was really the second hard drive, not the third.
9) Run "grub --device-map=device.map"
10) Type "root (hd1,0)" (where hd1,0 is your Linux boot or root partition using the BIOS order)
11) Type "setup (hd0)" (where hd0 is your first boot drive, almost always hd0)
You should see a message that it's now telling GRUB to load 17+(hd1,0) instead of 17+(hd2,0) or something like that. This is what we want.
12) Edit menu.lst
You need to change references from (hd2,0) to (hd1,0), or whatever your Linux boot drive was autodetected as to whatever it is according to your BIOS.
If you get this step wrong, you'll see an error message something like:
Error 17: Cannot mount selected partition
meaning it's looking for a Linux file system on that partition, but it can't find one (because the drive device number is wrong in menu.lst).
14) Celebrate or complain in this thread!