{"id":272512,"date":"2023-05-17T20:17:21","date_gmt":"2023-05-17T12:17:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/lxtmrqdnhdqd.html"},"modified":"2023-05-17T20:17:21","modified_gmt":"2023-05-17T12:17:21","slug":"lxtmrqdnhdqd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxtmrqdnhdqd.html","title":{"rendered":"Linux\u7cfb\u7edf\u9ed8\u8ba4\u542f\u52a8\u5185\u6838\u7684\u542f\u52a8\u65b9\u5f0f\u5982\u4f55\u4fee\u6539\uff1f"},"content":{"rendered":"

\u67e5\u770b\u9ed8\u8ba4\u542f\u52a8\u5185\u6838<\/p>\n

\u8fd9\u662f\u4e00\u4e2a\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\u4f7f\u7528\u7684\u547d\u4ee4<\/a>\u884c\uff0c\u7528\u6237\u901a\u8fc7\u8be5\u547d\u4ee4\u884c\u67e5\u770b\u5e76\u7f16\u8f91GRUB2\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\u73af\u5883\u53d8\u91cf<\/a>\u3002\u5177\u4f53\u6db5\u4e49\u5982\u4e0b\uff1a<\/p>\n

\u5217\u4e3e\u7cfb\u7edf\u4e2d\u6709\u7684\u5185\u6838<\/p>\n

menuentry\u5c31\u662f\u542f\u52a8\u7684\u5165\u53e3<\/p>\n

\u4f9d\u636e\u5217\u4e0b\u6765\u7684\u5185\u5bb9\u53ef\u4ee5\u5e94\u5f53\u4e0d\u662fBISO\u542f\u52a8\u5f15\u5bfc\uff0c\u6709\u53ef\u80fd\u662fUEFI<\/p>\n

\u914d\u7f6e\u6587\u4ef6\u8bf4\u660e<\/p>\n

linux\u67e5\u770b\u7cfb\u7edf\u7248\u672c_linux\u5982\u4f55\u67e5\u770b\u7cfb\u7edf\u7248\u672c\u4fe1\u606f_linux\u67e5\u770b\u7cfb\u7edf\u7248\u672c\u547d\u4ee4<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0cGRUB\uff08GNUGRandUnifiedBootloader\uff09\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u5f15\u5bfc\u7a0b\u5e8f\uff0c\u7528\u4e8e\u52a0\u8f7d\u64cd\u4f5c\u7cfb\u7edf\u3002GRUB\u63d0\u4f9b\u4e86\u591a\u79cd\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u62ec\uff1a<\/p>\n

\u56e0\u800c\uff0c\/boot\/grub2\/grub.cfg\u548c\/boot\/grub2\/grub2-efi.cfg\u90fd\u662fGRUB\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f46\u5206\u522b\u7528\u4e8eBIOS\u548cUEFI\u7cfb\u7edf\u7684\u5f15\u5bfc\u3002\u5018\u82e5\u60a8\u7684\u7cfb\u7edf\u662fBIOS\u5f15\u5bfc\u6a21\u5f0f\uff0c\u5219GRUB\u5c06\u4f7f\u7528\/boot\/grub2\/grub.cfg\u6587\u4ef6\uff1b\u5047\u5982\u662fUEFI\u5f15\u5bfc\u6a21\u5f0f\uff0c\u5219GRUB\u5c06\u4f7f\u7528\/boot\/grub2\/grub2-efi.cfg\u6587\u4ef6\u3002<\/p>\n

\u5224\u5b9a\u662fBIOS\u8fd8\u662fUEFI\u542f\u52a8<\/p>\n

\u8981\u786e\u5b9a\u7cfb\u7edf\u662f\u4f7f\u7528UEFI\u8fd8\u662fBIOS\u5f15\u5bfc\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

$ ls \/sys\/firmware\/efi\n<\/code><\/pre>\n<\/p>\n

\u5047\u5982\u8be5\u547d\u4ee4\u8fd4\u56de\u4e86\u76ee\u5f55\u5217\u8868\uff0c\u5219\u8bf4\u660e\u7cfb\u7edf\u662f\u4f7f\u7528UEFI\u5f15\u5bfc\u7684\u3002\u5047\u5982\u8be5\u547d\u4ee4\u8fd4\u56de\u201cNosuchfileordirectory\u201d\u6216\u7c7b\u4f3c\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u5219\u8bf4\u660e\u7cfb\u7edf\u662f\u4f7f\u7528BIOS\u5f15\u5bfc\u7684\u3002<\/p>\n

\u53e6\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u67e5\u770b\u7cfb\u7edf\u7684\u786c\u4ef6\u4fe1\u606flinux\u547d\u4ee4\u884c\uff0c\u6765\u786e\u5b9a\u7cfb\u7edf\u662f\u4f7f\u7528UEFI\u8fd8\u662fBIOS\u5f15\u5bfc\u3002\u5018\u82e5\u60a8\u7684\u8ba1\u7b97\u673a\u662f\u65b0\u7684\uff0c\u5219\u5f88\u53ef\u80fd\u662f\u4f7f\u7528UEFI\u5f15\u5bfc\u7684\uff1b\u5018\u82e5\u60a8\u7684\u8ba1\u7b97\u673a\u6bd4\u8f83\u8001\uff0c\u5219\u5f88\u53ef\u80fd\u662f\u4f7f\u7528BIOS\u5f15\u5bfc\u7684\u3002<\/p>\n

UEFI\u7684\u542f\u52a8\u65b9\u6cd5\u600e\u4e48\u66f4\u6539<\/p>\n

\u5f53\u4f60\u53d1\u89c9\u914d\u7f6e\u6587\u4ef6\u4e2d\u662f\u8fd9\u6837\u7684\u65f6\u4faf\u5c31\u987b\u8981\u5c06next-entry\u66f4\u6539\u4e3a1\u6216\u5219\u4f60\u8981\u7684\u90a3\u79cd\u7f16\u53f7\uff0c\u7f16\u53f7\u5728\u542f\u52a8\u7684\u65f6\u4faf\u80fd\u770b\u89c1\u6b21\u5e8f\uff0c\u6839\u636e\u6b21\u5e8f\u4ece0\u5f00\u59cb\u7f16\u53f7\uff0c<\/p>\n

\u89e3\u91ca\u53c2\u6570<\/p>\n

GRUB\u7684next_entry\u53d8\u91cf\u662f\u5728GRUB\u7684\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u7684\u3002\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0blinux\u67e5\u770b\u7cfb\u7edf\u7248\u672c<\/strong>\uff0c\u8be5\u6587\u4ef6\u5750\u843d\/boot\/grub2\/grubenv\u3002<\/p>\n

\u5f53\u60a8\u5728GRUB\u83dc\u5355\u4e2d\u9009\u62e9\u4e00\u4e2a\u4e0d\u540c\u7684\u542f\u52a8\u9879\u65f6\uff0cGRUB\u4f1a\u5c06\u9009\u62e9\u7684\u542f\u52a8\u9879\u7684\u7f16\u53f7\u50a8\u5b58\u5728next_entry\u53d8\u91cf\u4e2d\u3002\u4e4b\u540elinux vi\u547d\u4ee4\uff0c\u5f53\u8ba1\u7b97\u673a\u91cd\u65b0\u542f\u52a8\u65f6\uff0cGRUB\u5c06\u624b\u52a8\u52a0\u8f7d\u8be5\u53d8\u91cf\uff0c\u5e76\u4f7f\u7528setdefault=\"${next_entry}\"\u547d\u4ee4\u5c06\u9ed8\u8ba4\u542f\u52a8\u9879\u8bbe\u7f6e\u4e3a\u8be5\u53d8\u91cf\u6240\u50a8\u5b58\u7684\u542f\u52a8\u9879\u7f16\u53f7\u3002<\/p>\n

\u7136\u800c\uff0c\u5047\u82e5\u60a8\u60f3\u8981\u8fd8\u539f\u4e3a\u9ed8\u8ba4\u7684setdefault=\"${next_entry}\"\uff0c\u60a8\u987b\u8981\u5c06setdefault=1\u6539\u4e3asetdefault=\"${next_entry}\"\u3002\u66f4\u6539\u540e\uff0c\u8be5if\u5757\u4e2d\u7684\u5185\u5bb9\u5c06\u4f1a\u6839\u636e\u9ed8\u8ba4\u884c\u4e3a\u6267\u884c\u3002<\/p>\n

\u4e5f\u53ef\u4ee5\u76f4\u63a5\u66f4\u6539\u53c2\u6570\uff0c\u5e76\u4e14\u4e3b\u8981UUID\u503c<\/p>\n

\u5e76\u4e14\u4e0d\u5efa\u8bae\u76f4\u63a5\u66f4\u6539\/boot\/grub2\/grubenv\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\uff0c\u7531\u4e8e\u8be5\u6587\u4ef6\u5305\u542bGRUB\u7684\u73af\u5883\u53d8\u91cf\uff0c\u800c\u4e0d\u662fGRUB\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5047\u82e5\u60a8\u76f4\u63a5\u66f4\u6539\u8be5\u6587\u4ef6\uff0c\u53ef\u80fd\u4f1a\u9020\u6210GRUB\u5f15\u5bfc\u5931\u8d25\u3002<\/p>\n

\u5047\u5982\u60f3\u8981\u66f4\u6539\u9ed8\u8ba4\u542f\u52a8\u9879\uff0c\u53ef\u4ee5\u6839\u636e\u4e0a\u9762\u7684\u56de\u7b54\u66f4\u6539GRUB\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5047\u5982\u60f3\u8981\u66f4\u6539\u5185\u6838\u542f\u52a8\u53c2\u6570\uff0c\u53ef\u4ee5\u6839\u636e\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a<\/p>\n

\u6253\u5f00GRUB\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\n

sudo vi \/etc\/default\/grub\n<\/code><\/pre>\n<\/p>\n

\u627e\u5230GRUB_CMDLINE_LINUX\u53d8\u91cf\uff0c\u5e76\u5728\u5176\u524d\u9762\u6dfb\u52a0\u60a8\u60f3\u8981\u7684\u5185\u6838\u542f\u52a8\u53c2\u6570\u3002\u8bf8\u5982\uff0c\u5047\u5982\u60f3\u8981\u6dfb\u52a0nomodeset\u53c2\u6570\uff0c\u5219\u5c06\u8be5\u53d8\u91cf\u66f4\u6539\u4e3a\uff1a<\/p>\n

\n

GRUB_CMDLINE_LINUX=\"rhgb quiet nomodeset\"\n<\/code><\/pre>\n<\/p>\n

\u4fdd\u5b58\u6587\u4ef6\u5e76\u9000\u51fa\u7f16\u8f91\u5668\u3002<\/p>\n

\u66f4\u65b0GRUB\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\n

sudo grub2-mkconfig -o \/boot\/grub2\/grub.cfg\n<\/code><\/pre>\n<\/p>\n

\u8be5\u547d\u4ee4\u5c06\u4f1a\u91cd\u65b0\u751f\u6210GRUB\u7684\u914d\u7f6e\u6587\u4ef6linux\u67e5\u770b\u7cfb\u7edf\u7248\u672c<\/strong>\uff0c\u5e76\u5305\u542b\u6240\u6dfb\u52a0\u7684\u5185\u6838\u542f\u52a8\u53c2\u6570\u3002<\/p>\n

linux\u67e5\u770b\u7cfb\u7edf\u7248\u672c_linux\u67e5\u770b\u7cfb\u7edf\u7248\u672c\u547d\u4ee4_linux\u5982\u4f55\u67e5\u770b\u7cfb\u7edf\u7248\u672c\u4fe1\u606f<\/p>\n

\u91cd\u542f\u8ba1\u7b97\u673a\uff0c\u5c06\u89c1\u5230\u5185\u6838\u542f\u52a8\u53c2\u6570\u65e9\u5df2\u88ab\u66f4\u6539\u4e3a\u60a8\u6240\u6dfb\u52a0\u7684\u53c2\u6570\u3002<\/p>\n

\u8bf7\u6ce8\u610f\uff0c\u5728\u7f16\u8f91GRUB\u7684\u914d\u7f6e\u6587\u4ef6\u4e4b\u524d\uff0c\u8bf7\u52a1\u5fc5\u5907\u4efd\u8be5\u6587\u4ef6\uff0c\u4ee5\u9632\u51fa\u73b0\u610f\u5916\u60c5\u51b5\u3002<\/p>\n

\u53e6\u5916\u4e00\u79cd\u5f62\u5f0f<\/p>\n

\u6211\u7684\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u4e2d\u6ca1\u6709next_enty\u53d8\u91cf\uff0c\u6240\u4ee5\u6211\u76f4\u63a5\u66f4\u6539else\u5206\u652f<\/p>\n

\u8fd9\u4e2a\u6587\u4ef6\u662f\u5728\/etc\/default\/grub\u8fd9\u4e2a\u624b\u52a8\u751f\u6210\u7684\uff0c\u66f4\u6539\u8fd9\u513fetc\/default\/grub<\/p>\n

\u4fdd\u5b58\u4fee\u6539\u540e\uff0c\u8fd0\u884c\u4ee5\u66f4\u65b0GRUB\u914d\u7f6e\u6587\u4ef6\uff1asudogrub2-mkconfig-o\/boot\/efi\/EFI\/fedora\/grub.cfg\uff08\u8bf7\u4f9d\u7167\u7cfb\u7edf\u548c\u53d1\u884c\u7248\u81ea\u884c\u66ff\u6362\u8def\u5f84\uff09<\/p>\n

\u91cd\u542f\u8ba1\u7b97\u673a\u5e76\u67e5\u770b\u662f\u5426\u6210\u529f\u4f7f\u7528\u4e86\u6307\u5b9a\u7684\u5185\u6838\u7248\u672c<\/p>\n","protected":false},"excerpt":{"rendered":"

\u67e5\u770b\u9ed8\u8ba4\u542f\u52a8\u5185\u6838\u8fd9\u662f\u4e00\u4e2a\u5728Linux\u7cfb\u7edf\u4e2d\u4f7f\u7528\u7684\u547d\u4ee4\u884c\uff0c\u7528\u6237\u901a\u8fc7\u8be5\u547d\u4ee4\u884c\u67e5\u770b\u5e76\u7f16\u8f91GRUB2\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\u73af\u5883\u53d8\u91cf\u3002\u90fd\u662fGRUB\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f46\u5206\u522b\u7528\u4e8eBIOS\u548cUEFI\u7cfb\u7edf\u7684\u5f15\u5bfc\u3002\u5982\u679c\u60f3\u8981\u4fee\u6539\u5185\u6838\u542f\u52a8\u53c2\u6570\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\uff1a\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5305\u542b\u6240\u6dfb\u52a0\u7684\u5185\u6838\u542f\u52a8\u53c2\u6570\u3002\u91cd\u542f\u8ba1\u7b97\u673a\uff0c\u5c06\u770b\u5230\u5185\u6838\u542f\u52a8\u53c2\u6570\u5df2\u7ecf\u88ab\u4fee\u6539\u4e3a\u60a8\u6240\u6dfb\u52a0\u7684\u53c2\u6570\u3002\u91cd\u542f\u8ba1\u7b97\u673a\u5e76\u67e5\u770b\u662f\u5426\u6210\u529f\u4f7f\u7528\u4e86\u6307\u5b9a\u7684\u5185\u6838\u7248\u672c<\/p>\n","protected":false},"author":1,"featured_media":272513,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-272512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/272512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=272512"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/272512\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/272513"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=272512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=272512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=272512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}