发博文
野狗之家

http://blog.chinaunix.net/space.php?uid=220350

山间一寺一壶酒,独酌莫如去相亲,何必伶丁叹寂寥,碧海青天夜夜心,莫愁前路无知己,淘遍黄金始见沙,过尽千帆皆不是,终有一款适合您.--诺基亚真皮实!   
个人资料
  • 博客访问:264277
  • 博文数量:45
  • 博客积分:4250
  • 博客等级:上校
  • 注册时间:2006-05-04 04:09:46
订阅我的博客
  • 订阅
  • 订阅到鲜果
  • 订阅到抓虾
  • 订阅到Google
字体大小: 博文
分类: linux相关

由于遇到了在vmvare中,从2.6.9到2.6.21升级内核时,出现
 
Red Hat nash version 4.2.1.8 starting
Reading all physical volumes. This may take a while...
No volume groups found
Volume group “VolGroup00” not found
ERROR: /bin/lvm exited abnormally! (pid 302)

错误,scsi卡为
SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
 
本以为google后会有结果,未果,只有自己动手了.(在gentoo下做实验)
 
首先觉得有必要使用新版的mkinitrd.下了一个,生成
文件: mkinitrd-4.2.17.tar.gz
大小: 85KB
下载: 下载
编译后安装.(此为我修改后的版本)
 
可以做实验了.
1.cp /usr/src/linux/arch/i386/bzImage  /boot/boot.img
2. cd /boot
3. mkinitrid -v --preload mptspi --preload dm-mod -f initrd-2.6.20.4 2.6.20.4
输出检查了一下没有问题.
4. vi grub/grub.conf
加入
title=Gentoo Linux (2.6.20.4)
root (hd0,0)
kernel /boot.img root=/dev/sda3 console=ttyS0,57600 console=tty0
(console=ttyS0,57600是从此虚拟机有一个串口,串口的输出为一个文件,这样可以更详细看到内核启动的问题)
initrd /initrd-2.6.20.4
5.用此项重启.失败
pivot root: pivot_root (/sysroot, /sysroot/initrd) failed:2 
说我的/下没有initrd这个目录,看了一下redhat的,是空目录.
6.用正常项启动.
mkdir -p /initrd
7.用实验项重启.
ok,一切正常.
 
8.好了,比对一下2.6.9与2.6.20.4加载的有关scsi的模块.
 
2.6.20.4 (加载模块是有顺序的)
insmod /lib/mptbase.ko
insmod /lib/mptscsih.ko
insmod /lib/scsi_transport_spi.ko (此模块要在mptspi前加载,mkinitrd-4.2.1.8默认使用/etc/modprobe.conf文件,/etc/fstab,对于LABEL=的支持不好.)
insmod /lib/mptspi.ko
insmod /lib/dm-mod.ko
 
其它的不重要了.
 
9.结论,关于有使用scsi卡并要升级内核或自行编译内核,对于可能出现的kernel panic的解决方法就是.
1)要问是不是没有相关scsi设备驱动模块加载.
2)有相关驱动加载,新内核是不是有新的特性,需要其它模块支持如(scsi_transport_spi.ko)
3)用比较新的mkinitrd生成initrd文件来测试,确定模块依赖关系正确.确定设备能被正常识别.确定加载过程正常.(mkinitrd-5.1.19-1.i386.rpm)
4)在gentoo中使用,不要忘了建/initrd这个空目录.
 
此文是在翻阅大量相关文档分析mkinitrd和initrd文件后,得出的结论.相关分析命令.
1)老版的initramfs,用以下方法
mv initrd-2.6.20.4 initrd-2.6.20.4.gz
gunzip initrd-2.6.20.4.gz
losetup /dev/loop0 initrd-2.6.20.4
mount /dev/loop0 /mnt/temp
 
2)使用cpio生成的initrd-2.6.20.4
zcat initrd-2.6.20.4 | cpio -i
zcat initrd-2.6.20.4 | cpio -t | sort

