主题 : 编译linux2.6.29中的问题 麻烦高手帮忙解决一下 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 20145
精华: 0
发帖: 6
金钱: 30 两
威望: 6 点
综合积分: 12 分
注册时间: 2010-04-27
最后登录: 2010-08-27
楼主  发表于: 2010-05-04 18:46

 编译linux2.6.29中的问题 麻烦高手帮忙解决一下

内核配置编译安装:
第一步:创建目录  /home/myliux
第二步:把linux2.6.29内核压缩文件拷贝至该目录下
第三步:解压内核到当前目录# tar jxvf linux-2.6.29.tar.bz2 得到目录linux-2.6.29
第四步:#cd linux-2.6.29
第五步:使用正在运行的内核配置作为参考 #cp /boot/config-2.6.18-53.el5  ./.config
第六步:配置内核 #make menuconfig  保存退出
第七步:编译内核#make bzImage
第八步:编译内核模块 #make modules
第九步:安装内核模块 #make modules_install
第十步:制作init ramdisk  
        #mkinitrd initrd-2.6.29  2.6.29
第十一步:添加grub.conf
         #cp /home/mylinux/linux-2.6.29/arch/x86/boot/bzImage  /boot/vmlinux-2.6.29
         #cp /home/mylinux/linux-2.6.29/initrd-2.6.29  /boot/
    
         vi  /etc/grub.conf在原有的内容基础上添加
         title mylinux
               root (hd0,0)
               kernel /vmlinuz-2.6.29 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
               initrd /initrd-2.6.29  
         重启虚拟机

进入mylinux后
No volume groups found
Volume group "VolGroup00" not found
MOUNT:could not find filesystem '/dev/root'
setuproot:Moving /dev failed:No such file or directory
setuproot:error MOUNTING /proc:Nosuch file or directory
setuproot:error MOUNTING /sys:Nosuch file or directory
switchroot: MOUNT failed:No such file or directory
Kernel panic - not syncing: Attempted to kill init!

为什么 could not find filesystem “/dev/root”.........................无奈。。。。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-05-04 20:00
你的问题在于
No volume groups found
Volume group "VolGroup00" not found

看起来你的新内核无法识别root filesystem所在的设备,即/dev/VolGroup00/LogVol00

如果你想给虚拟机里的Linux编译内核,最安全的办法是参考虚拟机Linux所用的发行版用户手册,里面应该有如何从源代码编译,安装内核的步骤。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 20145
精华: 0
发帖: 6
金钱: 30 两
威望: 6 点
综合积分: 12 分
注册时间: 2010-04-27
最后登录: 2010-08-27
2楼  发表于: 2010-05-05 00:05

 回 1楼(kasim) 的帖子

先谢谢高手了