Programming Life
相信不能相信的,完成不能完成的。矛盾,就象征进步。
posts - 151,comments - 7,trackbacks - 0
环境介绍: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
posted on 2008-11-13 03:20 Prog 阅读(4098) 评论(0)  编辑 收藏 引用 网摘 所属分类: Linux

只有注册用户登录后才能发表评论。
网站导航: