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.

First of all, I'm a linux noob (I've been using linux for a about four-five years, but only fixed problems as I got them though usually I just reinstalled everything).

I have recently installed kubuntu 9.04, then upgraded to the latest Kubuntu (10.4). Everything went smooth and I have used it OK for about two weeks.

After the latest security/bugfixes update, the bootloader got corrupted.

My questions:

Can I restore it from the 9.04 boot CD/DVD, or do I need a special rescue system?

Should I get a new live DVD for 10.4 and fix it from there?

Also, what do I need to actually fix? What utilities do I need? (What should my steps be?)

Thanks :)

share|improve this question
add comment

5 Answers

up vote 3 down vote accepted

(K)ubuntu 10.04 uses Grub2 and the good news is that you can restore the boot loader configuration and the MBR by booting up from the live CD. See instructions here - even though the title sounds like it is related to only recovering from windows installation, the steps there allow you to re-install the respective bootloader back on your system.

On a side-note, I think since you have upgraded from Kubuntu 9.04 your system will probably still use legacy grub boot-loader. Please check here for how to upgrade to grub2. This is strictly optional - there is a note there about why the normal upgrade process didn't change the boot-loader when you moved from 9.04 to 10.04.

Please comment if you need more info.

share|improve this answer
add comment

More often than not, the process of restoring GRUB (in recent releases of Ubuntu, that means Grub2) is described in a convoluted way. In fact it's pretty straightforward. In a nutshell, the boot process may be broken because of one (or both) of these reasons:

  • Grub isn't installed to the boot sector of your drive ("Master Boot Record" or MBR) or has been corrupted (this may be caused by a number of things, including eminently installing Windows).

    N.B.: Grub can be installed to the MBR of your boot disk or to the "volume boot record" of a partition. In most cases, you'll want it to be installed in the MBR.

  • Your grub configuration (grub.cfg) is wrong or has been corrupted. On Ubuntu this file is generated for you (see below), so you don't need to touch it yourself, but you can manually re-create it by using update-grub.

I recommend following these instructions in the section "Recover Grub2 via Live CD". The procedure described there takes care of both sources of problems. These are the tasks you'll perform:

  • Start from a working Linux system, preferably a recent Ubuntu installation disc which is at the same time a Live CD. You do not need to use the Live CD of the variant or version of Ubuntu you're using. An older version is fine. The Live CD is only used to get access to your hard drive.
  • Find out the name of the partition that holds your boot directory, e.g. `/dev/sda1. In almost all cases, that's just the Linux partition where you've installed Ubuntu.
  • Mount that partition to /mnt and chroot into the mount point. Note that this means that you get a shell that looks and behaves as if you had booted the system normally. You can do many things you can do on your regular system, like installing packages and editing configuration.

    You might be fine without chrooting, using the update-grub provided by the Live CD along with the switch --root-directory. But knowing how to chroot into a system partition is a useful skill, and the procedure is more robust.

  • Check /etc/default/grub to see if something's wrong there (normally this should be fine).
  • Regenerate grub.cfg by running update-grub.
  • Install grub to the hard disk by running grub-install. This is the crucial step.

Then you can reboot and the system should start again. For the details, see the link. Finally, note that the step preceded by "If you have /boot on a separate partition" is not needed in normal circumstances, though the three commands doing the "bind"-mounts which follow are required.

share|improve this answer
add comment

Check the "Recovery" instructions from: https://wiki.ubuntu.com/Grub2

share|improve this answer
    
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  hexafraction Aug 16 '12 at 13:20
add comment

This helped me recover the Grub quite a few times: http://www.webupd8.org/2009/12/how-to-recover-grub2-linux.html

share|improve this answer
add comment

Depending on the exact error you're getting, you may also have to disable some windows tools (Dell DataSafe Local Backup, etc) that may be causing the corruption to keep it from happening again. Here's a relevant bug report:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/482757

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.