VFS:Unable to mount root fs on unknown-block
    文章作者:恒爱网络 阅读次数:2120 发布时间:2021-6-12

    CentOS开机无法进入系统,提示 Centos kernel panic-not syncing:VFS:Unable to mount root fs on unknown-block 错误。

     

    故障原因:根据提示信息分析,可能因为执行更新命令,如  yum -y update  未完成导致系统内核信息混乱。

    解决方案:开机启动时发现显示有2个版本的centos ,默认进入的第一个应该就是有问题的未更新完全的,因此选择下面的旧版本的内核启动即可。

     

    我们知道,centos 6.x是通过/etc/grub.conf就行内核启动顺序修改的,而且比较直观查看。但centos 7的系统和6就不一样了,是通过grub2为引导程序。下边简单说下centos 7的内核启动顺序如何修改。
    1,首先查看当前系统有几个内核。比如:

    [root@21yunwei ~]# cat /boot/grub2/grub.cfg |grep menuentry
     
    if [ x"${feature_menuentry_id}" = xy ]; then
      menuentry_id_option="--id"
      menuentry_id_option=""
    export menuentry_id_option
    menuentry 'CentOS Linux (3.10.0-327.22.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-80b9b662-0a1d-4e84-b07b-c1bf19e72d97' {
    menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-80b9b662-0a1d-4e84-b07b-c1bf19e72d97' {
    menuentry 'CentOS Linux (0-rescue-7d26c16f128042a684ea474c9e2c240f) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-7d26c16f128042a684ea474c9e2c240f-advanced-80b9b662-0a1d-4e84-b07b-c1bf19e72d97' {
      

    2,设置默认的启动内核。比如我们选择上边中的CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)这个内核为默认启动。

    [root@21yunwei ~]# grub2-set-default "CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)" 配置默认内核
    验证是否修改成功:

    [root@21yunwei ~]# grub2-editenv list
    saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
      

    3,重启机器观察。
    重启成功以后查看下机器的内核是不是该内核:

    [root@21yunwei ~]# uname -r
    3.10.0-327.el7.x86_64