2

So I was allocating some free space for ubuntu and now grub is launching in rescue mode. I have done a lot of searching and tried what has been suggested here several times.

Grub rescue - error: unknown filesystem

However, I have tried every ls (hdX,msdosY) possibility and all of them return a "Filesystem is unknown" message, all except for (hd0,msdos4) which returns "Filesystem is ext4."

I have booted in with a live version and have confirmed that the files are all there. I am of the understanding that what is needed is to associate the directory path of the grub modules in the root folder.

Sam C
  • 23
  • type set and see what it says the root and prefix variables are set to. – psusi Jul 22 '15 at 22:05
  • I typed "set" and it says "cmdpath=(hd0) prefix =(hd0,msdos5)/boot/grub root = hd0,msdos5, When I type "ls" it shoes (hd0) (hd0,msdos5) (hd0,msdos4) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1). Sorry about this comment formatting. – Sam C Jul 23 '15 at 00:09
  • Also, this seems silly, but in the original post I had posted the wrong link. Should be http://askubuntu.com/questions/119597/grub-rescue-error-unknown-filesystem – Sam C Jul 23 '15 at 00:21

1 Answers1

2

Assuming that hd0,4 is where you have ubuntu installed ( your root filesystem, and it also contains /boot ), then it seems that grub has the wrong prefix ( did it move since installing grub? ). At the rescue prompt, type set prefix=(hd0,msdos4)/boot/grub, then insmod normal and finally normal and that should get you to the normal grub prompt so you can boot up. Once booted, to fix this in the future, run sudo dpkg-reconfigure grub-pc to reinstall grub to the MBR with the correct prefix setting.

psusi
  • 37,551
  • Well done; that was it! Thanks. I had already typed that in like three times already, but I had neglected to add the 'normal' command. So I had actually changed it, but I guess it never actually got the chance to execute... – Sam C Jul 23 '15 at 03:11
  • That worked on a Xubuntu 18.04 system as well with a minor modification: If your /boot and / are on /dev/sda4, then set prefix=(hd0,4)/boot/grub. Mine were on /dev/sda1 so I set prefix=(hd0,1)/boot/grub. The other instructions worked for me as-is. – Richard Elkins Apr 21 '18 at 19:41