A man will die, but not his ideas.

Friday, December 22, 2006

A Frustrating Weekend

This weekend turned out to be the most frustrating weekend I've had during the past year. It started with my Internet connection which, as usual every now and then, had technical and non-technical difficulties. Next, I was made responsible for completing a task which required installing Visual Studio.NET 2005. And since I wasn't satisfied with Windows XP's performance (which I stopped using a some months ago), I decided I'll install a fresh copy. I can't say I didn't know that this is going to get me into trouble. But I thought I'll get things corrected quickly. Little did I know what was to come.

As I expected, Windows overwrote the MBR of the hard disk, erasing GRUB. OK, so how to recover from this and GRUB back in place?! I googled around and came up with the solution. I first had to boot from a LiveCD to access a Linux shell. I had an old copy of Knoppix 4.0 lying around, so I used that. Afterwards, I mounted my root partition to a directory which I created at "/mnt". Then changed root via "chroot" to the mount point. After that, I had two choices to restore GRUB: use "grub-install" or the GRUB shell.

The first option resulted in the "The file /boot/grub/stage1 cannot be read correctly." message. I later discovered I had to explicitly specify where the configuration files exist. Anyway, I read somewhere about the SystemRescueCD which contains many useful utilities for fixing problems if something went wrong with your disto. So, I downloaded the ISO image and since I didn't want to waste a blank CD for 100 MB, I decided I'll use my USB stick. So, I copied the necessary files and used syslinux to make the USB stick bootable and configured my BIOS to boot from it.

Everything went smooth and I got a shell from which I proceeded as before except that this time I used the GRUB shell option. First I set the root partition using "root (hd0,x)", where x is the partition number. Then I used "setup (hd0)" to setup GRUB in the MBR. The output indicated that the operation was successful so I rebooted. I was happy to see GRUB loading the stage1 and attempting to load stage1.5 when all the sudden, BOOM, the machine restarted automatically. This went on in a continuous loop.

To be continued...

Posted by A :: 8:42 PM :: 0 Comments:

Post / Read Comments


Creative Commons License
Unless otherwise expressly stated, all original material of whatever nature created by the blog's author and included in the "A man will die, but not his ideas." weblog and any related pages, including the weblog's archives, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

* Java and the Java Coffee Cup Logo are trademarks or registered trademarks of Sun Microsystems,Inc. in the U.S. and other countries.