I was dual booting Windows and Ubuntu. When I reinstalled Windows, it would no longer get to the GRUB menu.
It's showing:
error: no such partition.
grub rescue>
I want to fix this without using a live CD or USB stick, so I am just using GRUB rescue commands.
I found the useful page Repairing a broken GRUB 2 bootloader on Ubuntu, with the instructions (and explanations) of what to do:
grub> ls
(hd0) (hd0,5) (hd0,1) (fd0)
grub> set prefix=(hd0,1)/boot/grub
grub> set root=(hd0,1)
grub> set
?=0
color_highlight=
color_normal=
pager=
prefix=(gd0,1)/boot/grub
root=hd0,1
grub> ls /boot
grub/ System.map-2.6.32-21-generic abi-2.6.32-21-generic config-2.6.32-21-generic memtest86*.bin vmcoreinfo-2.6.32-21-generic vmlinuz-2.6.32-21-generic System.map-2.6.32-22-generic initrd.img-2.6.32-21-generic config-2.6.32-22-generic abi-2.6.32-22-generic vmcoreinfo-2.6.32-22-generic initrd.img-2.6.32-22-generic vmlinuz-2.6.32-22-generic
grub> insmod /boot/grub/linux.mod
grub> linux /vmlinuz root=/dev/sda1 defaults
grub> initrd /initrd.img
grub> boot_
But things went like this:
error: no such partition.
grub rescue> help
Unknown command 'help'
grub rescue> ls /boot
error: no such partition.
grub rescue> ls
(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
grub rescue> set prefix=(hd0,msdos1)/boot/grub
grub rescue> set root=(hd0,msdos1)
grub rescue> set
prefix=(hd0,msdos1)/boot/grub
root=hd0,msdos1
grub rescue> ls /boot
error: unknown filesystem.
grub rescue> boot
Unknown command 'boot'
So you can see that ls and boot showed the error unknown filesystem.