{"id":8583,"date":"2019-06-28T02:19:29","date_gmt":"2019-06-28T01:19:29","guid":{"rendered":"http:\/\/quad\/LinuxMintAdmin\/?p=7853"},"modified":"2019-06-28T02:19:29","modified_gmt":"2019-06-28T01:19:29","slug":"grub-rescue-2","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/grub-rescue-2\/","title":{"rendered":"Rescue Your System from an MBR corruption? grub rescue>"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_8583\" class=\"pvc_stats all  \" data-element-id=\"8583\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div><p><\/p>\n<p><\/p>\n<p>At the failed grub boot prompt you can assume the the non booting drive is \/dev\/sda1 to start and see if the insmod files are found:\u00a0<\/p>\n<p>set prefix=(hdX,Y)\/boot\/grub<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Or use the values determined by attaching the drive to a working linux install to find the partition order:<\/p>\n<p><span style=\"color: #0000ff;\">sudo fdisk -l<\/span><br \/>Disk \/dev\/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors<br \/>Units: sectors of 1 * 512 = 512 bytes<br \/>Sector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>Disklabel type: dos<br \/>Disk identifier: 0x64a1f25a<\/p>\n<p>Device Boot Start End Sectors Size Id Type<br \/>\/dev\/sda1 * 2048 231241727 231239680 110.3G 83 Linux<br \/>\/dev\/sda2 231241728 250068991 18827264 9G 5 Extended<br \/>\/dev\/sda5 231243776 250068991 18825216 9G 82 Linux swap \/ Solaris<\/p>\n<p>OR<\/p>\n<p><span style=\"color: #0000ff;\">sudo blkid<\/span><br \/>[sudo] password for stevee: <br \/>\/dev\/sda1: UUID=\"1d9ac196-b1df-4dd0-994d-b9c9b1e8f23f\" TYPE=\"ext4\" PARTUUID=\"64a1f25a-01\"<br \/>\/dev\/sda5: UUID=\"82fc41dd-56d4-41e4-99a8-85338bbdf01b\" TYPE=\"swap\" PARTUUID=\"64a1f25a-05\"<br \/>\/dev\/sdb1: UUID=\"f92a3d3c-adf4-48e0-8964-83f2b52e251c\" TYPE=\"ext4\" PARTUUID=\"b060933f-01\"<br \/>\/dev\/sdb5: UUID=\"e1a2c04b-3517-47aa-9636-3d713b864cdd\" TYPE=\"swap\" PARTUUID=\"b060933f-05\"<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Back in the failed grub menu, type:<\/p>\n<p><em>Example: If the Ubuntu system is on sda1, enter: set prefix=(hd0,1)\/boot\/grub<\/em><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\"><span style=\"color: #ff0000;\">set root=(hdX,Y)<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Confirm the correct X,Y values and press ENTER.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Example: If the Ubuntu system is on sda5, enter: set root=(hd0,5)<\/p>\n<p>\n<\/p>\n<p><span style=\"color: #ff0000;\">insmod normal<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Load the normal module.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If the module loads there will be no message.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If the module fails to load, try the full path: insmod (hdX,Y)\/boot\/grub\/normal.mod<\/p>\n<p>\n<\/p>\n<p><span style=\"color: #ff0000;\">normal<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Transition to the normal GRUB 2 mode with increased functionality.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If the module loads there will be no message, and may go to the next stage boot menu as normal.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If not, but the module loads, HELP, TAB completion and command recall using the UP\/DN keys should be available. Check current settings:<\/p>\n<p>\n<\/p>\n<p><span style=\"color: #ff0000;\">set<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">(Optional) Review the current settings.<\/p>\n<p>\n<\/p>\n<p><span style=\"color: #ff0000;\">insmod linux<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Load the linux module. An error message usually means the path is incorrect.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\"><span style=\"color: #ff0000;\">linux \/vmlinuz root=\/dev\/sdXY ro<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Selects the latest kernel.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Example: linux \/vmlinuz root=\/dev\/sda5 ro<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If the vmlinuz symlink does not exist in \/, use the full path to the kernel in \/boot<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Example: <span style=\"color: #ff0000;\">linux \/boot\/vmlinuz-3.2.0-14-generic root=\/dev\/sda1 ro<\/span><\/p>\n<p><span style=\"color: #ff0000;\">\n<\/span><\/p>\n<p><span style=\"color: #ff0000;\">initrd \/initrd.img<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Selects the latest initrd image.<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If the initrd symlink does not exist in \/, use the full path to the initrd image in \/boot<\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">If successful, after ENTER there will be a slight delay and no messages.<\/p>\n<p>\n<\/p>\n<p><span style=\"color: #ff0000;\">boot<\/span><\/p>\n<p>\n<\/p>\n<p class=\"wp-block-paragraph\">Boot to the latest kernel on the selected partition.<\/p>\n<p>In the worst case, you may need to re-install grub via a working system, say a bootable USB drive then find the drive with the broken grub menu (say \/dev\/sda) and:<\/p>\n<p><span style=\"color: #0000ff;\">sudo grub-install.real \/dev\/sda<\/span><\/p>\n<p>Then:<\/p>\n<p><span style=\"color: #0000ff;\">sudo update-grub2<\/span><\/p>\n<p>This will allow the USB pen drive to boot the broken drive from the USB pen grub menu. When back in the prior broken system if it boots OK, remove the USB pen drive and re-run:<\/p>\n<p><span style=\"color: #0000ff;\">sudo update-grub2<\/span><\/p>\n<p>You should now be able to reboot into this drive as the only drive on a system.<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8583\" class=\"pvc_stats all  \" data-element-id=\"8583\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>At the failed grub boot prompt you can assume the the non booting drive is \/dev\/sda1 to start and see if the insmod files are found:\u00a0 set prefix=(hdX,Y)\/boot\/grub Or use the values determined by attaching the drive to a working linux install to find the partition order: sudo fdisk -lDisk \/dev\/sda: 119.2 GiB, 128035676160 bytes, <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/grub-rescue-2\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Rescue Your System from an MBR corruption? grub rescue&gt;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8583","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"a3_pvc":{"activated":true,"total_views":2,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=8583"}],"version-history":[{"count":0,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8583\/revisions"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=8583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=8583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=8583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}