肮脏的致命错误:无法找到合适的模板

Mar*_*ski 9 centos kernel yum centos6

在将系统从一台服务器移动到另一台服务器后,我正在尝试修复我的系统。它与通过网络启动的内核完美配合,但不能从磁盘启动。

重新安装 CentOS 6.6 内核显示此错误:

grubby fatal error: unable to find a suitable template
Run Code Online (Sandbox Code Playgroud)

我的 /boot/grub/grub.conf 文件看起来不错:

default=0
timeout=5
    title linux centos6_64
    kernel /vmlinuz-2.6.32-504.8.1.el6.x86_64 root=/dev/sda3  ro crashkernel=auto SYSFONT=latarcyrheb-sun16 LANG=pl_PL.UTF-8 KEYTABLE=pl
    root (hd0,1)
    initrd /initramfs-2.6.32-504.8.1.el6.x86_64.img
Run Code Online (Sandbox Code Playgroud)

所有文件都已就位:

    ls -l /boot
razem 24645
-rw-r--r-- 1 root root   106312 01-28 22:40 config-2.6.32-504.8.1.el6.x86_64
drwxr-xr-x 3 root root     1024 2011-07-08  efi
drwxr-xr-x 2 root root     1024 03-06 13:44 grub
-rw------- 1 root root 18227613 03-06 13:44 initramfs-2.6.32-504.8.1.el6.x86_64.img
-rw-r--r-- 1 root root   200245 01-28 22:41 symvers-2.6.32-504.8.1.el6.x86_64.gz
-rw-r--r-- 1 root root  2544888 01-28 22:40 System.map-2.6.32-504.8.1.el6.x86_64
-rwxr-xr-x 1 root root  4153008 01-28 22:40 vmlinuz-2.6.32-504.8.1.el6.x86_64

    ls -l /boot/grub/
razem 259
-rw-r--r-- 1 root root     15 03-02 20:55 device.map
-rw-r--r-- 1 root root     63 2011-07-08  device.map.backup
-rw-r--r-- 1 root root  13396 03-06 13:05 e2fs_stage1_5
-rw-r--r-- 1 root root  12636 03-06 13:05 fat_stage1_5
-rw-r--r-- 1 root root  11780 03-06 13:05 ffs_stage1_5
-rw------- 1 root root    242 03-06 13:44 grub.conf
-rw-r--r-- 1 root root  11772 03-06 13:05 iso9660_stage1_5
-rw-r--r-- 1 root root  13284 03-06 13:05 jfs_stage1_5
lrwxrwxrwx 1 root root     11 03-06 13:04 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root  11972 03-06 13:05 minix_stage1_5
-rw-r--r-- 1 root root  14428 03-06 13:05 reiserfs_stage1_5
-rw-r--r-- 1 root root   1341 2010-11-14  splash.xpm.gz
-rw-r--r-- 1 root root    512 03-06 13:05 stage1
-rw-r--r-- 1 root root 126116 03-06 13:05 stage2
-rw-r--r-- 1 root root  12040 03-06 13:05 ufs2_stage1_5
-rw-r--r-- 1 root root  11380 03-06 13:05 vstafs_stage1_5
-rw-r--r-- 1 root root  13980 03-06 13:05 xfs_stage1_5
Run Code Online (Sandbox Code Playgroud)

/etc/fstab 看起来也不错:

    cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/sda3       /       ext4    rw,noatime,nodiratime,usrjquota=aquota.user,grpjquota=aquota.group,usrquota,grpquota,jqfmt=vfsv0        0       1
/dev/sda2       /boot   ext4    errors=remount-ro       0       1
/dev/sda4       swap    swap    defaults        0       0
proc            /proc   proc    defaults                0       0
sysfs           /sys    sysfs   defaults                0       0
tmpfs           /dev/shm        tmpfs   defaults        0       0
devpts          /dev/pts        devpts  defaults        0       0
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

小智 6

回复有点晚了,但在 CentOS 7 最小安装上也遇到了同样的问题。

grub2-mkconfig -o /boot/grub2/grub.cfg解决办法是:升级内核后运行。

请注意,不会将新内核设置为启动菜单中的默认值。