Today i destroyed my Grub via installing windows on my Lenovo Thinkpad. After a long research i found the way to recover the ubuntu after the windows installation. Here is the step by step guide to recover it. You will need a LIVE cd if you are going to recover an Ubuntu Box.Download Ubuntu Jaunty, Karmic whatever you want.
Open the system with Live CD (I assume you are using Ubuntu Live CD).Press Alt+F2 and enter gnome-terminal command.And continue by entering :
Now i will mount Linux (sda1 here), i have no external boot partition as you can see.(IF YOU HAVE external one, do not forget to mount it! )
The following command is optional (it copies resolv.conf)
Now chroot into the enviroment we made :
After chrooting, you do not need to add sudo before your commands because from now, you will run commands as root.
You may want to edit /etc/default/grub file to fit your system (timeout options etc)
Play with the options if you want.(But do not forget to give grub-update command if you saved it
)

Now install/recover Grub2 via :
However you may get errors with that code like me.If so please use this command :
Now you can exit the chroot, umount the system and reboot your box :
No comments:
Post a Comment