{"id":75,"date":"2007-03-22T21:18:06","date_gmt":"2007-03-23T02:18:06","guid":{"rendered":"http:\/\/www.summet.com\/blog\/2007\/03\/22\/fixing-a-grub-bootloader-what-to-do-when-your-computer-wont-boot\/"},"modified":"2007-03-22T21:18:06","modified_gmt":"2007-03-23T02:18:06","slug":"fixing-a-grub-bootloader-what-to-do-when-your-computer-wont-boot","status":"publish","type":"post","link":"https:\/\/www.summet.com\/blog\/2007\/03\/22\/fixing-a-grub-bootloader-what-to-do-when-your-computer-wont-boot\/","title":{"rendered":"Fixing a GRUB Bootloader (What to do when your computer won&#8217;t boot!)"},"content":{"rendered":"<p>If, for some reason your linux computer won&#39;t boot, it could be because the bootloader has gotten correupted.&nbsp; If you are using GRUB, a few things could have gone wrong, but I will describe how to do a complete re-install of grub, and then set up the boot menu again. The system I was working on was Ubuntu 6.10.<!--more--><\/p>\n<p>First, you will need an emergency rescue CD. I recommend the <a href=\"http:\/\/www.sysresccd.org\/Main_Page\">systemrescuecd&nbsp;<\/a> because at 115MB it is relatively quick to install, but has all of the tools you&#39;ll need.&nbsp; Burn the CD, and then boot your computer off of it.<\/p>\n<p>On my system, \/dev\/hda1 (a.k.a <strong>hd0,0<\/strong> to grub) had a windows partition, \/dev\/hda2 had a linux swap partition, and \/dev\/hda3 (a.k.a. <strong>hd0,2<\/strong> to grub) had the linux partition.<\/p>\n<p>You can run the grub shell off of the rescue cd by simply typing: <strong>grub<\/strong><\/p>\n<p>It will probe your hardware and then give you a prompt. In my case, I knew that a full version of grub was already installed in \/boot\/grub\/ on \/dev\/hda3, but to find where it is installed on your computer you can run the command: <strong>find \/boot\/grub\/stage1<\/strong><\/p>\n<p>Now that you know where it is, tell grub to use that partition as your &quot;root&quot;: <strong>root (hd0,2)<\/strong><br \/> <em>NOTE: I used (hd0,2) your parition may be different, see the find command above!<\/em><\/p>\n<p>Then, to install the grub stage1 and 2 files, type: <strong>setup (hd0)<\/strong><br \/> <em>Note: I used hd0 which is the same as \/dev\/hda, if you have multiple disks you may need to use hd1 etc&#8230;<\/em><\/p>\n<p>This will get the grub stage 1 and 2 installed on your disk, making it bootable.<\/p>\n<p>Now, take out the rescue CD, and reboot your computer. If you did everything correctly, it will boot up to a GRUB prompt. You can use this grub prompt to manually boot into your linux partition. First, you will need to find your kernal and initrd image. On my Ubuntu disk, \/vmlinuz and \/initrd.img are links to the correct files, so the command: <strong>find \/vmlinuz<\/strong> returns (hd0,2).<\/p>\n<p>To specify the kernel and initrd, use the following commands:<\/p>\n<p><strong>kernel \/vmlinuz root=\/dev\/hda3<\/strong><br \/> <strong>initrd \/initrd.img<\/strong><br \/> <em>NOTE: If your root is not \/dev\/hda3, you will need to replace that with the apprpriate drive\/parition.<\/em><\/p>\n<p>Now you can boot your system by typing:<strong>boot<\/strong><br \/> &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If, for some reason your linux computer won&#39;t boot, it could be because the bootloader has gotten correupted.&nbsp; If you are using GRUB, a few things could have gone wrong, but I will describe how to do a complete re-install &hellip; <a href=\"https:\/\/www.summet.com\/blog\/2007\/03\/22\/fixing-a-grub-bootloader-what-to-do-when-your-computer-wont-boot\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-linux","category-goodlinks"],"_links":{"self":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":0,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.summet.com\/blog\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}