My hard drive started clicking and wouldn't boot this weekend. LUCKILY, I made a Clonezilla image just 2 days before. Let me give a little premise and what I did to fix this (maybe I can help others) and then I have a few questions so I can learn what I did and how Grub works:
I have three operating systems on my computer:
sda5=Ubuntu 10.04 X64
Prior to the failure, I was running just Win7/10.04 for a long time. Later, I decided to install 11.04. After the install of 11.04, I noticed that Grub changed from a black background to a purple background. My guess is that when I installed 11.04, it put on a newer version of Grub. It was okay as everything worked fine. I could run the GUI Start-Up Manager in 11.04 and everything worked fine.
After I restored the Clonezilla image to my new hard drive this evening, Grub defaulted right into Win7 like I had it set, but I noticed a black background in Grub (indicating perhaps it reverted to the 10.04 Grub?). Everything was fine in Windows land, so I rebooted and was going to fix the three files listed on the UsingUUID Ubuntu documentation starting with my 10.04 partition:
I ran "sudo blkid" and everything matched up. I rebooted and I went to boot my 11.04 and Grub couldn't find the kernel. I rebooted to my 10.04, chrooted to the 11.04 partition and found the kernel version was newer than the command in Grub. I rebooted and hit "e" in Grub and update the kernel number. Also, I had to change the file system from ext2 to ext4 (I'm not sure how this changed). Almost done: I got into 11.04 and ran the GUI Boot-Repair. I rebooted and found that Grub had a purple screen and I could boot into 11.04 just fine!
Okay, now I have some questions:
- Where does Grub reside? I think I was sort of lucky figuring out which OS was managing Grub based on the background color. Does Grub get installed on the same partition of the OS that it's administered through? Or is there another partition or sector where it's installed?
- What is the non-GUI way to fix this? I tried "sudo update-grub2" in 11.04, but when I rebooted it just went back to the black Grub which I think was the 10.04 Grub.
- How did the new UUID as identified in "sudo blkid" get updated after I reimaged my new hard drive? I read that this had to be done manually, but everything looked good to me.
- Sort of a strange question, but was this an okay way to fix it? I don't know much about computers, but I want to make sure I'm doing things right.
Thanks for all the help with the questions above. Hopefully someone else finds this useful.