gr fat致命的错误:无法find合适的模板

我试图从一台服务器移到另一台服务器后修复系统。 它可以与通过networking启动的内核完美协作,但不能从磁盘启动。

重新安装股票CentOS 6.6内核显示这个错误:

grubby fatal error: unable to find a suitable template 

我的/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 

所有文件都到位:

  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 

/ 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 

如何解决这个问题?

有点迟到的反应,但只是面对与CentOS 7最小安装相同的问题。

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

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

这对我来说可以:

 mv /boot/grub/grub.conf /boot/grub/bk_grub.conf yum -y update && yum -y reinstall kernel 

我猜这一行

  title linux centos6_64 

应该是公正的

 title linux centos6_64 

(去除压痕应该有帮助)

检查/ var / log / grubby来查找错误的来源。

在我的情况下,这个错误信息是由于在CentOS 7上使用btrfs根目录安装( rhboot grubby bug#22 )时的错误引起的。 Root实际上是一个名为/ root的btrfs子卷,所以用于加载内核的grub条目指向/ root / boot / vmlinuz- *,/ root安装在/时不能访问/ root / boot /path。

一个简单的解决方法是通过执行/ root / boot启动指向/ boot的有效path:

 ln -s /boot /root/boot