Ubuntu启动新内核出错

在win10下用virtualbox安装了Ubuntu15.10的服务器版本,其内核是3.9.15版本。参考网上的linux内核编译安装教程,编译了4.8.16的linux内核。重启选择新的内核启动,发现新的内核启动失败,然后进入initramfs的shell。具体错误如下

give up waiting for root device.Common problems:
-Boot args (cat /proc/cmdline)
    -Check rootdelay= (did the system wait long enough?)
    -Check root= (did the system wait for the right device?)
-Missing modules(cat /proc/modules : ls /dev)
...
ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!

在网上找了很久,终于找了一篇帖子,解决了这个问题。

http://www.7edown.com/edu/article/soft_4947_1.html。

原因是新内核使用的initrd.img-4.8.16是旧版本mkinitrd生成的,因为旧版的mkinitrd及其nash默认使用旧版sysfs路径格式,新内核下无法正确访问/sys内的硬盘信息节点。
解决方法是加入对旧版sysfs路径的支持,方法如下
在make menuconfig进入菜单后,需勾选General setup –> enable deprecated sysfs features to support old userspace tools,并勾选其下的其他选项。然后重新编译启动即可。

你可能感兴趣的:(linux)