{"id":4742,"date":"2021-08-11T00:21:37","date_gmt":"2021-08-11T06:21:37","guid":{"rendered":"https:\/\/www.supportpro.com\/blog\/?p=4742"},"modified":"2026-03-30T01:14:50","modified_gmt":"2026-03-30T07:14:50","slug":"how-to-repair-boot-failure-in-grub-2-rescue-mode-centos-7","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-repair-boot-failure-in-grub-2-rescue-mode-centos-7\/","title":{"rendered":"How to repair boot failure in GRUB 2 rescue mode &#8211; CentOS 7"},"content":{"rendered":"\n<p><img fetchpriority=\"high\" decoding=\"async\" width=\"720\" height=\"405\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2021\/08\/centos_capa-720x405-1.jpg\" alt=\"\"><br><br>GRUB denotes GRand Unified Bootloader. GRUB is a multiboot boot loader software program that first runs when a computer\/server starts. Its role is to carry forward from BIOS during the boot, load itself, load the kernel into memory, and then switch over execution to the kernel. Once the kernel picks over, GRUB has fulfilled its task and it is no longer needed. GRUB 2 is a descendant of GRUB. The GRUB 2 configuration file &#8220;grub.cfg&#8221; is normally located under the directory \/boot\/grub2.<br><br>Here we are discussing the boot issue and how we can repair Linux boot failure in GRUB 2 rescue mode.<\/p>\n\n\n\n<p><br> We may see one of the &#8220;grub>&#8221; modes on the screen when a boot fails. It provides the first sign of what might be causing the trouble to boot. The system failed to boot and ended up with this screen.<br> This prompt occurs when GRUB has found everything except the configuration file &#8220;grub.conf&#8221; during the booting process. That is GRUB 2 had loaded modules but was unable to get the &#8220;grub.cfg&#8221; file.<br> These are a few basic commands that you can use when you enter the GRUB 2 terminal mode.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>ls (Lists the contents of a partition\/folder; ls, ls \/boot\/grub)<\/li>\n\n\n\n<li>cat (view the contents of config or txt files; cat (hd1,1)\/boot\/grub\/grub.cfg, cat (md\/md2)\/boot\/grub2\/grub.cfg)<\/li>\n\n\n\n<li>set (Review current settings, or set a variable such as prefix, root.)<\/li>\n\n\n\n<li>insmod (Loads a module; insmod normal)<\/li>\n\n\n\n<li>normal (Activate the normal module, if loaded)<\/li>\n<\/ol>\n\n\n\n<p>If the GRUB fails to load the &#8220;normal&#8221; module, you will get a rescue shell. If the cause for the failure is that the &#8220;prefix&#8221; is incorrect, it refers to an incorrect device or the location of &#8220;\/boot\/grub&#8221; was incorrect with respect to the device. Then you need to manually fix the same and get into the normal mode.<br> You can inspect the current prefix and other preset variables by executing the command: set<br> You will probably have an output similar to this:<br> <img decoding=\"async\" width=\"737\" height=\"728\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2021\/08\/error_1.jpg\" alt=\"\"><br> Your output may vary but you will get the information needed. Then, you can determine which devices are available by executing the command: ls<br> In some cases, there are chances to have a software raid on the server. In that case, when executing the &#8220;ls&#8221; command, you will probably be seeing device names like md2 or md3, etc. You can view the contents of config or txt files using the &#8220;cat&#8221; command. Once you identified the device, verify or view the path of the contents of the grub config file as below.<br> cat (md\/md2)\/boot\/grub2\/grub.cfg<br> <img decoding=\"async\" width=\"355\" height=\"418\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2021\/08\/fig_2.jpg\" alt=\"\"><br> The&#8221;set&#8221; command will list values of variables necessary for a successful boot. Do take a note of values for root and prefix and assign them to GRUB manually. Here I&#8217;m showing an example for a server having a software raid.<br> Set the root value you got from the listing:<br> <b>grub> set root=(md\/md2)<\/b><br> (this has to be prepared according to your drive name)<br> Set the prefix value you got from the listing:<br> <b>grub> set prefix=(md\/md2)\/boot\/grub2<\/b><br> (this has to be prepared according to your drive name)<br> <img loading=\"lazy\" decoding=\"async\" width=\"408\" height=\"452\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2021\/08\/fig_3.jpg\" alt=\"\"><br> Then run the following commands to get out of the rescue mode to the normal terminal mode.<br> grub> insmod normal<br> grub> normal<br> The system will boot without any issue now to normal mode. Once the server is booted to a normal mode, you need to restore Grub in UEFI boot. For UEFI boot only, execute the below commands:<br> <b># efibootmgr -v<\/b><br> Then run: grub-install<br> <b># grub-install \/dev\/sda<\/b><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ Section<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. What causes a GRUB rescue prompt in Linux?<\/h4>\n\n\n\n<p>The GRUB rescue prompt appears when GRUB cannot locate the <strong>grub.cfg configuration file<\/strong>, usually due to disk changes, corrupted boot files, or incorrect prefix\/root settings.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. How do I exit GRUB rescue mode?<\/h4>\n\n\n\n<p>You can manually set the correct root and prefix values, then run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>insmod normal<br>normal<\/code><\/pre>\n\n\n\n<p>This loads the normal GRUB interface and allows the system to boot.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. How do I identify the correct partition in GRUB?<\/h4>\n\n\n\n<p>Use the <code>ls<\/code> command in GRUB rescue mode to list available devices and locate the partition containing <code>\/boot\/grub<\/code> or <code>\/boot\/grub2<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4. Do I need to reinstall GRUB after boot recovery?<\/h4>\n\n\n\n<p>Yes. After successful boot, reinstall GRUB permanently using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grub-install \/dev\/sda<\/code><\/pre>\n\n\n\n<p>to prevent future boot failures.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5. Can GRUB issues occur on RAID or UEFI systems?<\/h4>\n\n\n\n<p>Yes. Systems using <strong>software RAID<\/strong> or <strong>UEFI boot mode<\/strong> often require manual prefix configuration and bootloader restoration.<\/p>\n\n\n\n<p><strong>Facing Linux boot issues or stuck in GRUB rescue mode?<\/strong><br>Our <a href=\"https:\/\/www.supportpro.com\/requestquote.php\" title=\"\">expert Linux support team<\/a> can quickly diagnose and restore your server bootloader, minimizing downtime and ensuring system stability. Contact us today for fast recovery assistance.<\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Partner with <strong>SupportPRO<\/strong> for 24\/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.<\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GRUB denotes GRand Unified Bootloader. GRUB is a multiboot boot loader software program that first runs when a computer\/server starts. Its role is to carry forward from BIOS during the&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[91,3],"tags":[],"class_list":["post-4742","post","type-post","status-publish","format-standard","hentry","category-linux","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/4742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=4742"}],"version-history":[{"count":22,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions"}],"predecessor-version":[{"id":16829,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions\/16829"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=4742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=4742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=4742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}