无法生成 grub.cfg

无法生成 grub.cfg

Software Up To Date 昨天为我安装了一个新内核(Ubuntu 12.04,内核 3.13.0-48-generic)。重启后,我运行 grub 定制程序并收到错误。update-grub 也出现同样的错误:

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found linux image: /boot/vmlinuz-3.13.0-46-generic
Found initrd image: /boot/initrd.img-3.13.0-46-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found linux image: /boot/vmlinuz-3.13.0-46-generic
Found initrd image: /boot/initrd.img-3.13.0-46-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done

/boot/grub/grub.cfg 的第 146 行是:

menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos1)'
    search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2 <<-Line 146
    linux /boot/vmlinuz-2.6.32-504.12.2.el6.x86_64 root=/dev/sdb1
    initrd /boot/initramfs-2.6.32-504.12.2.el6.x86_64.img
}

/boot/grub/grub.cfg.new 的第 146 行是:

menuentry "Ubuntu, with Linux 3.13.0-46-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos3)'
    search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
    echo    'Loading Linux 3.13.0-46-generic ...'
    linux   /boot/vmlinuz-3.13.0-46-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.13.0-46-generic
}
function gfxmode {  <<- Line 146
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
            set vt_handoff=vt.handoff=7
    else
            set vt_handoff=
    fi
}

它提示我“检查 /etc/grub.d/* 中的错误”,但我怎么知道那里有什么错误?由于我从未接触过这些文件,所以我不知道它们应该包含什么。

相关内容