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!
- insert the ubuntu cd and select “Try without installing”
- wait for the ubuntu desktop to have started
- 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)
sudo mkdir /mnt/sda2
sudo mount /dev/sda2 /mnt/sda2
sudo chroot /mnt/sda2 /bin/bash
sudo mount /proc
sudo mount /dev
sudo grub-install /dev/sda
- 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