{"id":6582,"date":"2017-03-28T10:02:52","date_gmt":"2017-03-28T02:02:52","guid":{"rendered":"http:\/\/rmohan.com\/?p=6582"},"modified":"2017-03-28T10:05:26","modified_gmt":"2017-03-28T02:05:26","slug":"grubby-fatal-error-unable-to-find-a-suitable-template","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6582","title":{"rendered":"grubby fatal error: unable to find a suitable template"},"content":{"rendered":"<p><strong>grubby fatal error: unable to find a suitable template<\/strong><\/p>\n<p>Updating\u00a0\u00a0 : selinux-policy-3.7.19-292.el6_8.3.noarch\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8\/28<br \/>\nUpdating\u00a0\u00a0 : selinux-policy-targeted-3.7.19-292.el6_8.3.noarch\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9\/28<br \/>\nInstalling : kernel-2.6.32-642.15.1.el6.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10\/28<br \/>\n<strong>grubby fatal error: unable to find a suitable template<\/strong><br \/>\nUpdating\u00a0\u00a0 : ntp-4.2.6p5-10.el6.centos.2.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11\/28<br \/>\nUpdating\u00a0\u00a0 : libtiff-3.9.4-21.el6_8.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 12\/28<br \/>\nUpdating\u00a0\u00a0 : kernel-headers-2.6.32-642.15.1.el6.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13\/28<br \/>\nUpdating\u00a0\u00a0 : tzdata-2017a-1.el6.noarch\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 14\/28<br \/>\nCleanup\u00a0\u00a0\u00a0 : kernel-2.6.32-573.26.1.el6.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 15\/28<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/weak-updates failed: No such file or directory<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/modules.order failed: No such file or directory<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/modules.networking failed: No such file or directory<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/modules.modesetting failed: No such file or directory<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/modules.drm failed: No such file or directory<br \/>\nwarning:\u00a0\u00a0\u00a0 erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/modules.block failed: No such file or directory<br \/>\nCleanup\u00a0\u00a0\u00a0 : selinux-policy-targeted-3.7.19-292.el6_8.2.noarch<\/p>\n<pre><code>mv \/boot\/grub\/grub.conf \/boot\/grub\/bk_grub.conf\r\nyum -y update &amp;&amp; yum -y reinstall kernel\r\n\r\nadd in grub.conf \r\n\r\n\r\ntitle CentOS (2.6.32-431.el6.x86_64)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root (hd0,0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kernel \/boot\/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=c5f51db1-bfef-4480-868f-dc6049906512 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto\u00a0 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 initrd \/boot\/initramfs-2.6.32-431.el6.x86_64.img\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\ndefault=0\r\ntimeout=5\r\nsplashimage=(hd0,0)\/grub\/splash.xpm.gz\r\nhiddenmenu\r\ntitle CentOS (2.6.32-642.15.1.el6.x86_64)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root (hd0,0)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0kernel \/boot\/vmlinuz-2.6.32-642.15.1.el6.x86_64 ro root=UUID=c5f51db1-bfef-4480-868f-dc6049906512 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto\u00a0 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 initrd \/initramfs-2.6.32-642.15.1.el6.x86_64.img\r\ntitle CentOS (2.6.32-573.3.1.el6.x86_64)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root (hd0,0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kernel \/vmlinuz-2.6.32-573.3.1.el6.x86_64 ro root=\/dev\/mapper\/vg_db2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_db2\/lv_swap rd_NO_MD rd_LVM_LV=vg_db2\/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=auto\u00a0 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 initrd \/initramfs-2.6.32-573.3.1.el6.x86_64.img\r\ntitle CentOS (2.6.32-431.el6.x86_64)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 root (hd0,0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kernel \/vmlinuz-2.6.32-431.el6.x86_64 ro root=\/dev\/mapper\/vg_db2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_db2\/lv_swap rd_NO_MD rd_LVM_LV=vg_db2\/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=auto\u00a0 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 initrd \/initramfs-2.6.32-431.el6.x86_64.img\r\n\r\n\r\nor \r\n\r\n<\/code><\/pre>\n<p>It is absolutely impossible to regenerate a <code>grub.conf<\/code> from scratch with any of the tools delivered by CentOS. My solution:<\/p>\n<ol>\n<li>boot your system via Install-Disk or by grub command line prompt<\/li>\n<li>create an empty new <code>\/boot\/grub\/grub.conf<\/code><\/li>\n<li>add the next code snippet to your <code>grub.conf<\/code><\/li>\n<\/ol>\n<div>\n<div id=\"highlighter_681933\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<div class=\"line number4 index3 alt1\">4<\/div>\n<div class=\"line number5 index4 alt2\">5<\/div>\n<div class=\"line number6 index5 alt1\">6<\/div>\n<div class=\"line number7 index6 alt2\">7<\/div>\n<div class=\"line number8 index7 alt1\">8<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">default=0<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"bash plain\">timeout=5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">splashimage=(hd0,0)<\/code><code class=\"bash plain\">\/grub\/splash<\/code><code class=\"bash plain\">.xpm.gz<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"bash plain\">hiddenmenu<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"bash plain\">title CentOS (2.6.32-279.22.1.el6.x86_64)<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"bash spaces\">\u00a0\u00a0<\/code><code class=\"bash plain\">root (hd0,0)<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"bash spaces\">\u00a0\u00a0<\/code><code class=\"bash plain\">kernel <\/code><code class=\"bash plain\">\/vmlinuz-2<\/code><code class=\"bash plain\">.6.32-279.22.1.el6.x86_64 ro root=<\/code><code class=\"bash plain\">\/dev\/sda3<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"bash spaces\">\u00a0\u00a0<\/code><code class=\"bash plain\">initrd <\/code><code class=\"bash plain\">\/initramfs-2<\/code><code class=\"bash plain\">.6.32-279.22.1.el6.x86_64.img<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>N O T E:<br \/>\nI have a separated <code>\/boot<\/code> partition on my systems. In standard configuration delivered by CentOS <code>\/boot<\/code> and <code>\/<\/code> will be on the same partition. In this case, the path to kernel and <code>initrd<\/code> will start with <code>\/boot\/vmlinuz...<\/code> and <code>\/boot\/initramfs...<\/code> . The root partition mostly will be <code>root=\/dev\/sda1<\/code>.<\/p>\n<p>Try to boot your system with your manually built <code>grub.conf<\/code>. If anything works fine you can add new boot entries by CentOS\u2019 tool <code>grubby<\/code>. For example:<\/p>\n<div>\n<div id=\"highlighter_565962\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash plain\">root@host:~ $ grubby --add-kernel=<\/code><code class=\"bash string\">\"\/boot\/vmlinuz-2.6.32-279.22.1.el6.x86_64\"<\/code><code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"bash plain\">--initrd=<\/code><code class=\"bash string\">\"\/boot\/initramfs-2.6.32-279.22.1.el6.x86_64.img\"<\/code><code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">--title=<\/code><code class=\"bash string\">\"CentOS (2.6.32-279.22.1.el6.x86_64)\"<\/code> <code class=\"bash plain\">--copy-default --<\/code><code class=\"bash functions\">make<\/code><code class=\"bash plain\">-default<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The tool <code>grubby<\/code> will replace the <code>\/dev\/sda?<\/code> device file with the UUID string of the partition.<br \/>\nYou can use the next line to generate an entry for each kernel image in <code>\/boot\/<\/code>:<\/p>\n<div>\n<div id=\"highlighter_595510\" class=\"syntaxhighlighter  bash\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<div class=\"line number4 index3 alt1\">4<\/div>\n<div class=\"line number5 index4 alt2\">5<\/div>\n<div class=\"line number6 index5 alt1\">6<\/div>\n<div class=\"line number7 index6 alt2\">7<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"bash keyword\">for<\/code> <code class=\"bash plain\">kernel <\/code><code class=\"bash keyword\">in<\/code> <code class=\"bash plain\">\/boot\/vmlinuz-<\/code><code class=\"bash plain\">*; <\/code><code class=\"bash keyword\">do<\/code> <code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"bash plain\">version=`<\/code><code class=\"bash functions\">echo<\/code> <code class=\"bash plain\">$kernel | <\/code><code class=\"bash functions\">awk<\/code> <code class=\"bash plain\">-F<\/code><code class=\"bash string\">'vmlinuz-'<\/code> <code class=\"bash string\">'{print $NF}'<\/code><code class=\"bash plain\">`; \\<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"bash plain\">grubby --add-kernel=<\/code><code class=\"bash string\">\"\/boot\/vmlinuz-${version}\"<\/code> <code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"bash plain\">--initrd=<\/code><code class=\"bash string\">\"\/boot\/initramfs-${version}.img\"<\/code> <code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"bash plain\">--title=<\/code><code class=\"bash string\">\"CentOS (${version})\"<\/code> <code class=\"bash plain\">\\<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"bash plain\">--copy-default --<\/code><code class=\"bash functions\">make<\/code><code class=\"bash plain\">-default; \\<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"bash keyword\">done<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>You should check the <code>\/etc\/grub.conf<\/code> for duplicate entries or maybe you will resort the boot order. Reboot your system to check if anything works fine again.<\/p>\n<pre><code>\r\nIssue\r\n\r\n\u00a0\u00a0\u00a0 When I install a kernel from RHN, I am getting the error: grubby fatal error: unable to find a suitable template\r\n\r\nRaw\r\n\r\n\u00a0\u00a0\u00a0 [root@rhel5 ~]# rpm -vhi kernel-2.6.18-274.el5.x86_64.rpm \r\n\u00a0\u00a0\u00a0 Preparing...\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### [100%]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1:kernel\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### [100%]\r\n\u00a0\u00a0\u00a0 grubby fatal error: unable to find a suitable template \r\n\r\nResolution\r\n\r\n\u00a0\u00a0\u00a0 Several things can cause this error: One is when \/boot is not currently mounted. Remounting \/boot can properly install the kernel.\r\n\r\nRaw\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# rpm -e kernel-2.6.18-274.el5\r\n\r\nIf the above command fails because of installed dependencies, use it in the following form:\r\nRaw\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# rpm -e --nodeps kernel-2.6.18-274.el5\r\n\r\nAfterwards, ensure \/boot is mounted and proceed to reinstall the kernel:\r\nRaw\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# mount \/boot\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# rpm -ivh kernel-2.6.18-274.el5.x86_64.rpm \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Preparing...\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### [100%]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1:kernel\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### [100%]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# \r\n\r\nIf you don't have the RPM available, you can always use yum:\r\nRaw\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [root@rhel5 ~]# yum install kernel\r\n\r\n\u00a0\u00a0\u00a0 This error can also happen when there are multiple filesystems with same label for the root device, and the root device is specified with LABEL= in grub.conf. In that case, change the label into an unique one, or use the device name or UUID= to specify the root device in grub.conf. To change the label on \/dev\/sdb2 to \/root-1 for example:\r\n\r\nRaw\r\n\r\n# e2label \/dev\/sdb2 \/root-1\r\n\r\n\u00a0\u00a0\u00a0 Another cause for this error can be a bad path to the initrd in grub.conf.\r\n\r\n\u00a0\u00a0\u00a0 If root device in your kernel line is invalid will also cause this message. To resolve this you can edit \/boot\/grub\/grub.conf, changing the root entry in the most recent kernel entry to point to the correct root device.\r\n\r\nDiagnostic Steps\r\n\r\n\u00a0\u00a0\u00a0 To check if you have multiple filesystems with the same label run the following command (uuid's simplified for clarity):\r\n\r\nRaw\r\n\r\n# blkid\r\n$ cat sos_commands\/filesys\/blkid \r\n\/dev\/sda1: LABEL=\"\/boot\" UUID=\"aaaaa\" TYPE=\"ext3\" SEC_TYPE=\"ext2\" \r\n\/dev\/sdb1: LABEL=\"\/boot\" UUID=\"aaaaa\" TYPE=\"ext3\" SEC_TYPE=\"ext2\" \r\n\/dev\/sda2: LABEL=\"\/\" UUID=\"bbbbb\" SEC_TYPE=\"ext2\" TYPE=\"ext3\" \r\n\/dev\/sdb2: LABEL=\"\/\" UUID=\"bbbbb\" SEC_TYPE=\"ext2\" TYPE=\"ext3\" \r\n\r\nWe can see above that there are 2 disks with the same label. Check to see if they have the same wwwid (these commands are for RHEL5. For RHEL6 you need to use scsi_id --whitelisted \/dev\/sd* instead.\r\nRaw\r\n\r\n# scsi_id -gus \/block\/sda\r\n3600001234567\r\n# scsi_id -gus \/block\/sdb\r\nHITATCHI-abc123\r\n\r\nThe above clearly shows that they are different disks (i.e. not a multiple path to the same device).\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>grubby fatal error: unable to find a suitable template<\/p>\n<p>Updating : selinux-policy-3.7.19-292.el6_8.3.noarch 8\/28 Updating : selinux-policy-targeted-3.7.19-292.el6_8.3.noarch 9\/28 Installing : kernel-2.6.32-642.15.1.el6.x86_64 10\/28 grubby fatal error: unable to find a suitable template Updating : ntp-4.2.6p5-10.el6.centos.2.x86_64 11\/28 Updating : libtiff-3.9.4-21.el6_8.x86_64 12\/28 Updating : kernel-headers-2.6.32-642.15.1.el6.x86_64 13\/28 Updating : tzdata-2017a-1.el6.noarch 14\/28 Cleanup : kernel-2.6.32-573.26.1.el6.x86_64 15\/28 warning: erase unlink of \/lib\/modules\/2.6.32-573.26.1.el6.x86_64\/weak-updates [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6582"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6582"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6582\/revisions"}],"predecessor-version":[{"id":6586,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6582\/revisions\/6586"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}