I have a multiboot system set up. The system has three drives. Multiboot is configured with Windows XP, Windows 7, and Ubuntu - all on the first drive. I had a lot of unpartitioned space left on the drive and was reserving it for adding other OSes and for storing files there in the future.
One day I went ahead and downloaded Partition Wizard and created a logical NTFS partition from within Windows 7, still some unpartitioned space left over. Everything worked fine, until I rebooted the computer a few days later.
Now I'm getting:
error: unknown filesystem.
First of all I was surprised not to find any kind of help command, by trying:
Now I'm stuck with non-bootable system. I have started researching the issue and finding that people usually recommend to boot to a Live CD and fix the issue from there. Is there a way to fix this issue from within grub rescue without the need for Live CD?
By following the steps from Persist commands typed to GRUB rescue, I was able to boot to initramfs prompt. But not anywhere further than that.
So far from reading the manual on grub rescue, I was able to see my drives and partitions using
ls command. For the first hard drive I see the following:
(hd0) (hd0,msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)
I now know that (hd0,msdos6) contains Linux on it, since
ls (hd0,msdos6)/ lists directories. Others will give "error: unknown filesystem."
After the following commands I am now getting to the boot menu and can boot into Windows 7 and Ubuntu, but upon reboot I have to repeat these steps.
Thanks Shashank Singh, with your instructions I have simplified my steps to the following. I have learned from you that I can replace msdos6 with just a 6 and that I can just do
insmod normal instead of
insmod /boot/grub/linux.mod. Now I just need to figure out how to save this settings from within grub itself, without booting into any OS.
Well, it seems like it is a requirement to boot into Linux. After booting into Ubuntu I have performed the following steps described in the manual:
sudo grub-install /dev/sda
This did not resolve the issue. I still get the grub rescue prompt. What do I need to do to permanently fix it?
I have also learned that drive numbers as in hd0 need to be translated to drive letters as in /dev/sda for some commands. hd1 would be sdb, hd2 would be sdc, and so on. Partitions listed in grub as (hd0,msdos6) would be translated to /dev/sda6.
I could not figure out why the following did not fix grub:
sudo grub-install /dev/sda
So I downloaded boot-repair based on an answer from https://help.ubuntu.com/community/Boot-Repair post. That seemed to do the trick after I picked the "Recommended Repair (repairs most frequent problems)" option.