{"id":3310,"date":"2015-12-03T10:33:21","date_gmt":"2015-12-03T10:33:21","guid":{"rendered":"https:\/\/unihost.com\/help\/?p=3310"},"modified":"2023-01-19T13:59:47","modified_gmt":"2023-01-19T10:59:47","slug":"how-to-restore-grub-bootloader","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/","title":{"rendered":"How to restore grub bootloader"},"content":{"rendered":"<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">To restore grub bootloader you should boot the system using Live CD or Rescue mode the same operating system and architecture. For Example, Debian.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Plug-in downloaded ISO and select boot from the disk<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\"><\/p>\n<p>After booting from the Debian LiveCD do all the settings on behalf of the superuser (root) or via sudo program. All the restoration procedure is carried out with superuser rights.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Enter the system and type: <\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">sudo -s<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">First find out the sections of the system directories. Get the full list of the sections via fdisk<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">fdisk -l<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Mount the section with the system directories (e.g.,\/dev\/sda2) to the dedicated directory (e.g., \/mnt). <\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">mount \/dev\/sda2 \/mnt<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Using ls \/mnt command look through the whole list of the directories of the \/dev\/sda2 section to make sure you are in the right section.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">ls \/mnt<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">If you have mounted the section correctly ls command will show you these directories: \/sys, \/proc, \/dev and others<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Depending on the damage and problems we will use Debian LiveCD system  files instead of those that are on the disk. We are going to create synonym files or entire directories to restore grub2. For correct work use \/sys, \/proc and \/dev from a Debian liveCD:<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">mount &#8211;bind \/dev \/mnt\/dev<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">mount &#8211;bind \/sys \/mnt\/sys<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">mount &#8211;bind \/proc \/mnt\/proc<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">mount &#8211;bind \/dev \/mnt\/dev &#8211; indicates that \/dev files are available at the synonymous address \/mnt\/dev<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Restart the system (from the hard drive):<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">chroot \/mnt<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">The system believes that \/mnt is its root directory.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">This method can be applicable when testing. Copy system files into a separate directory, switch back there via the chroot, test and, if everything works correctly, copy the modified files to the original, but if something goes wrong, it is possible to reset settings very quickly and not hurt the server.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">If grub2 has been already installed you may upgrade it, if no, set it up in the section like in common Debian (Linux).<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Grub bootloader update:<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\"> update-grub<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Installation:<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">grub-install<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: Ubuntu, sans-serif;\">Now you can start system in normal mode. <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To restore grub bootloader you should boot the system using Live CD or Rescue mode the same operating system and architecture. For Example, Debian. Plug-in downloaded ISO and select boot from the disk After booting from the Debian LiveCD do all the settings on behalf of the superuser (root) or via sudo program. All the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[301],"class_list":["post-3310","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers","tag-grub-bootloader"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to restore grub bootloader - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to restore grub bootloader - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-03T10:33:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T10:59:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png\" \/>\n\t<meta property=\"og:image:width\" content=\"250\" \/>\n\t<meta property=\"og:image:height\" content=\"141\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"How to restore grub bootloader\",\"datePublished\":\"2015-12-03T10:33:21+00:00\",\"dateModified\":\"2023-01-19T10:59:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\"},\"wordCount\":349,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"keywords\":[\"grub bootloader\"],\"articleSection\":[\"02. Dedicated servers\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\",\"url\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\",\"name\":\"How to restore grub bootloader - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"datePublished\":\"2015-12-03T10:33:21+00:00\",\"dateModified\":\"2023-01-19T10:59:47+00:00\",\"description\":\"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to restore grub bootloader\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to restore grub bootloader - Unihost.FAQ","description":"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/","og_locale":"en_US","og_type":"article","og_title":"How to restore grub bootloader - Unihost.FAQ","og_description":"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.","og_url":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2015-12-03T10:33:21+00:00","article_modified_time":"2023-01-19T10:59:47+00:00","og_image":[{"width":250,"height":141,"url":"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png","type":"image\/png"}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"How to restore grub bootloader","datePublished":"2015-12-03T10:33:21+00:00","dateModified":"2023-01-19T10:59:47+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/"},"wordCount":349,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"keywords":["grub bootloader"],"articleSection":["02. Dedicated servers"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/","url":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/","name":"How to restore grub bootloader - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"datePublished":"2015-12-03T10:33:21+00:00","dateModified":"2023-01-19T10:59:47+00:00","description":"How to restore grub bootloader: a step by step tutorial. Commands for grub update and installation.","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/how-to-restore-grub-bootloader\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"How to restore grub bootloader"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/3310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=3310"}],"version-history":[{"count":4,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/3310\/revisions"}],"predecessor-version":[{"id":7020,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/3310\/revisions\/7020"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=3310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=3310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=3310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}