Advertisement
Guest User

nmvictor

a guest
Aug 23rd, 2009
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.
  2.  
  3. (This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)
  4.  
  5. Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.
  6.  
  7. When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)
  8.  
  9. Code:
  10.  
  11. sudo grub
  12.  
  13. This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands
  14.  
  15. Code:
  16.  
  17. find /boot/grub/stage1
  18.  
  19. This will return a location. If you have more than one, select the installation that you want to provide the grub files.
  20. Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)
  21.  
  22. Code:
  23.  
  24. root (hd?,?)
  25.  
  26. Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)
  27.  
  28. Next enter the command to install grub to the mbr
  29.  
  30. Code:
  31.  
  32. setup (hd0)
  33.  
  34. Finally exit the grub shell
  35. Code:
  36.  
  37. quit
  38.  
  39. That is it. Grub will be installed to the mbr.
  40. When you reboot, you will have the grub menu at startup.
  41.  
  42. Now the explanation.
  43. Sudo grub gets you the grub shell.
  44. Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
  45. So root (hd?,?) tells grub it's files are on that partition.
  46. Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
  47. Quit will exit you from the grub shell.
  48.  
  49. http://mirror.is.co.za/mirror/download.netbeans.org/6.7.1/bundles/netbeans-6.7.1-ml-linux.sh
  50. http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.4.tar.bz2
  51. http://download.virtualbox.org/virtualbox/3.0.4/virtualbox-3.0_3.0.4-50677_Ubuntu_intrepid_i386.deb
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement