<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d23884446\x26blogName\x3dJust+Another+Tech+Blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://justanothertechblog.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://justanothertechblog.blogspot.com/\x26vt\x3d-8342903261382138056', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Just Another Tech Blog

Anything and everything having to do with technology, computers, science, and most of all... Linux! The documentation of my Linux endeavor.



HOW-TO: Restore GRUB after Installing Windows

Sunday, January 14, 2007

I recently had to install Windows onto my system again (see previous post). Of course, in doing so, GRUB was effectively disabled and replaced with the Windows boot loader and its "fresh" MBR (of course, I couldn't boot into Linux from here). Since one just can't live without Linux and GRUB, here's a fairly simple way to get GRUB back:
  1. Download the Unofficial "Super Grub Disk." You can download Super Grub Disk as a cdrom iso, floppy disk image or an usb tar.gz.
  2. Burn it to a CD, put it on a floppy, or install to a USB Disk. Whatever. Just get it on something bootable
  3. Boot up the "Super Grub Disk"
  4. Select your language
  5. Select Linux
  6. Select "Fix Boot of Linux (GRUB)"
  7. Go back to first menu
  8. Select Quit, and then reboot
This should do the trick. If not, boot the "Super Grub Disk" again, and systematically go through the other options under "Linux" that pertain to reinstalling/ rescuing/ or restoring GRUB. Read the "help" that comes up when you choose any of these commands. This can be quite helpful! Upon reboot, you should now be greeted by GRUB. If everything went well, there will be an entry for Windows XP already on the menu. If not, boot into your Linux distro. From there, edit GRUB's menu.lst file (here's the Ubuntu way):

sudo gedit /boot/grub/menu.lst
Now, you will have to add an entry for windows. The format for this would be:

title Windows XP 64
root (hd0,0)
savedefault
makeactive
chainloader +1

Of course, you will have to change "(hd0,0)" to the partition where Windows is located. You can change the title of the entry... doesn't matter. Be sure to be familiar with the way GRUB identifies hard drives and partitions. Numbers start begin with 0, and letters are also expressed numerically, beginning with 0. For example, /dev/hda1 would be "hda0,0" to GRUB, and /dev/hdb3 is "hda1,2".

Now, reboot, and you should once again be greeted by GRUB, this time with an entry for Windows. Select Windows, and see if it works. If not, you didn't specify the right hard drive/ partition to boot from. Repeat the steps in the preceding paragraph, directing GRUB to a different partition to boot from.

The steps listed above worked for me, and they can for you too! Just be patient, and don't do anything without thinking about it first. Be sure to have a backup of all your data, which is a good thing to have anyways! If you have further questions, you may consult me, or head on over to a forum.

A special thanks to the Ubuntu Community from where I got this information!
posted by linnerd40, Sunday, January 14, 2007


0 Comments:

Add a comment