gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 10:58:42 26 4
gpt4 key购买 nike

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

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

我有一个非常相似的虚拟机,一直运行良好。两个系统上的 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 存储空间设备(Microsoft RAID-ish 技术)上。

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

最佳答案

事实证明,主机 Hyper-V 服务器的磁盘空间不足。

由于之间存在多个间接级别:

  1. 真实物理磁盘
  2. 虚拟磁盘(由物理磁盘上的 Windows 存储空间托管)
  3. 磁盘镜像(托管在虚拟磁盘上的动态 .vhdx 文件)
  4. Linux 文件系统(托管在动态磁盘镜像上)

各个级别实际填满并将错误传递到下一个级别需要一些时间。最终表明该问题的是另一台 VM 提示磁盘空间不足(但仅在完成约 4 GB 的 Ubuntu 安装后!)。

我更换了其中一个磁盘(500 GB => 4 TB),并将其添加到存储池中,这让一切都恢复正常。然后我用一些 PowerShell commands 重建了磁盘池(Windows Server 用户界面无法正常工作):

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

关于linux - 在 Hyper-V 上安装 Ubuntu 时,磁盘变为只读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27830812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com