我花了将近一个星期的时间,我无法弄清楚出了什么问题.
我遵循了以下食谱:
http://blog.maclawran.ca/gotchas-porting-centos-58-from-virtualbox-to
我也尝试过互联网上其他类似的食谱,结果相同.我从上面的配方中改变的唯一事情是:
>使用最新的Centos ISO / repos(5.9)
>有一个分区(/ boot里面/)
>使用ext4而不是ext3的根分区
步骤几乎如下:
>在Virtual Box上安装Centos
>将.vdi磁盘转换为.img
>将磁盘映像上传到AWS
>将图像复制到卷
>对initrd,fstab,grub.conf进行一些更改
>快照量
>创建AMI
>启动新实例
EC2系统日志
Xen Minimal OS! start_info: 0xac4000(VA) nr_pages: 0x26700 shared_inf: 0xbfa11000(MA) pt_base: 0xac7000(VA)nr_pt_frames: 0x9 mfn_List: 0x990000(VA) mod_start: 0x0(VA) mod_len: 0 flags: 0x0 cmd_line: root=/dev/sda1 ro 4 stack: 0x94f860-0x96f860MM: Init _text: 0x0(VA) _etext: 0x5ffbd(VA) _erodata: 0x78000(VA) _edata: 0x80ae0(VA)stack start: 0x94f860(VA) _end: 0x98fe68(VA) start_pfn: ad3 max_pfn: 26700MapPing memory range 0xc00000 - 0x26700000setting 0x0-0x78000 Readonlyskipped 0x1000MM: Initialise page allocator for c01000(c01000)-26700000(26700000)MM: doneDemand map pfns at 26701000-2026701000.Heap resIDes at 2026702000-4026702000.Initialising timer interfaceInitialising console ... done.gnttab_table mapped at 0x26701000.Initialising schedulerThread "IDle": pointer: 0x2026702010,stack: 0x26640000Initialising xenbusThread "xenstore": pointer: 0x20267027c0,stack: 0x26650000Dummy main: start_info=0x96f960Thread "main": pointer: 0x2026702f70,stack: 0x26660000"main" "root=/dev/sda1" "ro" "4" vbd 2049 is hd0******************* BLKFRONT for device/vbd/2049 **********backend at /local/domain/0/backend/vbd/2087/2049Failed to read /local/domain/0/backend/vbd/2087/2049/feature-barrIEr.Failed to read /local/domain/0/backend/vbd/2087/2049/feature-flush-cache.16777216 sectors of 512 bytes**************************Press `ESC' to enter the menu... 1 Press `ESC' to enter the menu... 0 [H [J Booting 'CentOS (2.6.18-348.2.1.el5)'root (hd0,0) filesystem type is ext2fs,partition type 0x83kernel /boot/vmlinuz-2.6.18-348.2.1.el5xen ro root=LABEL=/initrd /boot/initrd-2.6.18-348.2.1.el5xenec2.imgxc_dom_probe_bzimage_kernel: kernel is not a bzImageclose blk: backend at /local/domain/0/backend/vbd/2087/2049Bootdata ok (command line is ro root=LABEL=/)linux version 2.6.18-348.2.1.el5xen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Mar 5 17:05:33 EST 2013BIOS-provIDed physical RAM map: Xen: 0000000000000000 - 0000000026f00000 (usable)No mptable found.Built 1 zoneLists. Total pages: 155531Kernel command line: ro root=LABEL=/Initializing cpu#0PID hash table entrIEs: 4096 (order: 12,32768 bytes)Xen reported: 2666.746 MHz processor.Console: colour dummy device 80x25Dentry cache hash table entrIEs: 131072 (order: 8,1048576 bytes)Inode-cache hash table entrIEs: 65536 (order: 7,524288 bytes)Software IO TLB DisabledMemory: 602796k/637952k available (2559k kernel code,26616k reserved,1762k data,196k init)Calibrating delay using timer specific routine.. 6688.32 BogoMIPS (lpj=13376641)Security Framework v1.0.0 initializedSElinux: Initializing.selinux_register_security: Registering secondary module capabilityCapability LSM initialized as secondaryMount-cache hash table entrIEs: 256cpu: L1 I cache: 32K,L1 D cache: 32Kcpu: L2 cache: 6144Kcpu: Physical Processor ID: 0cpu: Processor Core ID: 3(SMP-)alternatives turned offbrought up 1 cpuschecking if image is initramfs... it isGrant table initializedNET: Registered protocol family 16brought up 1 cpusPCI: setting up Xen PCI frontend stubACPI: Interpreter Disabled.linux Plug and Play Support v0.97 (c) Adam Belaypnp: PnP ACPI: Disabledxen_mem: Initialising balloon driver.usbcore: registered new driver usbfsusbcore: registered new driver hubPCI: System does not support PCIPCI: System does not support PCINetLabel: InitializingNetLabel: domain hash size = 128NetLabel: protocols = UNLABELED CIPSOv4NetLabel: unlabeled traffic allowed by defaultNET: Registered protocol family 2IP route cache hash table entrIEs: 32768 (order: 6,262144 bytes)TCP established hash table entrIEs: 131072 (order: 9,2097152 bytes)TCP bind hash table entrIEs: 65536 (order: 8,1048576 bytes)TCP: Hash tables configured (established 131072 bind 65536)TCP reno registeredaudit: initializing netlink socket (Disabled)type=2000 audit(1363277397.008:1): initializedVFS: disk quotas dquot_6.5.1Dquot-cache hash table entrIEs: 512 (order 0,4096 bytes)Initializing Cryptographic APIalg: No test for crc32c (crc32c-generic)ksign: Installing public key dataLoading keyring- Added public key 1A2C6C3E680FB539- User ID: CentOS (Kernel Module GPG key)io scheduler noop registeredio scheduler anticipatory registeredio scheduler deadline registeredio scheduler cfq registered (default)pci_hotplug: PCI Hot Plug PCI Core version: 0.5rtc: IRQ 8 is not free.Non-volatile memory driver v1.2linux agpgart interface v0.101 (c) Dave Jonesbrd: module loadedXen virtual console successfully installed as xvc0Bootdata ok (command line is ro root=LABEL=/)linux version 2.6.18-348.2.1.el5xen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Mar 5 17:05:33 EST 2013BIOS-provIDed physical RAM map: Xen: 0000000000000000 - 0000000026f00000 (usable)No mptable found.Built 1 zoneLists. Total pages: 155531Kernel command line: ro root=LABEL=/Initializing cpu#0PID hash table entrIEs: 4096 (order: 12,4096 bytes)Initializing Cryptographic APIalg: No test for crc32c (crc32c-generic)ksign: Installing public key dataLoading keyring- Added public key 1A2C6C3E680FB539- User ID: CentOS (Kernel Module GPG key)io scheduler noop registeredio scheduler anticipatory registeredio scheduler deadline registeredio scheduler cfq registered (default)pci_hotplug: PCI Hot Plug PCI Core version: 0.5rtc: IRQ 8 is not free.Non-volatile memory driver v1.2linux agpgart interface v0.101 (c) Dave Jonesbrd: module loadedXen virtual console successfully installed as xvc0Event-channel device installed.Uniform Multi-Platform E-IDE driver Revision: 7.00Alpha2IDe: Assuming 50MHz system bus speed for PIO modes; overrIDe with IDebus=xxIDe-floppy driver 0.99.newIDeusbcore: registered new driver hIDdevusbcore: registered new driver usbhIDdrivers/usb/input/hID-core.c: v2.6:USB HID core driverPNP: No PS/2 controller found. Probing ports directly.i8042.c: No controller found.mice: PS/2 mouse device common for all micemd: md driver 0.90.3 MAX_MD_DEVS=256,MD_SB_disKS=27md: bitmap version 4.39TCP bic registeredInitializing IPsec netlink socketNET: Registered protocol family 1NET: Registered protocol family 17XENBUS: Device with no driver: device/vbd/2049XENBUS: Device with no driver: device/vif/0XENBUS: Device with no driver: device/console/0Initalizing network drop monitor serviceWrite protecting the kernel read-only data: 506kRed Hat nash version 5.1.19.6 startingMounting proc filesystemMounting sysfs filesystemCreating /devCreating initial device nodesSetting up hotplug.Creating block device nodes.Loading ehci-hcd.ko moduleLoading ohci-hcd.ko moduleLoading uhci-hcd.ko moduleUSB Universal Host Controller Interface driver v3.0Loading scsi_mod.ko moduleSCSI subsystem initializedLoading sd_mod.ko moduleLoading libata.ko moduleLoading ata_piix.ko moduleLoading ahci.ko moduleLoading dm-mem-cache.ko moduleLoading dm-mod.ko moduledevice-mapper: uevent: version 1.0.3device-mapper: ioctl: 4.11.6-ioctl (2011-02-18) initialised: dm-devel@redhat.comLoading dm-log.ko moduleLoading dm-region_hash.ko moduleLoading dm-message.ko moduleLoading dm-raID45.ko moduledevice-mapper: dm-raID45: initialized v0.2594lLoading xenblk.ko moduleRegistering block device major 8register_blkdev: cannot get major 8 for sdxen_blk: can't get major 8 with name sdvbd vbd-2049: 19 xlvbd_add at /local/domain/0/backend/vbd/2087/2049Loading xennet.ko modulenetfront: Initialising virtual ethernet driver.netfront: device eth0 has copying receive path.Waiting for driver initialization.Scanning and configuring dmraID supported devicesCreating root device.mkrootdev: expected fs optionsMounting root filesystem.mount: missing mount pointSetting up other filesystems.Setting up new root fssetuproot: moving /dev Failed: No such file or directoryno fstab.sys,mounting internal defaultssetuproot: error mounting /proc: No such file or directorysetuproot: error mounting /sys: No such file or directorySwitching to new root and running init.unmounting old /devunmounting old /procunmounting old /sysswitchroot: mount Failed: No such file or directoryKernel panic - not syncing: Attempted to kill init!
/boot/grub/grub.conf文件
default=0timeout=2hIDdenmenuTitle CentOS (2.6.18-348.2.1.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-348.2.1.el5xen ro root=LABEL=/ initrd /boot/initrd-2.6.18-348.2.1.el5xenec2.img
/ etc / fstab文件
LABEL=/ / ext4 defaults 1 1tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gID=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0
AMI设置:
Root Device: /dev/sda1Kernel ID: aki-8b655dffArchitecture: x86_64Root Device Type: ebsImage Size: 8 GiBBlock Devices: /dev/sda1=snap-4dfffb65:8:true:standard
实例设置:
Root Device: sda1Block Devices: sda1
/boot/initrd-2.6.18-348.2.1.el5xenec2.img中的init脚本
#!/bin/nashmount -t proc /proc /procsetquIEtecho Mounting proc filesystemecho Mounting sysfs filesystemmount -t sysfs /sys /sysecho Creating /devmount -o mode=0755 -t tmpfs /dev /devmkdir /dev/ptsmount -t devpts -o gID=5,mode=620 /dev/pts /dev/ptsmkdir /dev/shmmkdir /dev/mapperecho Creating initial device nodesmknod /dev/null c 1 3mknod /dev/zero c 1 5mknod /dev/urandom c 1 9mknod /dev/systty c 4 0mknod /dev/tty c 5 0mknod /dev/console c 5 1mknod /dev/ptmx c 5 2mknod /dev/rtc c 10 135mknod /dev/tty0 c 4 0mknod /dev/tty1 c 4 1mknod /dev/tty2 c 4 2mknod /dev/tty3 c 4 3mknod /dev/tty4 c 4 4mknod /dev/tty5 c 4 5mknod /dev/tty6 c 4 6mknod /dev/tty7 c 4 7mknod /dev/tty8 c 4 8mknod /dev/tty9 c 4 9mknod /dev/tty10 c 4 10mknod /dev/tty11 c 4 11mknod /dev/tty12 c 4 12mknod /dev/ttyS0 c 4 64mknod /dev/ttyS1 c 4 65mknod /dev/ttyS2 c 4 66mknod /dev/ttyS3 c 4 67echo Setting up hotplug.hotplugecho Creating block device nodes.mkblkdevsecho "Loading ehci-hcd.ko module"insmod /lib/ehci-hcd.ko echo "Loading ohci-hcd.ko module"insmod /lib/ohci-hcd.ko echo "Loading uhci-hcd.ko module"insmod /lib/uhci-hcd.ko mount -t usbfs /proc/bus/usb /proc/bus/usbecho "Loading scsi_mod.ko module"insmod /lib/scsi_mod.ko echo "Loading sd_mod.ko module"insmod /lib/sd_mod.ko echo "Loading libata.ko module"insmod /lib/libata.ko echo "Loading ata_piix.ko module"insmod /lib/ata_piix.ko echo "Loading ahci.ko module"insmod /lib/ahci.ko echo "Loading dm-mem-cache.ko module"insmod /lib/dm-mem-cache.ko echo "Loading dm-mod.ko module"insmod /lib/dm-mod.ko echo "Loading dm-log.ko module"insmod /lib/dm-log.ko echo "Loading dm-region_hash.ko module"insmod /lib/dm-region_hash.ko echo "Loading dm-message.ko module"insmod /lib/dm-message.ko echo "Loading dm-raID45.ko module"insmod /lib/dm-raID45.ko echo "Loading xenblk.ko module"insmod /lib/xenblk.ko echo "Loading xennet.ko module"insmod /lib/xennet.ko echo Waiting for driver initialization.stabilized --hash --interval 1000 /proc/scsi/scsimkblkdevsecho Scanning and configuring dmraID supported devicesecho Creating root device.mkrootdev -t -o defaults,ro echo Mounting root filesystem.mount /sysrootecho Setting up other filesystems.setuprootecho Switching to new root and running init.switchroot
任何帮助是极大的赞赏
古斯塔沃
解决方法 在这两点之间是你的线索mkrootdev: expected fs options...switchroot: mount Failed: No such file or directoryKernel panic - not syncing: Attempted to kill init!
引导加载程序已将内核加载到内存中并解压缩initrd. init进程已经启动并尝试安装永久存储(即:根文件系统),此时卸载initramfs并从永久存储继续引导.
你的initrd无法挂载根文件系统,所以init死了,因此你的内核恐慌.
我会尝试将/和/ boot分离到单独的分区中,并使用ext3.我对Amazon或VirtualBox了解不多,但我知道Red Hat不会支持EL5上的ext4根文件系统,因此它不是预期的或经过测试的用例.
总结以上是内存溢出为你收集整理的linux – 自定义Centos5 AMI内核恐慌全部内容,希望文章能够帮你解决linux – 自定义Centos5 AMI内核恐慌所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)