<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444">Hi,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444">I'm wondering how to get Centos 7 to maintain the latest Elrepo Kernel as the default kernel to boot with grub2. Seems I have to manually update the OS grub when either newer core or elrepo kernels are installed. If I don't complete the following steps the wrong kernel boots after a restart. What is the better way to maintain this with minimal user intervention am I missing something?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444">1. Sort the grub list of kernels</div><div class="gmail_default" style="color:rgb(68,68,68)"><span style="color:black;background-color:rgb(243,243,243)"><font face="monospace" style="">grub2-mkconfig -o /boot/grub2/grub.cfg</font></span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:#444444">2. set 0 to be the default otherwise the previous 0 would boot.</div><div class="gmail_default" style=""><font face="monospace" style="background-color:rgb(243,243,243)" color="#000000">grub2-set-default 0</font></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
                                        <table cellspacing="0" cellpadding="0" border="0">
                                                <tbody><tr>
                                                        <td align="left" valign="bottom" colspan="3" style="border-bottom:solid 2px #cccccc;width:600px"><span class="gmail_default" style=""><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)">3. Run the following to make change active</font><br><font face="monospace" style="background-color:rgb(238,238,238)" color="#000000">grub2-mkconfig -o /boot/grub2/grub.cfg</font><br><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)">4. reboot</font><br><br><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)">If I don't start with point 1 the newest installed kernel will move to the top but the previous kernel will still stay the default and boot up with the next restart.</font><br><br><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)">Before running grub2-mkconfig: (1)</font><br><font face="monospace" style="color:rgb(68,68,68)">~ # awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg<br><br>CentOS Linux (3.10.0-1062.12.1.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.12.1.el7.x86_64) 7 (Core) with debugging<br><b>CentOS Linux (5.5.3-1.el7.elrepo.x86_64) 7 (Core)<br>CentOS Linux (5.5.3-1.el7.elrepo.x86_64) 7 (Core) with debugging</b><br>CentOS Linux (5.5.2-1.el7.elrepo.x86_64) 7 (Core)<br>CentOS Linux (5.5.2-1.el7.elrepo.x86_64) 7 (Core) with debugging<br>CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core) with debugging<br>CentOS Linux (3.10.0-1062.4.3.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.4.3.el7.x86_64) 7 (Core) with debugging<br>CentOS Linux (0-rescue-3c97b5caed9b49489500c2a52f64598e) 7 (Core)<br>CentOS Linux (0-rescue-3c97b5caed9b49489500c2a52f64598e) 7 (Core) with debugging</font><br><br><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)">After running grub2-mkconfig: (0)</font><br><font face="monospace" style="color:rgb(68,68,68)">~ # awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg<br><br><b>CentOS Linux (5.5.3-1.el7.elrepo.x86_64) 7 (Core)<br>CentOS Linux (5.5.3-1.el7.elrepo.x86_64) 7 (Core) with debugging</b><br>CentOS Linux (5.5.2-1.el7.elrepo.x86_64) 7 (Core)<br>CentOS Linux (5.5.2-1.el7.elrepo.x86_64) 7 (Core) with debugging<br>CentOS Linux (3.10.0-1062.12.1.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.12.1.el7.x86_64) 7 (Core) with debugging<br>CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core) with debugging<br>CentOS Linux (3.10.0-1062.4.3.el7.x86_64) 7 (Core)<br>CentOS Linux (3.10.0-1062.4.3.el7.x86_64) 7 (Core) with debugging<br>CentOS Linux (0-rescue-3c97b5caed9b49489500c2a52f64598e) 7 (Core)<br>CentOS Linux (0-rescue-3c97b5caed9b49489500c2a52f64598e) 7 (Core) with debugging</font><br><font face="arial, helvetica, sans-serif" style="color:rgb(68,68,68)"></font></span></td>
                                                </tr>
                                                <tr><td>
                                                                <table cellspacing="0" cellpadding="0" border="0">
                                                                        <tbody><tr>
                                                                                <td height="15"></td>
                                                                        </tr>
                                                                        <tr>
                                                                                <td style="height:15px">
                                                                                        <font face="Arial,sans-serif" size="2" color="#092C74" style="font-size:12px;color:#092c74">
                                                                                                <b><span>Danie</span> <span>de Jager</span></b>
</font></td></tr>
                                                                        <tr>
                                                                                <td height="5"></td>
                                                                        </tr>
                                                                </tbody></table>
                                                        </td>
                                                </tr>
                                        </tbody></table></div></div></div>