The new versions of Ubuntu from 9.10 are preloaded with the new version of the Grub ie. Grub 2 as the default boot loader. Grub 2 has many modification over the previous versions. It is driven by a group of scripts in different directories in /boot and /etc. I have already blogged about configuring grub 2 to change the appearence, adding a background image etc... on to the boot loader menu in a previous post. This post is all about restoring the grub 2 in an occasion where you lost your current grub 2 boot loader overwritten by some other boot loader installation. This possibly occurs when you install multiple operating systems on a machine, and especially when some other OS after the Ubuntu. This is a simple and working tip, try it.
U should need following tools for this . .
1. An Ubuntu Live CD (9.10 or any later versions)
2. The partition where your Ubuntu resides (that u are going to
restore), It should be something like /dev/sda12
Follow the steps
Take the terminal and follow the steps
$ sudo fdisk -l
- Now, you need to remember which device listed is your linux distribution, for reference, /dev/sda1 will be used. Now weneed to mount the filesystem to/mnt
$ sudo mount /dev/sda1 /mnt
- If you have /boot on a separate partition, that need's to be mounted as well. For example /dev/sda2 is used here.
$ sudo mount /dev/sda2 /mnt/boot
Now mount the rest of your devices
$ sudo mount --bind /dev /mnt/dev
- Now chroot into your system
$ sudo chroot /mnt
You should be chroot'd into your system as root, you can now
run commands as root, without the need for sudo.
- Now edit the /etc/default/grub file to fit your system
$ nano /etc/default/grub
- When that is done you need to run update-grub to create the configuration file.
$ update-grub
- Now install GRUB 2 to the MBR as follows
$ grub-install /dev/sda
- If you encounter any errors, try$ grub-install --recheck /dev/sda
- Press Ctrl+D to exit out of the chroot.
- Once you exit back to your regular console, undo all the mounting,
$ sudo umount /mnt/dev
$ sudo umount /mnt
(But if you have a separate boot partition which you mounted earlier, you have to unmount this first, or you will get a "device busy" error message.)
- That's all you have to do with your Live CD. Exit the terminal and restart your machine.
If you had alternate OS entries, update-grub might say "Cannot find list of partitions!". Ignore it and continue...
When rebooted the grub 2 boot loader will be ready for you. Don't worry if you don't see other operating systems that are already installed in your system. Once you can boot into your linux installation, rerun update-grub and grub-install /dev/sda as root. This will add the entries of the other operating systems in to the current boot loader.
1 comments:
I recoverd the grub of 10.04 after installing moblin on my dell laptop. But now no way to boot into moblin...pls help
Post a Comment
speak out... itz your time !!!