3)gentoo的initramfs
zcat /boot/initramfs-genkernel-x86-2.6.22.6 | (while true; do cpio -t -H newc --no-absolute-filenames || exit; done)

 zcat /boot/initramfs-genkernel-x86-2.6.22.6 | (while true; do cpio -i -H newc --no-absolute-filenames || exit; done)

对于新的内核使用的是cpio -H newc -o 方式生成的initrd,而非cpio -c -o要注意,否则无法正常使用.
 
附:在vmware中如何将ide虚拟盘当做scsi盘使用.
1.新生成一个scsi盘.
2.修改*.vmx文件.
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic" (此处定义使用什么scsi设备)
scsi0:0.present = "TRUE"
scsi0:0.fileName = "1.vmdk" (1.vmdk原先定义的是ide,为有内容的盘,在这里被加给scsi0使用)
 
内核2.6.21使用Fusion MPT 3.04.04有问题,使用3.04.03,如下(至少LSI53C1030可以正常加载)
文件: fusion.tar.gz
大小: 223KB
下载: 下载
另一解决方法.
Edit /usr/src/linux/drivers/message/fusion/mptbase.c to match the following

--- drivers/message/fusion/mptbase.orig.c 2007-07-20 18:47:21.000000000 +0000
+++ drivers/message/fusion/mptbase.c 2007-07-20 11:23:32.000000000 +0000
@@ -2564,6 +2564,10 @@
pfacts->IOCStatus = le16_to_cpu(pfacts->IOCStatus);
pfacts->IOCLogInfo = le32_to_cpu(pfacts->IOCLogInfo);
pfacts->MaxDevices = le16_to_cpu(pfacts->MaxDevices);
+ /* Fix VMware bug */
+ if(pfacts->MaxDevices == 0) {
+ pfacts->MaxDevices = 16;
+ }
pfacts->PortSCSIID = le16_to_cpu(pfacts->PortSCSIID);
pfacts->ProtocolFlags = le16_to_cpu(pfacts->ProtocolFlags);
pfacts->MaxPostedCmdBuffers = le16_to_cpu(pfacts->MaxPostedCmdBuffers);
 
是VMware的模拟lsi的一个bug.

 
 

