Grub rescue - error: unknown filesystem

I could not figure out why the following did not fix grub:

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

So I downloaded boot-repair based on an answer from Persist commands typed to GRUB rescue post. That seemed to do the trick after I picked the "Recommended Repair (repairs most frequent problems)" option.

I have also used Grub Customizer to customize the order of boot entries.


Use:

  1. set prefix=(hdX,Y)/boot/grub. Use the values determined earlier.
    Example: If the Ubuntu system is on sda5, enter:
    set prefix=(hd0,5)/boot/grub
  2. set root=(hdX,Y). Example: set root=(hd0,5)
  3. insmod normal. Attempt to load the normal module.
  4. normal

We basically need GRUB to know where the /boot/grub folder is. If this is not working, I guess doing a GRUB install from a boot CD is a good option.


There is an alternative cause of this problem. In this particular case, GRUB was somehow corrupted and needed to be repaired or reinstalled. However, as shown in Grub rescue fails with "Boot Repair" with error "unknown file system", it's also possible that the root partition on which GRUB is installed could be corrupted. To fix this:

This is a possible solution, but it should not be used likely lest your root partition become further corrupted. Running the command fsck -t ext4 /dev/sda1, this program attempts to search and repair errors on a corrupted filesystem. Replace sda1 with your actual root partition. Replace ext4 with the actual filesystem; you have to know the file system or else the partition will be more corrupted. See Repairing a corrupted filesystem for more information.


Even though this question has an answer, there is an alternative way to fix the problem that worked for me. The steps are explained in the painful video Grub Rescue - Guide for beginners. In short, it will reinstall GRUB 2 altogether instead of repairing it.

Because this video is so painful to watch, I'll list the steps below (as I should regardless of how painful it is to watch the video)

  1. Launch a live session of Ubuntu. The video uses a live CD whereas I used a live USB. I made sure that the live USB had the same version of Ubuntu that I had on my harddrive.
  2. Find where your root partition was mounted. In the video, the user uses Nautilus to navigate through each drive that was mounted. It was mounted with a long string of numbers and characters. If this is the case, follow the following steps to remount the partition. Else, proceed to step 5.
  3. Bring up the terminal with Ctrl + Alt + T and use the mount command to find the name of the partition.
  4. Mount the partition. Create a new folder in your media folder. sudo mkdir /media/ubuntu. Then simply mount your partition to that folder. sudo mount /dev/sdxx /media/ubuntu where xx of sdxx is determined in step 3.
  5. Bind the following directories from the root directory of your live CD/USB to that of your root directory on your version of Ubuntu. The directories are the dev proc and sys. Do so with the following commands:

    sudo mount --bind /dev /media/ubuntu/dev
    sudo mount --bind /sys /media/ubuntu/sys
    sudo mount --bind /proc /media/ubuntu/proc
    
  6. Change the root directory to the one on your Ubuntu partition. sudo chroot /media/ubuntu/

  7. Having done the above, installing GRUB 2 again will install it to the root directory of your distribution of Ubuntu and not that of the live CD/USB's. So go ahead and run sudo grub-install /dev/sdx

And that's how to fix GRUB using a live CD/USB. This method was developed by YouTube user crazytechzone.