Ubuntu Lucid Dual-boot Error

Warning - Old Content

This post is quite old, and it might not apply anymore, or maybe there's a better way to do the same thing nowadays. Take with a big grain of salt.

I just set up dual-boot on my laptop with Windows 7 and Ubuntu Lucid Lynx (10.04 beta1). It worked great (the new ubuntu installer is awesome) up until I rebooted into windows. Technically that worked well too, until I rebooted again and got the error:

No module name found. Aborted. Press any key to exit. [some stuff about pxe devices] No operating system found

Now, this isn’t my first rodeo, so I know that’s not nearly as scary a message as it seems - this usually means Windows isn’t playing nice with others, and decided to take its MBR and go home. The operating systems are still there, we just need to restore the MBR so they can be found. Luckily we’ve got a shiny ubuntu install disk, which can be used for recovery!

The solution:

  1. insert the ubuntu cd and select “Try without installing”
  2. wait for the ubuntu desktop to have started
  3. determine which partition your ubuntu install is on. Since my laptop is a dell, it’s on /dev/sda5 - yours is probably on /dev/sda2 for standard dual-boot setups. (I’ll use sda2 here)
  4. sudo mkdir /mnt/sda2
  5. sudo mount /dev/sda2 /mnt/sda2
  6. sudo chroot /mnt/sda2 /bin/bash
  7. sudo mount /proc
  8. sudo mount /dev
  9. sudo grub-install /dev/sda
  10. now reboot your computer, the grub menu should now show up!

Okay, so why does that work? The theory is that you need to mount your already-installed ubuntu partition somewhere, then chroot (change root) to start using that install’s files for the ensuing operations. The real fix is the call to grub-install - everything else is just setup.

I’m not sure yet whether windows 7 will continue to eat my MBR. If it does, I’ll post an update with further instructions.

Update: It appears that this is related to the Dell DataSafe Local Backup tool - it was one of the first things I disabled/uninstalled, which explains why I didn’t run into this again. I will re-enable it at some point and blog the results. Probably related to this ubuntu bug