76

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, 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 
Hjke123
  • 785
  • do you have ubuntu live ISO in internal hard drive? – Rahul Virpara May 26 '12 at 02:45
  • If there is no defect in either your Ubuntu or Mint install CDs then either your hardware is broken or your BIOS is simply not trying to boot from the CD even though you think you told it to do that. Please take a look at the troubleshooting suggestions listed on the BootFromCD help page. – irrational John May 27 '12 at 02:07
  • I did what this answer said to do, but instead of (hd0,1) I put (hd0,3). I suggest trying that command with 1-6 instead of just 1 or 0. But try 0 too. –  Aug 24 '12 at 01:06
  • 1
    The answers below DO NOT WORK! This DOES WORK: re-install ubuntu. Select "do something else". When prompted, select your Windows partition as the boot partition. Do not select /boot or / as the boot partition. If you have an existing Windows installation, Ubuntu will come to this state. This is tested working and common knowledge. Persists: 14, 15, 16, 17 all versions. You might be unable to boot to Windows without the Ubuntu drive in your computer after doing this (untested). Possibly happens because your computer is selecting the wrong boot device (untested). – Wolfpack'08 Nov 08 '17 at 05:31

6 Answers6

89

The following solved the issue for me, I have Windows 7 & Ubuntu 10.04. After running the following commands I don't need to run these every time and am able to boot both the OS normally:

set root=(hd0,6)
set prefix=(hd0,6)/boot/grub
insmod normal
normal

Now once you boot into Ubuntu, run the following two commands as well:

sudo update-grub
sudo grub-install /dev/sda

Note: /dev/sda is drive where you want your GRUB installed, it can be /dev/sdb or something else, but is usually /dev/sda

Take into consideration that the hd0 could be X (0,1,2..) depending on the order of disks and the 6 could be also different, it could be (hd0,gpt7), for example.

Aditya
  • 13,416
  • I have a MacBook Air with Ubuntu and OSX, this solved my issues after the OSX Mavericks update! – Murphy Oct 24 '13 at 12:12
  • 1
    Thanks a lot. ( @Hjke123 this should be the accepted answer ! While the first post gives hints on how to get the Ubuntu disk/partition IDs ...) – Déjà vu May 08 '14 at 09:08
  • Excellent. These steps solved by issue. Just make sure that /dev/sda is your harddisk, which is the case most of the time. – palerdot Jul 11 '14 at 16:34
  • As I have /boot on other partition, it was set root=(hd0,gpt7) set prefix=(hd0,gpt7)/grub for me, but it worked, thank you very much. – Martin Vysny Aug 11 '15 at 07:40
  • 4
    insmod normal returns error: unknown filesystem.. – Wolfpack'08 Nov 08 '17 at 01:29
  • no such partition – Shubham AgaRwal Dec 01 '17 at 19:48
  • 1
    For me it was (hd0,msdos1). I also had to set root=(hd0,msdos1)/@ instead of set root=(hd0,msdos1), and I also had to do this: set prefix=(hd0,msdos1)/@/boot/grub. Only then the rest of the commands worked. – Deathkamp Drone Jan 14 '18 at 22:06
  • 1
    I figured I needed to enter the @ because when I did ls (hd0,msdos1), what I got was these two directories: @/ @home/. I don't know why this was the case for me, maybe someone with more knowledge can give an explanation, but for what it's worth, try doing this if you can't get insmod normal to work, that's how I got it to work on my machine. – Deathkamp Drone Jan 14 '18 at 22:09
  • 1
    Use (hdX,gptY), when you have a GPT-partitiontable and use (hdX, msdosY), when you have a MBR-partitiontable. You can also just try (hdX,Y). X = "disk-number" - 1 and Y = partition-number. So the disks starts at 0 and the partitions start at 1. To see all disks and partitions enter ls. – ArchLinuxTux Sep 12 '18 at 10:16
  • The cause of my errors was adding a new parition. Using set to find the current values, and using set to add 1 to the msdos, it fixed it. – Tvde1 Dec 01 '18 at 00:29
  • @DeathkampDrone This is most likely because you use btrfs, and they default to having two volumes in most installation, "@" for root filesystem, and "@home" for your home directories, being mounted respectively at / and /home by your system when you boot. However, on the raw mounted partition they are presented as you've seen when you mount it... – p0358 Apr 12 '23 at 09:10
