Filesystems Google计算引擎VM实例:VFS:无法在未知块上装载根fs

Filesystems Google计算引擎VM实例:VFS:无法在未知块上装载根fs,filesystems,google-compute-engine,boot,disk,Filesystems,Google Compute Engine,Boot,Disk,我在Google Compute Engine上的实例没有启动,因为有一些启动顺序问题 因此,我创建了另一个实例并重新配置了我的机器 我的问题是: 当我主持一些网站时,如何处理这些问题 如何从旧磁盘恢复数据 日志 [ 0.348577] Key type trusted registered [ 0.349232] Key type encrypted registered [ 0.349769] AppArmor: AppArmor sha1 policy h

我在Google Compute Engine上的实例没有启动,因为有一些启动顺序问题

因此,我创建了另一个实例并重新配置了我的机器

我的问题是:

  • 当我主持一些网站时,如何处理这些问题
  • 如何从旧磁盘恢复数据
  • 日志

    [ 0.348577] Key type trusted registered [ 0.349232] Key type encrypted registered [ 0.349769] AppArmor: AppArmor sha1 policy hashing enabled [ 0.350351] ima: No TPM chip found, activating TPM-bypass! [ 0.351070] evm: HMAC attrs: 0x1 [ 0.351549] Magic number: 11:333:138 [ 0.352077] block ram3: hash matches [ 0.352550] rtc_cmos 00:00: setting system clock to 2015-12-19 17:06:53 UTC (1450544813) [ 0.353492] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found [ 0.354108] EDD information not available. [ 0.536267] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2 [ 0.537862] md: Waiting for all devices to be available before autodetect [ 0.538979] md: If you don't use raid, use raid=noautodetect [ 0.539969] md: Autodetecting RAID arrays. [ 0.540699] md: Scanned 0 and added 0 devices. [ 0.541565] md: autorun ... [ 0.542093] md: ... autorun DONE. [ 0.542723] VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6 [ 0.543731] Please append a correct "root=" boot option; here are the available partitions: [ 0.545011] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 0.546199] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-39-generic #44~14.04.1-Ubuntu [ 0.547579] Hardware name: Google Google, BIOS Google 01/01/2011 [ 0.548728] ffffea00008ae140 ffff880024ee7db8 ffffffff817af92b 000000000000111e [ 0.549004] ffffffff81a7c7c8 ffff880024ee7e38 ffffffff817a976b ffff880024ee7dd8 [ 0.549004] ffffffff00000010 ffff880024ee7e48 ffff880024ee7de8 ffff880024ee7e38 [ 0.549004] Call Trace: [ 0.549004] [] dump_stack+0x45/0x57 [ 0.549004] [] panic+0xc1/0x1f5 [ 0.549004] [] mount_block_root+0x210/0x2a9 [ 0.549004] [] mount_root+0x54/0x58 [ 0.549004] [] prepare_namespace+0x16d/0x1a6 [ 0.549004] [] kernel_init_freeable+0x1f6/0x20b [ 0.549004] [] ? initcall_blacklist+0xc0/0xc0 [ 0.549004] [] ? rest_init+0x80/0x80 [ 0.549004] [] kernel_init+0xe/0xf0 [ 0.549004] [] ret_from_fork+0x58/0x90 [ 0.549004] [] ? rest_init+0x80/0x80 [ 0.549004] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 0.549004] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [0.348577]密钥类型受信任已注册 [0.349232]密钥类型加密已注册 [0.349769]AppArmor:AppArmor sha1策略哈希已启用 [0.350351]ima:未找到TPM芯片,正在激活TPM旁路! [0.351070]evm:HMAC属性:0x1 [0.351549]幻数:11:333:138 [0.352077]块ram3:哈希匹配 [0.352550]rtc_cmos 00:00:将系统时钟设置为2015-12-19 17:06:53 UTC(1450544813) [0.353492]BIOS EDD设施v0.16 2004-Jun-25,找到0个设备 [0.354108]EDD信息不可用。 [0.536267]输入:在转换后的第2组键盘上,输入为/devices/platform/i8042/serio0/input/input2 [0.537862]md:在自动检测之前等待所有设备可用 [0.538979]md:如果不使用raid,请使用raid=noautodetect [0.539969]md:自动检测RAID阵列。 [0.540699]md:扫描了0个设备并添加了0个设备。 [0.541565]md:自动运行。。。 [0.542093]md:。。。自动运行完成。 [0.542723]VFS:无法打开根设备“sda1”或未知块(0,0):错误-6 [0.543731]请附加正确的“root=”引导选项;以下是可用的分区: [0.545011]内核死机-不同步:VFS:无法在未知块(0,0)上装载根fs [0.546199]CPU:0 PID:1通信:交换程序/0未受污染3.19.0-39-generic#44~14.04.1-Ubuntu [0.547579]硬件名称:谷歌,BIOS谷歌2011年1月1日 [0.548728]FFFFA00008AE140 ffff880024ee7db8 ffffffff817af92b 000000000000 111E [0.549004]FFFFFF 81A7C7C8 ffff880024ee7e38 FFFFFFFF 817A976B ffff880024ee7dd8 [0.549004]FFFFFF00000010 ffff880024ee7e48 ffff880024ee7de8 ffff880024ee7e38 [0.549004]呼叫跟踪: [0.549004][]转储堆栈+0x45/0x57 [0.549004][]死机+0xc1/0x1f5 [0.549004][]安装块根目录+0x210/0x2a9 [0.549004][]装载根目录+0x54/0x58 [0.549004][]准备_名称空间+0x16d/0x1a6 [0.549004][]内核初始化可释放+0x1f6/0x20b [ 0.549004] [] ? initcall_黑名单+0xc0/0xc0 [ 0.549004] [] ? rest_init+0x80/0x80 [0.549004][]内核初始化+0xe/0xf0 [0.549004][]从叉子上收回+0x58/0x90 [ 0.549004] [] ? rest_init+0x80/0x80 [0.549004]内核偏移量:0x0自0xFFFFFF81000000(重定位范围:0xFFFFFF80000000-0xFFFFFFFFFFFFFFFF) [0.549004]-[end Kernel panic-未同步:VFS:无法在未知块(0,0)上装载根fs
  • 当我主持一些网站时,如何处理这些问题
  • 我不知道你是如何陷入这种情况的,但如果能有更多的信息(见我上面的评论)来理解是什么引发了这个问题,那就太好了

  • 如何从旧磁盘恢复数据
  • 连接并装入磁盘 假设在删除实例时没有删除原始磁盘,只需从另一个VM装载此磁盘即可从中读取数据。要执行此操作,请执行以下操作:

  • ,例如:

    gcloud计算实例连接磁盘$INSTANCE--disk$disk

  • 装载磁盘:

    sudo mkdir-p/mnt/disks/[mnt\u DIR]

    sudo mount[OPTIONS]/dev/disk/by id/google-[disk\u NAME]/mnt/disks/[mnt\u DIR]

    注意:您需要用适当的值替换:

    • MNT\u DIR
      :目录
    • 选项
      :适合您的磁盘和文件系统的选项
    • DISK\u NAME
      :将磁盘连接到虚拟机后的磁盘id
  • 卸载和分离磁盘 使用完磁盘后,请反向执行以下步骤:

    注意:分离非根磁盘之前,请先卸载磁盘。分离已装载的磁盘可能会导致I/O操作不完整和数据损坏。

  • 卸载磁盘

    sudo umount/dev/disk/by id/google-[disk\u NAME]

  • :

    gcloud计算实例分离磁盘$INSTANCE--设备名称我的新设备

  • 这是什么原因? 这就是百万美元的问题。在检查我的GCE虚拟机后,我发现安装了14个不同的内核,占用了数百MB的空间。大多数内核没有相应的initrd.img文件,因此无法启动(包括3.19.0-39-generic)

    我当然从来没有尝试过安装随机内核,一旦删除,它们就不再显示为可用的升级,所以我不确定发生了什么。说真的,发生了什么

    编辑:来自谷歌云支持的新响应。

    我收到了另一个令人不安的回复。这也许可以解释额外的错误内核

    “在极少数情况下,VM需要从一个物理主机迁移到另一个物理主机。在这种情况下,Google可能会应用内核升级和安全补丁。”

    1.“当我主持一些网站时,如何处理这些问题?” 我的第一反应是建议使用AWS而不是GCE。但是,GCE比较便宜。在进行任何升级之前,请确保拍摄快照,并尝试重新启动服务器,以查看升级是否有问题

    2.如何从旧磁盘恢复数据? 更好-如何恢复您的实例。。。 经过几封来来回回的电子邮件,我终于收到了支持部门的回复,这让我得以解决这个问题。请注意,您必须更改内容以匹配您独特的虚拟机

  • 先拍一张磁盘快照,以防丢失
    # Run fsck to fix any disk corruption issues
    $ sudo fsck.ext4 -a /dev/sdb1
    
    # Mount the disk from the broken vm
    $ sudo mkdir /mnt/sdb
    $ sudo mount /dev/sdb1 /mnt/sdb/ -t ext4
    
    # Find out the UUID of the broken disk. In this case, the uuid of sdb1 is d9cae47b-328f-482a-a202-d0ba41926661
    $ ls -alt /dev/disk/by-uuid/
    lrwxrwxrwx. 1 root root 10 Jan 6 07:43 d9cae47b-328f-482a-a202-d0ba41926661 -> ../../sdb1
    lrwxrwxrwx. 1 root root 10 Jan 6 05:39 a8cf6ab7-92fb-42c6-b95f-d437f94aaf98 -> ../../sda1
    
    # Update the UUID in grub.cfg (if necessary)
    $ sudo vim /mnt/sdb/boot/grub/grub.cfg
    
    # Flush all changes to disk
    $ sudo sync
    
    # Shut down the temporary instance
    $ sudo shutdown -h now
    
    dpkg -l | grep 3.19.0-51-generic
         iF  linux-image-3.19.0-51-generic       3.19.0-51.58~14.04.1         
         iU  linux-image-extra-3.19.0-51-generic 3.19.0-51.58~14.04.1 
    
     unattended-upgrades-dpkg_2016-03-10_06:49:42.550403.log:update-initramfs: Generating /boot/initrd.img-3.19.0-51-generic
     Killed
     E: mkinitramfs failure cpio 141 xz -8 --check=crc32 137
     unattended-upgrades-dpkg_2016-03-10_06:49:42.550403.log:update-initramfs: failed for /boot/initrd.img-3.19.0-51-generic with 1.
    
     dpkg --force-confold --configure -a