Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After deleting old linux partitions in order to free space on hard disk I got an error from grub

error: no such partition

and then I see a grub rescue> prompt. After googling around I found that in order to boot normally I have to type following commands

set prefix=(hd0,msdos5)/boot/grub
set root=(hd0,msdos5)
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sda5 ro
initrd /initrd.img
boot

Here is the boot info summary report created by Boot-Repair.

However, on each reboot I have to type this again. How can I tell to grub once and forever what configuration file to use.

share|improve this question
    
I have the exact same problem, however when I try to use insmod I'm prompted with error: unknown filesystem.. When I ls I'm presented with (hd0) (hd0,msdos2) (hd0,msdos1). I've tried setting either of these as prefix and then root but whenever I try to insmod I'm prompted with the same error: unknown filesystem.. What can I do? –  piperchester May 8 '13 at 17:02
1  
@PolyShell I think you better ask this as a separate question. –  jutky May 8 '13 at 19:47
add comment

2 Answers

up vote 5 down vote accepted

Try these commands

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

If you want a graphical option, try boot-repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

enter image description here

share|improve this answer
    
Thanks a lot. Previously I was running Boot-Repair from a liveCD and it didn't helped, and after I've found what commands to type in grub rescue I haven't tried it once again. Thanks again. –  jutky Dec 26 '11 at 0:28
add comment

Did you run update-grub to update /boot/grub/grub.cfg?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.