{"id":6135044,"date":"2017-08-24T11:38:47","date_gmt":"2017-08-24T03:38:47","guid":{"rendered":"http:\/\/longxi.me\/?p=6135044"},"modified":"2019-07-21T00:31:41","modified_gmt":"2019-07-20T16:31:41","slug":"debian-8-grub2-%e8%87%aa%e5%ae%9a%e4%b9%89%e9%bb%98%e8%ae%a4%e5%90%af%e5%8a%a8%e5%86%85%e6%a0%b8","status":"publish","type":"post","link":"https:\/\/longxi.me\/?p=6135044","title":{"rendered":"Debian 8 GRUB2 \u81ea\u5b9a\u4e49\u9ed8\u8ba4\u542f\u52a8\u5185\u6838"},"content":{"rendered":"<p>\u53c2\u8003\u94fe\u63a5\uff1a<a href=\"http:\/\/www.linuxquestions.org\/questions\/slackware-14\/grub2-change-default-to-custom-kernel-4175547962\/#post5391277\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.linuxquestions.org\/questions\/slackware-14\/grub2-change-default-to-custom-kernel-4175547962\/#post5391277<\/a><\/p>\n<h2>\u603b\u7ed3\uff1a<\/h2>\n<p>1\u3001\u7f16\u8f91 \/etc\/default\/grub<\/p>\n<blockquote>\n<pre>GRUB_DEFAULT=saved<\/pre>\n<\/blockquote>\n<p>2\u3001\u67e5\u770b\u6240\u6709\u542f\u52a8\u83dc\u5355\u5165\u53e3<\/p>\n<blockquote>\n<pre>grep \"submenu\\|^\\smenuentry\" \/boot\/grub\/grub.cfg | cut -d \"'\" -f2,4<\/pre>\n<\/blockquote>\n<p>\u8f93\u51fa\u683c\u5f0f\u4e3a\uff1a\u6807\u9898&#8217;ID \uff08\u4e2d\u95f4\u4ee5 &#8216; \u53f7\u95f4\u9694\uff09<\/p>\n<p>\u7ed3\u679c\u4e2d\u542b\u201cAdvanced options\u201d\u7684\u4e00\u884c\u662f submenu \uff0c\u5e95\u4e0b\u7d27\u8ddf\u7684\u884c\u662f menuentry\u3002<\/p>\n<p>3\u3001\u8bbe\u7f6e\u9ed8\u8ba4\u542f\u52a8\u83dc\u5355\uff08\u5185\u6838\uff09\uff0c\u4f7f\u7528\u6b65\u9aa42\u4e2d\u7684 ID \u800c\u975e\u6807\u9898<\/p>\n<blockquote>\n<pre>#grub-set-default\u00a0 \"(submenu ID)&gt;(menuentry ID)\"<\/pre>\n<\/blockquote>\n<p>4\u3001\u91cd\u65b0\u751f\u6210 \/boot\/grub\/grub.cfg<\/p>\n<blockquote>\n<pre>#grub-mkconfig -o \/boot\/grub\/grub.cfg<\/pre>\n<\/blockquote>\n<p><!--more--><\/p>\n<p>\u539f\u6587\u6458\u8981\uff1a<br \/>\n<strong>GRUB2 change default to custom kernel<\/strong><\/p>\n<p>I have made the switch from LILO to GRUB2 on all my Slackware boxes. Still learning all the ins and outs. I am running into an issue though when I want to change the default kernel to a custom compiled on. No matter what I do, the changes won&#8217;t take. Has anyone been successful in doing so? I have tried playing around with changing GRUB_DEFAULT=saved to GRUB_DEFAULT=2 and even using the actual title, but no success. I&#8217;ve also tried this:<br \/>\nCode:<\/p>\n<p>Open \/etc\/default\/grub and ensure this line exists:<\/p>\n<p>GRUB_DEFAULT=saved<br \/>\nApply the change to grub.cfg by running:<\/p>\n<p>grub-mkconfig -o \/boot\/grub\/grub.cfg<br \/>\nNow list all possible menu entries<\/p>\n<p>grep &#8220;submenu\\|^\\smenuentry&#8221; \/boot\/grub\/grub.cfg | cut -d &#8220;&#8216;&#8221; -f2<br \/>\nNow set the desired default menu entry<\/p>\n<p>grub-set-default &#8220;&lt;submenu title&gt;&gt;&lt;menu entry title&gt;&#8221;<br \/>\nVerify the default menu entry<\/p>\n<p>grub-editenv list<\/p>\n<p>Which I modified from this link. Still no luck.<\/p>\n<p>Any help would be appreciated.<\/p>\n<p>Old 07-14-2015, 12:09 PM #2<br \/>\nstormtracknole<br \/>\nMember<\/p>\n<p>Registered: Aug 2005<br \/>\nLocation: The Big Easy<br \/>\nDistribution: Slackware, RHEL<br \/>\nPosts: 927<\/p>\n<p>Original Poster<br \/>\nRep: Reputation: 114Reputation: 114<\/p>\n<p>Figured it out! For GRUB_DEFAULT, I was using:<br \/>\nCode:<\/p>\n<p>GRUB_DEFAULT=&#8221;Slackware-14.1 GNU\/Linux, with Linux 3.18.18-local&#8221;<\/p>\n<p>However, upon running grub-mkconfig -o \/boot\/grub\/grub.cfg, I was instructed to use this instead:<br \/>\nCode:<\/p>\n<p>GRUB_DEFAULT=&#8221;gnulinux-advanced-e246d5eb-623e-4518-ae21-96df0820c0c3&gt;gnulinux-3.18.18-local-advanced-e246d5eb-623e-4518-ae21-96df0820c0c3&#8243;<\/p>\n<p>I&#8217;m sure this code will be different depending on the kernel version used and probably other factors. I ran the grub-mkconfig command again, and this time, the correct kernel was loaded. Marking this thread as solved. Hopefully it can be of help to others.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u94fe\u63a5\uff1ahttp:\/\/www.linuxquestions.org\/questions\/slackware- &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/longxi.me\/?p=6135044\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cDebian 8 GRUB2 \u81ea\u5b9a\u4e49\u9ed8\u8ba4\u542f\u52a8\u5185\u6838\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[14,13],"_links":{"self":[{"href":"https:\/\/longxi.me\/index.php?rest_route=\/wp\/v2\/posts\/6135044"}],"collection":[{"href":"https:\/\/longxi.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/longxi.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/longxi.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/longxi.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6135044"}],"version-history":[{"count":0,"href":"https:\/\/longxi.me\/index.php?rest_route=\/wp\/v2\/posts\/6135044\/revisions"}],"wp:attachment":[{"href":"https:\/\/longxi.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6135044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/longxi.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6135044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/longxi.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6135044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}