[发评论] 评论 重要提示:警惕虚假中奖信息!
  • chinaunix网友 2008-04-09 11:06
    我用 mkinitrid -v --preload mptspi --preload dm-mod -f initrd-2.6.20.4 2.6.20.4时说mkinitrid命令没有找到, 我改为mkinitrd -v --preload mptspi --preload dm-mod -f initrd-2.6.20.4 2.6.20.4,就是mkinitrid多了一个字母i,去掉之后出现如下: Creating initramfs Looking for deps of module mptspi No module mptspi found for kernel 2.6.18.8, aborting. 好像是说没有mptspi呀,怎么办啊!!!
  • chinaunix网友 2008-04-01 18:30
    大牛啊,大牛~
  • chinaunix网友 2007-11-22 00:08
    好大一只牛`~
  • sttty 2007-09-26 09:54
    请问如果要是用镜像文件的方式,怎么做呢. 以前用 dd if=/dev/zero of=/tmp/ramdisk.img bs=1024 count= 2 mke2fs -F -m 0 -b 1024 /tmp/ramdisk.img 2 mount /tmp/ramdisk.img /mnt/initrd -t ext2 -o loop=/dev/loop0 2.6.20之后就不能用了.奇怪.
  • wysilly 2007-06-03 09:13
    应该是mkinitrd-4.2.17,这句话说明(Red Hat nash version 3.5.22 starting)你用的是gentoo自带的那个mkinitrd,不能用很正常,正确的应是(Red Hat nash version 4.2.17 starting)
  • todaygood 2007-06-01 22:18
    2.6.16 用你的mkinitrd-4.2.1.8 生成的initrd ,启动之后的信息如下: Linux version 2.6.16.17 (root@hujun.com) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #2 Fri Jun 1 10:56:25 CST 2007 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ca000 - 00000000000cc000 (reserved) BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000009ef0000 (usable) BIOS-e820: 0000000009ef0000 - 0000000009eff000 (ACPI data) BIOS-e820: 0000000009eff000 - 0000000009f00000 (ACPI NVS) BIOS-e820: 0000000009f00000 - 000000000a000000 (usable) BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved) BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved) 0MB HIGHMEM available. 160MB LOWMEM available. DMI present. ACPI: PM-Timer IO Port: 0x1008 Allocating PCI resources starting at 10000000 (gap: 0a000000:f4c00000) Built 1 zonelists Kernel command line: ro root=/dev/sda2 console=ttyS0,57600 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Initializing CPU#0 PID hash table entries: 1024 (order: 10, 16384 bytes) Detected 1596.745 MHz processor. Using pmtmr for high-res timesource Console: colour VGA+ 80x25 Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) Memory: 158268k/163840k available (1894k kernel code, 4980k reserved, 798k data, 156k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 3198.43 BogoMIPS (lpj=6396873) Security Framework v1.0.0 initialized SELinux: Initializing. SELinux: Starting in permissive mode selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 512 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 256K (64 bytes/line) Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: AMD Turion(tm) 64 X2 Mobile Technology TL-50 stepping 02 Checking 'hlt' instruction... OK. ACPI: setting ELCR to 0200 (from 0a00) checking if image is initramfs... it is Freeing initrd memory: 280k freed NET: Registered protocol family 16 ACPI: bus type pci registered PCI: PCI BIOS revision 2.10 entry at 0xfd9a0, last bus=1 PCI: Using configuration type 1 ACPI: Subsystem revision 20060127 ACPI: Interpreter enabled ACPI: Using PIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (0000:00) PCI quirk: region 1000-103f claimed by PIIX4 ACPI PCI quirk: region 1040-104f claimed by PIIX4 SMB ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 11 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 *9 10 11 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 *11 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 11 14 15) *0, disabled. Linux Plug and Play Support v0.97 (c) Adam Belay pnp: PnP ACPI init pnp: PnP ACPI: found 12 devices usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Using ACPI for IRQ routing PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report PCI: Bridge: 0000:00:01.0 IO window: disabled. MEM window: disabled. PREFETCH window: disabled. Simple Boot Flag at 0x36 set to 0x1 apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac) apm: overridden by ACPI. audit: initializing netlink socket (disabled) audit(1180738716.744:1): initialized Total HugeTLB memory allocated, 0 SELinux: Registering netfilter hooks Initializing Cryptographic API io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered io scheduler cfq registered Limiting direct PCI/PCI transfers. tridentfb: Trident framebuffer 0.7.8-NEWAPI initializing ACPI: Processor [CPU0] (supports 8 throttling states) SyncLink serial driver $Revision: 4.38 $ SyncLink serial driver $Revision: 4.38 $, tty major#254 HDLC line discipline: version $Revision: 4.8 $, maxframe=4096 N_HDLC line discipline registered. Real Time Clock Driver v1.12ac Linux agpgart interface v0.101 (c) Dave Jones agpgart: Detected an Intel 440BX Chipset. agpgart: AGP aperture is 64M @ 0xec000000 [drm] Initialized drm 1.0.1 20051102 PNP: PS/2 Controller [PNP0303:KBC,PNP0f13:MOUS] at 0x60,0x64 irq 1,12 serio: i8042 AUX port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
  • todaygood 2007-06-01 22:11
    好强啊, 我2。6。16的内核在vmware中搞了两天,硬是启动不成功, 生成的initrd2.6.16与原系统中的2.6.5的版本中的linuxrc是一样的,就是不知道为何? 用2.6.6版本的内核,可以启动,发现initrd仍一样的。 好鬼魅啊?
亲,您还没有登录,请[登录][注册]后再进行评论