LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1765|回复: 10

新编译的内核不能引导系统,求助!

[复制链接]
发表于 2010-11-20 12:30:12 | 显示全部楼层 |阅读模式
前些日子在笔记本 惠普 nc6400上装了 ubuntu 10.04,发现电池在此系统上续航时间比XP短很多,上网查了下原因,首先注意到的是 cpu 的变频。然后发现,此机在 ubuntu10.04下没有变频能力:
cpufreq-info
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 0.00 ms.
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 0.00 ms.

看样子是连驱动都没有,再网上搜索,感觉应该是内核的acpi没有添加cpufreq功能,只能重新编译内核。于是乎就下载了个最新的内核稳定版:2.6.36.然后还是网上找到了编译和安装过程。经过了难熬的两个小时,内核是出来了。但重启后却发现,系统跟本不能启动。给出来的信息似乎说是文件系统不能加载(root不能加载)!郁闷!!!!
给出来的信息:
Gave up waiting for root device. Common problems:
-Boot args ( cat /proc/cmdline )
-Check root delay = (did the system wait long enough ? )
-check root = (did the system wait for the right device ?)
-Missing modules (cat /proc/modules; ls /dev)
FATAL: Could not load /lib/modules/2.6.36hpnc6400/modules.dep: No such file on directory
FATAL: 同上
ALERT! /dev/disk/by-uuid/xxxxxxxxxxxxxxxxxxxxxxxx/does not exist.
Dropping to a shell !
请各路高手多多指教,不胜感激!谢谢!
发表于 2010-11-22 22:42:35 | 显示全部楼层
Post by songweiwen;2120467
前些日子在笔记本 惠普 nc6400上装了 ubuntu 10.04,发现电池在此系统上续航时间比XP短很多,上网查了下原因,首先注意到的是 cpu 的变频。然后发现,此机在 ubuntu10.04下没有变频能力:
cpufreq-info
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 0.00 ms.
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 0.00 ms.

看样子是连驱动都没有,再网上搜索,感觉应该是内核的acpi没有添加cpufreq功能,只能重新编译内核。于是乎就下载了个最新的内核稳定版:2.6.36.然后还是网上找到了编译和安装过程。经过了难熬的两个小时,内核是出来了。但重启后却发现,系统跟本不能启动。给出来的信息似乎说是文件系统不能加载(root不能加载)!郁闷!!!!
给出来的信息:
Gave up waiting for root device. Common problems:
-Boot args ( cat /proc/cmdline )
-Check root delay = (did the system wait long enough ? )
-check root = (did the system wait for the right device ?)
-Missing modules (cat /proc/modules; ls /dev)
FATAL: Could not load /lib/modules/2.6.36hpnc6400/modules.dep: No such file on directory
FATAL: 同上
ALERT! /dev/disk/by-uuid/xxxxxxxxxxxxxxxxxxxxxxxx/does not exist.
Dropping to a shell !
请各路高手多多指教,不胜感激!谢谢!

到那里高手比较多去看看能否有人给你解决! http://forum.ubuntu.org.cn/
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-11-23 11:39:24 | 显示全部楼层
这里的高手更多,只是高手似乎很少用ubuntu而已
回复 支持 反对

使用道具 举报

发表于 2010-11-25 19:26:55 | 显示全部楼层
initrd做了么。
回复 支持 反对

使用道具 举报

发表于 2010-11-26 14:20:12 | 显示全部楼层
Post by Arabian;2121146
initrd做了么。

应该是遇到高手了!请问可不可以将由编译到内核启动如何设定详细的贴出来大家分享!先谢谢你!
回复 支持 反对

使用道具 举报

发表于 2011-2-6 18:04:49 | 显示全部楼层
Post by chanshun8;2121222
应该是遇到高手了!请问可不可以将由编译到内核启动如何设定详细的贴出来大家分享!先谢谢你!


有没有make modules_install.
initrd生成很容易的
你试试update-initramfs
回复 支持 反对

使用道具 举报

