Wednesday, December 22, 2010

Ubuntu Wubi vs Grub Upgrade

Back in my younger days, I really loved tinkering around with Linux. I wouldn't consider myself a Linux expert, but I was learning, and gained a lot of experience. I stated out using Red Hat, before Fedora, and played around with Gentoo, PHLAK, and even built a firewall using Coyote Linux installed on a Floppy disk. It was a great learning experience, and I made sure I used a computer which I didn't need anymore.

Then, I had kids. All of my free time was taken up by the family. I needed to prioritize my life a little stricter, and family, personal health, job, and relationships took priority over Linux. So, for the following 5 years, I was a Windows user. My job didn't require any Unix or Linux work, and being a Java programmer (for the most part), it didn't matter what OS I used.

Last summer, I decided to get back into it. My kids are grown to the age where they can entertain themselves, and don't need constant supervision. So, I decided to check out Ubuntu. I've heard a lot of great things about Ubuntu. I went to their website, and was about to create a LiveCD when I noticed they have a Windows Installer.... huh? Whats this? An executable which installs Linux as a Dual Boot? No hard drive partitions? No figuring out swap size? The culprit is known as Wubi. after a download and a double click, I restarted. My computer started up with a Bootloader menu, displaying a selection for Windows 7 and Ubuntu. I selected Ubuntu and set it up. It was so easy. I almost felt ripped off. I mean, come on, my elitist Linux user attitude could no longer be expressed, since Ubuntu is as simple as Mac OS.

All was going well, for a couple weeks, I was in dual boot bliss. Until, one day, the Update Manager notified me that there was a new version of Grub. I refreshed my memory about what Grub was. Grub is a bootloader. Ok, I will update it.

Then it happened.... a problem with the typical Linux complexity. I rebooted, and in place of the nice bootloader menu, I got the following:
error: no such device: c73d2390-fb23-82c2-63823ae2eac2c
grub rescue>
What is this???? I quickly grab a second laptop and start up google. I search for "grub" and "ubuntu grub rescue". A lot of results are returned. After a while of sifting through the links, I find out that Grub and Wubi don't really play nice. In theory, Wubi has a bootloader which should send control to Grub. That is what was happening before the upgrade. The new version of Grub caused a conflict, such that Wubi didn't run, and Grub didn't know where it was. My initial google search was good for learning about the problem, but didn't yield much in terms of fixing the problem. So, I added "wubi" to the search terms, and I received a lot more results. Many of them told me to go here: "How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 10.10)". This seemed like the fix I was looking for. Only problem, it wasn't ment as a fix for Wubi installs. Wubi is a different beast all together.

More searching of the ubuntuforums site produced more insight about the problem, and how to ultimately fix it. The solution was to install lilo, another Windows bootloader, and don't ever update Grub. So, I made an Ubuntu LiveCD, and booted from it. That worked nicely and gave me access to a terminal. I then installed lilo, and added it to the mbr (the first sector of the primary hard drive):
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr
After reloading.... It worked :-)
Other forum posts recommended to lock the Grub version in the updater. That is ok to do, but I decided I don't like Wubi anymore. But what can I do? I have a lot of customizations and software currently installed in my current Ubuntu install.

Well, it turns out that if I had only installed Ubuntu as its own partition from the beginning, this wouldn't have happened. But I did not give up hope, googleing "convert wubi install to partition". I found this post: "HOWTO: migrate wubi install to partition". Perfect, just what I needed. Basically, I have to free up some space on my hard drive, aka deallocate it, and create 2 partitions. One for the root /, and the other for the swap space. Windows 7 has an easy way to "shirnk" a partition, which will free up some space on a hard drive. I made the 2 partitions with 60G for root, and 6G for swap (I have 4G of RAM, so 6G sounded good).

Going through the manual steps outlined in the post worked like a charm. I rebooted and could use an updated Grub to load into Ubuntu or Windows. I booted into windows and used "Add/Remove Programs" to delete the Wubi install, since I no longer needed it. All is right in my Ubuntu world. The moral of the story is.... learn to use google.... and beware of Wubi. Wubi isn't bad, but it wasn't obvious that this would be a problem. After all of this.... my elitist Linux user attitude is restored (At least in front of my non-Linux friends).

1 comment:

Anonymous said...

I had the same problem, from my past linux/windows usage Ive remember that clearing mbr will work and it did :P