39

First boot into Ubuntu from an ISO image.

  1. Locate the Ubuntu partition and the folder containing the GRUB modules.

    The GRUB folder containing the modules must be located so the correct modules can be loaded. This folder would have been created during the initial installation of Ubuntu and should be located in the Ubuntu partition. This folder would normally be located at either (hdX,Y)/boot/grub or (hdX,Y)/usr/lib/grub/i386-pc. Find your existing Ubuntu partition and the module folder.

    ls                               # List the known drives (hdX) and partitions (hdX,Y)
    ls (hdX,Y)/                      # List the contents of the partition's root
    ls (hdX,Y)/boot/grub             # Normal location of the Grub 2 modules.
    ls (hdX,Y)/usr/lib/grub/i386-pc  # Alternate location of the Grub 2 modules.
    
    • ls - should return all known drives (hdX) and partitions (hdX,Y)
    • ls (hdX,Y)/ - should show the contents of the root directory of the partition.
    • If you get an "error: unknown filesystem" this is not your Ubuntu partition.
    • If this is the Ubuntu partition, you will see the Ubuntu folders, including lost+found/, home/, boot/ and vmlinuz and initrd.img. Use this address as the first part of the next command.
    • ls (hdX,Y)/boot/grub - should display several dozen *.mod files. This is the folder you are looking for.
    • If you don't find the modules, try the alternate location: ls (hdX,Y)/usr/lib/grub/i386-pc
  2. Load the modules.

    set prefix=(hdX,Y)/<path to modules>
    
    • This command must correctly point to the folder containing the GRUB modules. The address should be the one in the previous section which displayed the modules.

    Examples:

    set prefix=(hd0,5)/boot/grub 
    set prefix=(hd1,1)/usr/lib/grub/i386-pc
    
    • Load modules:

      insmod linux
      insmod loopback
      insmod iso9660
      insmod fat        # If ISO is located on fat16 or fat32 formatted partition.
      insmod ntfs       # If ISO is located on an NTFS formatted partition.
      insmod nftscomp   # If NTFS compression is used on the partition. Load if you aren't sure.
      
    • A "file not found" error means that the path in the prefix is incorrect or the specific module does not exist. The prefix setting may be reviewed with the set command. Rerun the "set prefix=" command with the proper path.

  3. Locate the Ubuntu ISO file.

    • Using the combinations of ls commands, locate the Ubuntu ISO image.
  4. Create the loopback device.

    loopback loop (hdX,Y)/<path to ISO>/<ISO-name.iso>
    
    • Example:

      loopback loop (hd1,1)/path/to/ubuntu-10.04.1-desktop-i386.iso
      
  5. Load the Linux kernel and initrd image.

    set root=(loop)
    linux /casper/vmlinuz boot=casper iso-scan/filename=/<ISO-name.iso> noprompt noeject
    initrd /casper/initrd.lz
    
    • If the path to the ISO or filename is not correct, the boot will halt at the BusyBox screen and produce a message stating "can't open /dev/sr0: No medium found".
    • Note: If the ISO file is not in the / folder, include the path in the iso-scan/filename= entry. See second example.
    • Examples:

      linux /casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.04.1-desktop-i386.iso
      linux /casper/vmlinuz boot=casper iso-scan/filename=/my-iso/ubuntu-10.04.1-desktop-i386.iso
      
  6. Boot.

    That should be it. If the commands ran without any messages/errors, the commands were accepted as entered. It's now time to boot:

    boot
    