发表于 2011-2-28 13:03:06 | 显示全部楼层
你找个内核配置好好研究,我建议你去看 kernel seed,上面有详细的设置,我就是通过这个网址学会编译内核的,不过是英文的。

还有,内核设置好不用initrd也行,我几乎一年多没用,后来想试试ATI显卡的内核模式设置,也就是内核加载驱动,从一开始consol的分辨率就是1440x900,而且主要是为了图形化的启动界面,就制作了一个initrd。
回复 支持 反对

使用道具 举报

发表于 2011-2-28 13:05:33 | 显示全部楼层
你问题上有:Gave up waiting for root device.

根本就没用加载根分区,或者没用加载硬盘驱动,
如果你不编译initrd的话,这些东西必选编译到内核,而不是作为一个模块,而ubuntu默认的这些大部分都是模块,所以,你必选根据你的pci编译一个合适的内核

这里涉及问题很多,很难说清楚。
回复 支持 反对

使用道具 举报

发表于 2011-2-28 13:07:15 | 显示全部楼层
给你一个参考:

我回答别人编译内核的问题:
这个问题曾经困扰我几天,后来一次次编译内核后发现,
因为没有选择合适的硬盘驱动


有几个选项是必选的
  • Support for large (2TB+) block devices and files
    (虽然我的硬盘只有500G,但是不选这个就会出现你说的VFS:unable to mount root fs on unknown-block(0,0))
  • Block devices --->
    <*> Loopback device support

    -*- SCSI device support
  • legacy /proc/scsi/ support
    <*> SCSI disk support
    <*> SCSI generic support
  • Probe all LUNs on each SCSI device
  • Asynchronous SCSI scanning (这个非常重要,貌似你的问题和这个有关,必选!)


    我的是sata硬盘,amd系列主板,所以
    <*> Serial ATA and Parallel ATA drivers --->
  • ATA ACPI Support
  • SATA Port Multiplier support
    <*> AHCI SATA support
  • ATA SFF support
  • ATA BMDMA support
    <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
    <*> AMD/NVidia PATA support
    <*> ATI PATA support


    除了最后那几个amd ati相关的选项,那几个都是必选的,你编译一个看看

  • Asynchronous SCSI scanning (这个非常重要,貌似你的问题和这个有关,必选!)
    这个是扫描SCSI设备的,必选

    还有就是合适的文件系统,比如你的是ext4,那么内核中选上,肯定没问题的。
    <*> The Extended 4 (ext4) filesystem
  •    Use ext4 for ext2/ext3 file systems
  •    Ext4 extended attributes
  • 回复 支持 反对

    使用道具 举报

    发表于 2011-2-28 13:16:59 | 显示全部楼层
    最后说一句,如果你不会制作initrd,
    那么就使用你当前电脑的内核版本默认配置文件,注意别去随便升级内核,注意要用你使用中的版本的默认配置文件。默认内核配置文件在boot目录下,比如10.04的config-2.6.32-21-generic,你把它复制到/usr/src/linux/.config ,然后编译内核,选上你要的cpufreq

  • Power Management support

  • Run-time PM core functionality

  • ACPI (Advanced Configuration and Power Interface) Support  --->

  • CPU Frequency scaling
    <*>   CPU frequency translation statistics
    Default CPUFreq governor (ondemand)  --->
    -*-   'performance' governor                                                   │ │  
      │ │         <M>   'powersave' governor                                                     │ │  
      │ │         <M>   'userspace' governor for userspace frequency scaling                     │ │  
      │ │         -*-   'ondemand' cpufreq policy governor                                       │ │  
      │ │         <M>   'conservative' cpufreq governor                                          │ │  
      │ │               *** CPUFreq processor drivers ***                                        │ │  
      │ │         <M>   Processor Clocking Control interface driver   

    <*>   AMD Opteron/Athlon64 PowerNow! (这个是cpu调频驱动,一定要选对,我的是amd k8,所以选这个,你的是什么cpu型号就什么驱动)

    最后编译,因为你用的是默认的内核,所以还用原来的initrd也能启动,只是改了改grub中kernel那一行
  • 回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    快速回复 返回顶部 返回列表