{"id":855,"date":"2011-12-18T16:26:06","date_gmt":"2011-12-18T08:26:06","guid":{"rendered":"https:\/\/blog.rexdf.org\/?p=855"},"modified":"2011-12-18T16:26:06","modified_gmt":"2011-12-18T08:26:06","slug":"grub-rescue%e5%87%a0%e7%a7%8d%e4%bf%ae%e5%a4%8d%e6%96%b9%e6%b3%95%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/blog.rexdf.org\/ja\/2011\/12\/grub-rescue%e5%87%a0%e7%a7%8d%e4%bf%ae%e5%a4%8d%e6%96%b9%e6%b3%95%e5%ae%9e%e7%8e%b0\/","title":{"rendered":"Grub Rescue\u51e0\u79cd\u4fee\u590d\u65b9\u6cd5\u5b9e\u73b0"},"content":{"rendered":"<p>Grub2\u51e0\u79cd\u4fee\u590d\u65b9\u6cd5<\/p>\n<p><strong>1. Grub Rescue\u53cc\u7cfb\u7edf\u91cd\u88c5windows\u9020\u6210grub2\u88ab\u6539\u5199\u7684\u4fee\u590d<br \/>\n<\/strong>\u65b9\u6cd5\u4e00 grub4dos0.4.4<br \/>\n\u5728Windows\u542f\u52a8\u9879\u4e0a\u52a0\u4e0agrub4dos\u542f\u52a8\uff08\u4e0d\u591a\u8bf4\u4e86\uff0c\u770b\u7f6e\u9876\u8d34\uff09\uff0c\u91cd\u542f\u9009\u62e9\u8fdb\u5165grub\uff0c\u5728\u547d\u4ee4\u884c\u4e0b\u8f93\u5165(\/boot\u5355\u72ec\u5206\u533a\u7684\u53bb\u6389 \/boot)<br \/>\n\u4ee3\u7801:<br \/>\ngrub&gt;find &#8211;set-root \/boot\/grub\/core.img<br \/>\ngrub&gt;kernel \/boot\/grub\/core.img<br \/>\ngrub&gt;boot<\/p>\n<p>\u8fdb\u5165grub2\u83dc\u5355\uff0c\u8fdb\u5165\u7cfb\u7edf\u540e\u518d\u6267\u884c\u4ee3\u7801:<br \/>\nsudo grub-install \/dev\/sd\uff1f<\/p>\n<p>\u65b9\u6cd5\u4e8c Grub Rescue\u8fdb\u5165Livecd \u540e\u4fee\u590d\u5f15\u7528:<br \/>\nsudo -i<br \/>\nmount \u4f60\u7684\u6839\u5206\u533a \/mnt<br \/>\nmount \u4f60\u7684\/boot \u5206\u533a \/mnt\/boot #\u5982\u679c\u6709\u7684\u8bdd<br \/>\n#\u6302\u8f7d\u4f60\u5176\u4ed6\u7684\u5206\u533a\uff0c\u5982\u679c\u6709\u7684\u8bdd<br \/>\n# \u91cd\u5efagrub\u5230sda\u7684mbr<br \/>\ngrub-install &#8211;root-directory=\/mnt \/dev\/sda<br \/>\n<strong>2. \u7531\u4e8eroot\u5206\u533auuid\u6539\u53d8\u9020\u6210\u7684\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8\uff0c\u53ea\u80fd\u8fdb\u5165grub rescue\u6a21\u5f0f\u7684\u4fee\u590d\u4ee3\u7801:<\/strong><br \/>\ngrub rescue&gt;set<br \/>\ngrub rescue&gt;prefix=(hd\uff1f,\uff1f)\/grub<br \/>\ngrub rescue&gt;root=hd\uff1f,\uff1f<br \/>\ngrub rescue&gt;set root=hd\uff1f,\uff1f<br \/>\ngrub rescue&gt;set prefix=(hd\uff1f,\uff1f)\/boot\/grub<br \/>\ngrub rescue&gt;set<br \/>\ngrub rescue&gt;root=hd\uff1f,\uff1f<br \/>\ngrub rescue&gt;prefix=(hd\uff1f,\uff1f)\/boot\/grub<br \/>\ngrub rescue&gt;insmod \/boot\/grub\/normal.mod<br \/>\ngrub rescue&gt;normal<\/p>\n<p>\u8fd9\u65f6\u5c31\u53ef\u4ee5\u8c03\u51fa \/boot\/grub\/grub.cfg\uff0c\u4fee\u6539\u76f8\u5e94uuid\uff0c<br \/>\n\u6539\u5230\u547d\u4ee4\u884c\u4e0b<br \/>\ngrub&gt;insmod \/boot\/grub\/linux.mod<br \/>\ngrub&gt;set root=hd\uff1f,\uff1f<br \/>\ngrub&gt;linux \/boot\/vmlinuz-*** root=\/dev\/sd\uff1f\uff1f<br \/>\ngrub&gt;initrd \/boot\/initrg.img-****<br \/>\n\u8fdb\u5165\u7cfb\u7edf<br \/>\nhd\uff1f,\uff1f \u662fgrub\u6587\u4ef6\u6240\u5728\u5206\u533a sda\uff1f \u662f\/\u5206\u533a\u3002<\/p>\n<p><strong>3. Grub Rescuegrub\u6a21\u5757\u548c\u914d\u7f6e\u6587\u4ef6grub.cfg\u53d7\u635f\u65e0\u6cd5\u542f\u52a8\u65f6\u4fee\u590d<\/strong><br \/>\nLivcd\u542f\u52a8\u8fdb\u5165\u8bd5\u7528\u5f15\u7528:<br \/>\nsudo -i<br \/>\nmount \u4f60\u7684\u6839\u5206\u533a \/mnt<br \/>\nmount \u4f60\u7684\/boot \u5206\u533a \/mnt\/boot #\u5982\u679c\u6709\u7684\u8bdd<br \/>\n# \u6302\u8f7d\u4f60\u5176\u4ed6\u7684\u5206\u533a\uff0c\u5982\u679c\u6709\u7684\u8bdd<br \/>\n# \u91cd\u5efagrub\u5230sda\u7684mbr<br \/>\ngrub-install &#8211;root-directory=\/mnt \/dev\/sda<br \/>\n# \u91cd\u5efagrub.cfg<br \/>\nmount &#8211;bind \/proc \/mnt\/proc<br \/>\nmount &#8211;bind \/dev \/mnt\/dev<br \/>\nmount &#8211;bind \/sys \/mnt\/sys<br \/>\nchroot \/mnt update-grub<br \/>\numount \/mnt\/sys<br \/>\numount \/mnt\/dev<\/p>\n<p>umount \/mnt\/proc<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Grub2\u51e0\u79cd\u4fee\u590d\u65b9\u6cd5 1. Grub Rescue\u53cc\u7cfb\u7edf\u91cd\u88c5windows\u9020\u6210 &hellip; <a href=\"https:\/\/blog.rexdf.org\/ja\/2011\/12\/grub-rescue%e5%87%a0%e7%a7%8d%e4%bf%ae%e5%a4%8d%e6%96%b9%e6%b3%95%e5%ae%9e%e7%8e%b0\/\">\u7d9a\u304d\u3092\u8aad\u3080 <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":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[17],"tags":[47],"class_list":["post-855","post","type-post","status-publish","format-standard","hentry","category-compter","tag-linux"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts\/855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/comments?post=855"}],"version-history":[{"count":0,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rexdf.org\/ja\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}