在Hyper-V上安装Ubuntu时,磁盘变为只读

时间:2015-01-07 23:56:06

标签: linux hyper-v

我正在尝试在基于Hyper-V Gen1的VM上的Windows Server 2012 R2上安装Ubuntu 12.04.5服务器(64位)。安装将随机挂起,dmesg最终会显示错误,如:

sd 2:0:0:0: rejecting I/O to offline device

我有一个非常相似的VM,一直运行良好。两个系统上的dmesg输出首先在启动后大约126秒发散(尽管这可能是因为它是安装程序引导,而不是标准引导):

[  126.482972] NTFS driver 2.1.30 [Flags: R/O MODULE].
xor: measuring software checksum speed
   prefetch64-sse: 16009.000 MB/sec
   generic_sse: 15008.000 MB/sec
xor: using function: prefetch64-sse (16009.000 MB/sec)
raid6: sse2x1    9322 MB/s
raid6: sse2x2   11511 MB/s
raid6: sse2x4   13061 MB/s
raid6: using algorithm sse2x4 (13061 M/s)
raid6: using intx recovery algorithm
bio: create slab <bio-1> at 1
Btrfs loaded
JFS: nTxBlock = 7892, nTxLock = 63140
SGI XFS with ACLs, security attributes, realtime, large block/inode, numbers, no debug enabled
EXT4-fs (sda1): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sda1): couldn't mount as ext2 due to feature incompatibilities
EXT4-fs (sda1): INFO: recovery required on readonly filesystem
EXT4-fs (sda1): write access unavailable, cannot proceed
EXT4-fs (sda1): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sda1): couldn't mount as ext2 due to feature incompatibilities
EXT4-fs (sda1): INFO: recovery required on readonly filesystem
[  127.334559] EXT4-fs (sda1): write access unavailable, cannot proceed

过了一段时间,

[  182.830804] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: errors=remount-ro
[  230.779000] hv_storvsc vmbus_0_1: cmd 0x2a scsi status 0x2 srb status 0xa
               (repeated x times...)
[  241.151746] hv_storvsc vmbus_0_1: cmd 0x3 scsi status 0x2 srb status 0x8
               (also repeated x times)
[  251.155963] hv_storvsc vmbus_0_1: cmd 0x0 scsi status 0x2 srb status 0x8
[  251.155973] sd 2:0:0:0: Device offlined - not ready after error recovery
               (repeated x times again)
[  251.155987] sd 2:0:0:0: [sda] Unhandled error code
[  251.155988] sd 2:0:0:0: [sda]
[  251.155989] Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[  251.155991] sd 2:0:0:0: [sda] CDB:
[  251.155992] Write(10): 2a 00 04 c1 09 00 00 00 08 00
[  251.155996] end_request: I/O error, dev sda, sector 79759616
[  251.155999] Buffer I/O error on device sda1, logical block 9969696
[  251.156000] lost page write due to I/O error on sda1
[  251.156011] sd 2:0:0:0: rejecting I/O to offline device

最终渗透到EXT4驱动程序。 使用EXT3,会显示类似的错误消息,但驱动程序从不调用它,因此安装只会挂起。


注意:

Windows Azure-based (cloud) VMs似乎发生了类似的事情。链接页面建议您停止并启动VM,这意味着将其移动到其他主机。

This thread提到Hyper-V会在底层磁盘返回错误时停止I / O,并且此停顿会导致奇怪的行为。

  • VHDX磁盘映像位于Windows Storage Space设备上(Microsoft RAID-ish技术)。

This thread表明它特定于将storvsc驱动程序与ext4文件系统一起使用,而不支持SCSI WRITE_SAME命令。这将被检入Linux内核3.9-rc1,并且肯定包含在Ubuntu 12.04.5附带的Linux 3.13内核中。

1 个答案:

答案 0 :(得分:1)

事实证明,主机Hyper-V服务器的磁盘空间已用尽。

由于在:

之间存在多个间接级别
  1. 真实物理磁盘
  2. 虚拟磁盘(由物理磁盘上的Windows Storage Spaces托管)
  3. 磁盘映像(虚拟磁盘上托管的动态.vhdx文件)
  4. Linux文件系统(托管在动态磁盘映像上)
  5. 花了一些时间让各个级别实际填满并将错误传递到下一级别。最后表明问题的是另一个虚拟机抱怨磁盘空间不足(但只有在完成了大约4 GB的Ubuntu安装后!)。

    我更换了其中一个磁盘(500 GB =&gt; 4 TB),并将其添加到存储池中,这使得一切都恢复正常。然后我用一些PowerShell commands重建了磁盘池(Windows Server UI无效):

    Get-PhysicalDisk
    $missingDisk = Get-PhysicalDisk | Where-Object { $_.OperationalStatus -eq 'Lost Communication' }
    $missingDisk | Set-PhysicalDisk -Usage Retired
    Repair-VirtualDisk –FriendlyName <VolumeName>