现在的位置: 首页 > 综合 > 正文

2.6.32.2新内核编译 mounting root filesystem. mount missing mount point error mounting /sys:

2019年05月05日 ⁄ 综合 ⁄ 共 4634字 ⁄ 字号 评论关闭
.6.32.2新内核编译
2010-01-21 12:17

说下编译环境:VM+RHEL5.1

这个内核算是版本比较高的,把下载下来的内核压缩文件解压,解压后的文件夹linux 2.6.32.2复制到

/usr/src下

make mrproper      #清除上次编译后遗留的文件,如果是第一次编译可以不用

make menuconfig   #SATA SCSI filesystem ext2 ext3等都要编译进内核

在当前目录下生成了.config文件

make all      #高版本的内核,这个命令相当于make dep建立相依的属性关系),make clean(将旧的资料去除掉),make bzImage开始编译核心),make modules开始编译模块)

make modules_install   #安装模块。安装模块到/lib/modules/,以后程序运行时从这个目录加载模块。

make install    #把make all 生成的vmlinuzSystem.map复制到/boot目录下同时修改grub /boot/grub/menu.lst. 修改menu.lst是自动完成的哦!!文件复制、grub修改都不用手动。

很多人做完后,发现编译没有问题,新内核2.6.32.2启动不起来

错误如下图


可能原因有几个:

1、驱动、文件系统没有编译进去

2、编辑内核源码包里面的.config文件. CONFIG_SYSFS_DEPRECATED_V2=y #默认该选项为not    set,被注释掉的

3、arm linux 编译

#make menuconfig

General setup   --->                                     

Loadable module support   --->                            

Block layer   --->                                        

Processor type and features   --->                         

Power management options (ACPI, APM)   --->                

Bus options (PCI, PCMCIA, EISA, MCA, ISA)   --->          

Executable file formats   --->                            

Networking   --->                                        

Device Drivers   --->                                     

File systems   --->                                        

Instrumentation Support   --->       

   

#make ARCH=arm menuconfig

Code maturity level options   --->                   

General setup   --->                                  

Loadable module support   --->                      

Block layer   --->                                  

System Type   --->                                  

Bus support   --->                                  

Kernel Features   --->                               

Boot options   --->                                  

Floating point emulation   --->                      

Userspace binary formats   --->                      

Power management options   --->                      

Networking   --->                                     

Device Drivers   --->               

 

我出现错误的解决的方法是第二种,网上现在很多资料解释这块,据说是个BUG,LINUX大牛们指点指点了

再转一个类似这样的的文章,仅供参考

环境介绍:Centos5.2+2.6.18-8.el5内核,编译器是GCC4.1.2。
要编译的内核2.6.18-8.el3
仅仅修改了部分内核的配置信息,没有大的变化。
然后:make ;make modules;make modules_install;
编译没有出问题,生成了内核,mkinitrd生成了initrd,加到lilo.conf中,重启选择新内核,出现一下问题:

hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
Scanning and configuring dmraid supported devices
Trying to resume from LABEL=SWAP-hdc4
No suspend signature on swap, not resuming.
Creating root device.
Mounting root filesystem.
mount: could notKernel panic - not syncing: Attempted to kill init!
find filesystem   '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
两者区别就是编译器版本一个是gcc3.4,一个是gcc4.1,后者编译通过,但是不能引导系统。

解决方法:
Here's the fix
After almost giving up on Fedora 5, I finally got the fix to this problem.

The suspend signature on swap error, "Trying to resume from LABEL=SWAP-hdd3. No suspend signature on swap, not resuming", can be ignored. It gives this error because when the volumes are activated (look at the output previous to this error), it resumes the swap partition in that step. Therefore, it's trying to resume something that isn't suspended.

The error that causes all the trouble is "mount: could not find filesystem '/dev/root'". Appartently, in the init script within initrd-2.6.15-1.2054_FC5.img, the command 'mount /sysroot' is trying to mount /dev/root to /sysroot. Fedora 5 does not use /dev/root like in the previous versions of Fedora. Instead, it uses '/dev/VolGroup00/LogVol00' or '/dev/hda1' (or whereever '/' is located) to mount to /sysroot. For some reason, when init calls 'mount /sysroot', it's trying to mount /dev/root to /sysroot, instead of /dev/VolGroup00/LogVol00 to /sysroot. This messes up everything after this step in the init process. When it does a switchroot at the end, it fails. After killing init, it causes the kernel panic.

Here's the fix:

1) Boot with the rescue CD
2) Type 'chroot /mnt/sysimage' (wherever it mounts the Fedora 5 partition)
3) 'cd /boot'
4) 'mkdir newinit'
5) 'cd newinit'
6) 'gunzip -c ../initrd-2.6.15-1.2054_FC5.img | cpio -idmv'
7) 'vi init'
8) Find 'mount /sysroot' (near the end of the file)
9) Delete or comment this out
10) Replace with 'mount -o defaults --ro -t ext3 /dev/VolGroup00/LogVol00 /sysroot' where /dev/VolGroup00/LogVol00 is the mount point for /
11) ':wq' out of vi
12) 'find . | cpio --quiet -c -o >../newinitrd'
13) 'cd ..' - you are now in /boot
14) 'mv initrd-2.6.15-1.2054_FC5.img initrd-2.6.15-1.2054_FC5.bak' - backup current initrd img file (just in case)
15) 'gzip -9 < newinitrd > initrd-2.6.15-1.2054_FC5.img'
16) Reboot the computer without the CD

* Steps 4-6,12,13,15 were taken from another site, but I couldn't post the URL. I'll try in my next post.

This should fix it. I'm glad I can finally run Fedora 5 on my box.

MarkCole, I'm not sure if you were experiencing the exact same problems I was with mounting root. However, I hope this helps anyone else experiencing the same problems I had.

Andy

抱歉!评论已关闭.