4

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 :)

2

3 Answers 3

4

(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.

1

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .