Skip to content

Instantly share code, notes, and snippets.

@tsangwpx
Created May 21, 2022 11:12
Show Gist options
  • Save tsangwpx/b404bf4b40433023b70abdd0b1072ad0 to your computer and use it in GitHub Desktop.
Save tsangwpx/b404bf4b40433023b70abdd0b1072ad0 to your computer and use it in GitHub Desktop.
HyperV guest resume into broken state

Description

After Hyper-V host shutdown / reboot, the guest machine had been saved and was resumed into broken state. Block drives were inaccessible and the guest kernel issued I/O errors. Those virtual disk are vhdx files located in BitLocker-enabled hypervisor drives.

The problem is likely that the BitLocker drives is still locked during guest resume, even though autounlock is enabled. This is because SATA drives are removable by default and auto-unlocking removable drives require user login? Since Fast Startup is enabled, windows save its hypervisor state (including guest?) after user logout. When host boot, the hypervisor state is directly resumed from disk. However, those drives containing required vhdx files are not unlocked (no credential available?) so guests run into broken state.

Solutions

  1. Disable Fast Startup[1]. [1]: https://www.google.com/search?q=disable%20fast%20startup

  2. Move vhdx files into non-BitLocker drives or fixed-drives (eg. NVMe SSD), so those files are accessible during boot.

  3. (untested) Mark drives non-removable by editing registry. [2] [2]: https://superuser.com/questions/1127994/can-i-mark-a-hard-drive-as-non-removable

Some dmsg

Aborting journal on device sda2-8.
blk_update_request: I/O error, dev sda, sector 131336192 op 0x1: (WRITE) flags 0x800 phys_seg 1 prio class 0
Buffer I/O error on dev sda2, logical block 15204427, lost async page write
Buffer I/O error on dev sda2, logical block 16285696, lost sync page write
JBD-2: Error -5 detected when updating journal superblock for sda2-8.
EXT4-fs (sda2): I/O error while writing superblock
EXT4-fs error (device sda2): ext4_journal_check_start:83: Detected aborted journal
EXT4-fs (sda2): Remounting filesystem read-only
...
EXT4-fs error (device sda2): ext4_dirt_inode:6002: inode #3670027: comm rs:main Q:Reg: mark_inode_dirty error
...
EXT4-fs (sda2): failed to convert unwritten extents to written extents -- potential data loss! (inode 51118414, error -30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment