{"id":684,"date":"2010-12-15T01:29:34","date_gmt":"2010-12-14T17:29:34","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=684"},"modified":"2012-09-24T11:14:30","modified_gmt":"2012-09-24T03:14:30","slug":"ubuntu-grub2-repair","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=684","title":{"rendered":"Ubuntu Grub2 \u4fee\u590dGrub2\u65b9\u6cd5"},"content":{"rendered":"<p>Recover Grub 2 via LiveCD<\/p>\n<p>    *<\/p>\n<p>      First, grab a copy of the latest Ubuntu LiveCD and boot it.<br \/>\n    * Open a terminal and type<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-quick recovery begin&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n# $ sudo fdisk -l<br \/>\n# $ sudo mount \/dev\/sda1 \/mnt ##\u6ce8\u610f\u4f7f\u7528 \u4f60\u7684 root\u5206\u533a\u6240\u5728\u7684\u4f4d\u7f6e\uff0c\u4e5f\u5c31\u662f \/ \u6240\u5728\u7684\u5206\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528 Ubuntu\u81ea\u5e26\u7684\u78c1\u76d8\u5b9e\u7528\u5de5\u5177\u67e5\u770b<br \/>\n# $ sudo mount \/dev\/sda2 \/mnt\/boot ##\u5982\u679c\u6709\u4e13\u7528\u7684\u542f\u52a8\u5206\u533a\u7684\u8bdd \u6302\u8f7d\u5b83<br \/>\n# $ sudo mount &#8211;bind \/dev \/mnt\/dev #\u8fd93\u4e2a \u6bd4\u8f83\u5fc5\u8981\uff0c\u53c2\u6570\u4e0d\u7528\u6539<br \/>\n$ sudo mount &#8211;bind \/proc \/mnt\/proc<br \/>\n$ sudo mount &#8211;bind \/sys \/mnt\/sys<br \/>\n# $ sudo chroot \/mnt<br \/>\n# # update-grub #\u5df2\u7ecf\u662froot\u4e86<br \/>\n# # grub-install &#8211;recheck \/dev\/sda #\u4e00\u822c\u4e00\u5757\u786c\u76d8\u7684\u8bdd\uff0c\u4e0d\u7528\u6539\u4e86<br \/>\n# # reboot #\u91cd\u542f \u5c31\u53ef\u4ee5\u4e86 <\/p>\n<p>Restore GRUB2 &#8211; Recovering from a Windows XP \/ Vista \/ 7 Reinstallation<\/p>\n<p>Fire up a terminal from the Live CD for Ubuntu 10.04.<br \/>\n$ sudo fdisk -l (Note the partition number on which Linux resides)<br \/>\n$ sudo mount \/dev\/sdaX \/mnt (Replace X with the partition number housing Linux)<br \/>\n$ sudo grub-install &#8211;root-directory=\/mnt\/ \/dev\/sda<br \/>\n$ sudo update-grub<br \/>\n$ sudo reboot<\/p>\n<p>Credits to<br \/>\nhttp:\/\/mundogeek.net\/archivos\/2009\/12\/08\/recuperar-grub-2\/ for the enlightening post &#038;<br \/>\nhttp:\/\/www.webupd8.org\/2009\/12\/how-to-recover-grub2-linux.html for the awesome translation.<\/p>\n<p>\u91cd\u70b9\u63a8\u8350 Ubuntu Grub2 \u5b8c\u5168\u624b\u518c\uff1ahttps:\/\/help.ubuntu.com\/community\/Grub2#Reinstalling%20GRUB%202<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recover Grub 2 via LiveCD * First, grab a copy of the latest Ubuntu LiveCD and boot it. * Open a terminal and type # &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-quick recovery begin&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; # $ sudo fdisk -l # $ sudo mount \/dev\/sda1 \/mnt ##\u6ce8\u610f\u4f7f\u7528 \u4f60\u7684 root\u5206\u533a\u6240\u5728\u7684\u4f4d\u7f6e\uff0c\u4e5f\u5c31\u662f \/ \u6240\u5728\u7684\u5206\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528 Ubuntu\u81ea\u5e26\u7684\u78c1\u76d8\u5b9e\u7528\u5de5\u5177\u67e5\u770b # $ sudo mount \/dev\/sda2 \/mnt\/boot ##\u5982\u679c\u6709\u4e13\u7528\u7684\u542f\u52a8\u5206\u533a\u7684\u8bdd \u6302\u8f7d\u5b83 # $ [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-684","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=684"}],"version-history":[{"count":3,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/684\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}