Question: I get this error:

```
Error: unknown filesystem.
grub rescue>

```

I'm not exactly sure what I did. I believe I installed Ubuntu over Windows on my Acer netbook. I then tried to install [Linux Mint](http://en.wikipedia.org/wiki/Linux_Mint), but it wouldn't start installing.

I turned the netbook off and back on. Now I get the error.

I have read a lot of other questions like this, but in my case I cannot boot a CD. If I put a Ubuntu CD or a Linux Mint CD into my external CD/DVD drive and change my BIOS to boot the CD-ROM first, it just gives me the same error screen.

**Update copied from comment dated 2012-05-26 02:54:29Z**

Here are some results from my commands: 

```
grub rescue>ls (hd0) (hd0,msdos5) (hd0,msdos1) 
grub rescue>ls (hd0,msdos5) unknown filesystem 
grub rescue>ls (hd0,msdos1) unknown filesystem 
grub rescue>ls (hd0) unknown filesystem 

```

Answer: 
**Before reading:** The answer below is meant for Ubuntu users who have just updated/recovered/reinstalled/installed OS X. It's likely that the answer will work if this isn't the case (for example, if there are any inconsistencies in your partition table), but I'm not sure.

For me, this happened after updating to [OS X Mavericks](http://en.wikipedia.org/wiki/OS_X_Mavericks) (10.9). Basically what may have happened is that OS X created a recovery partition ("Recovery HD") that the system only detects *sometimes*. For example, [GParted](http://en.wikipedia.org/wiki/GParted) in Ubuntu will see the recovery partition fine, but when listing the partitions in terminal (`fdisk -l`), you may not see the partitions.

Diagnosing the issue: Did the OS X update/format/recovery cause this problem?
-----------------------------------------------------------------------------

In order to diagnose that this is indeed the case, first use [GRUB](http://en.wikipedia.org/wiki/GNU_GRUB) rescue to boot into Ubuntu. In order to do this, follow [this page](http://www.gnu.org/software/grub/manual/html_node/GRUB-only-offers-a-rescue-shell.html) or see if any of the other answers on this question can get you into Ubuntu. For me, running the below commands temporarily allowed me to boot the correct partition. Depending on how your hard drives and partitions are set up, it may vary:

```
grub rescue> set prefix=(hd0,6)/boot/grub
grub rescue> insmod normal
grub rescue> normal

```

Now, log in to Ubuntu and check GParted. If you see the recovery partition, open up a terminal and type `fdisk -l` to see if that detects the recovery partition. If it doesn't list the same partitions, check the device/partition column and see if those also don't match up (for example, in GParted your boot partition may be `/dev/sda4`, but it is `/dev/sda3` when running `fdisk`). If this is the case, keep reading. If it's not, it looks like your partitions are lined up correctly. You can either choose to keep reading and follow the instructions (which, if GRUB was working before the restore/reinstall/etc..., this should work properly), or just reinstall GRUB on the right partition.

Fixing it by removing/merging the recovery partition
----------------------------------------------------

To fix this issue, what we want to do is get rid of the recovery partition - it's causing issues and inconsistencies, and removing it shouldn't cause damage. Ideally you want to merge it with the normal [HFS+](http://en.wikipedia.org/wiki/HFS_Plus) OS X partition, so follow this question and answer [here](https://apple.stackexchange.com/questions/115822/apple-recovery-partition-possibly-creating-problems-in-ubuntu). After merging, GRUB should be back to normal.
This happened to me after I delete a partition that was located before the `/boot` partition.

To fix it, I ran an Ubuntu live USB stick, mounted the root partition to `/mnt` and the boot partition to `/mnt/boot`, and I ran this command (replace `/dev/sda` with the correct hard disk):

```
sudo grub-install --root-directory=/mnt --boot-directory=/mnt/boot /dev/sda

```