Further information is in forum post HOWTO: Boot & Install Ubuntu from the Grub Rescue Prompt

Now do this after booting:

How to fix: error:unknown file system grub rescue? is post with the same problem and is solved as below,

  1. sudo mount /dev/sdaX /mnt

    Here, sdaX is your boot partition. You can get a list with sudo blkid like this,

    /dev/sda1: LABEL="Windows XP" UUID="96A4390DA438F0FB" TYPE="ntfs" 
    /dev/sda3: LABEL="Ubuntu 11.04" UUID="b61fcae3-7744-45b4-95b9-7528d50a3652" TYPE="ext4" 
    /dev/sda5: LABEL="Se7en" UUID="A2DC9D71DC9D4109" TYPE="ntfs" 
    /dev/sda6: LABEL="Development" UUID="DEB455A1B4557CC9" TYPE="ntfs" 
    /dev/sda7: LABEL="EXTRA" UUID="D8A04109A040F014" TYPE="ntfs" 
    /dev/sda8: LABEL="SONG" UUID="46080FCD080FBAC7" TYPE="ntfs" 
    /dev/sda9: LABEL="BACKUPS" UUID="766E-BC99" TYPE="vfat" 
    

    Note: sdaX must be Linux partition.

  2. sudo grub-install --boot-directory=/mnt/boot /dev/sda

  3. sudo update-grub

kiri
  • 28,246
  • 16
  • 81
  • 118
Rahul Virpara
  • 11,720
15

Boot your system from the Ubuntu Live CD and try this, it worked wonders for me.

Eliah Kagan
  • 117,780
abbasdgr8
  • 269
  • It also worked for me! I got into problem when I downsized my Windows partition to create a new NTFS partition for my data with the released space (I did it with Partition Magic, a Windows software). I rebooted my computer with my Ubuntu DVD and downloaded & executed boot-repair which was able to see all the partitions on my hard drive and repair Grub. – Pierre C Nov 27 '17 at 04:23
  • In linux mint 18.3 64 bit cinnamon, it is works... Thanks @user91463.. you saved my life – Rudi Wijaya Feb 08 '18 at 06:32
  • This tool is GodSent. I was struggling with the randomness in boot due to installing CentOS in place of my Dual Boot Ubuntu. CentOS didn't allow me to log in to Windows for some reason. When I tried to bring back Ubuntu, everything messed up. It wasn't even allowing me to install Ubuntu again. This worked like charm. – Vibhor Dube May 10 '23 at 10:02
7

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 (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 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 rescue to boot into Ubuntu. In order to do this, follow this page 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+ OS X partition, so follow this question and answer here. After merging, GRUB should be back to normal.

jeremy
  • 575
  • 1
  • 5
  • 19
  • Removing the recovery-partition of course disables your ability to use it, so I'd say this is not a good option. Better try reinstalling GRUB2 and then "updating" (this is regenerating) it's config as described in the other answers. You may also use one of the recovery tools. – ArchLinuxTux Sep 12 '18 at 10:38
3

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
Flimm
  • 41,766
0

Your external CD/DVD is probably a USB device. You probably cannot tell BIOS to boot from it. When you start the ACER wacth for a message at the bottom (or top) of the screen saying something like "F2 to enter Setup, F12 for a Boot Menu". When you know what you need to press for the Boot Menu, put the CD in your external device, turn on or reboot the machine and slowly mash that key until you get a temporary menu allowing you to boot from the external CD.

You may need to use gparted from the CD to examine your hard drive and decide what to do to fix it so you can use it. That's beyond what I can describe here

Dazed_75
  • 417
  • 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 I don't know if this will mean anything to anyone trying to help and thanks for the response I will check – Hjke123 May 26 '12 at 02:54
  • He should be able to select his USB-drive from the BIOS-boot-order-selection menu - at least if he is using UEFI mode. – ArchLinuxTux Sep 12 '18 at 14:20