vhd is corrupted after modifyhd crashed

Discussions related to using VirtualBox on Windows hosts.
Post Reply
txh
Posts: 1
Joined: 17. Aug 2018, 11:15

vhd is corrupted after modifyhd crashed

Post by txh »

While a resize cmd for a given vhd ran, there was a power outage which rebooted the pc.

Code: Select all

vboxmanage modifyhd "D:\vhds\filename.vhd" --resize 112640
After rebooting the vhd is no longer accessible.

Code: Select all

C:\Program Files\Oracle\VirtualBox>vboxmanage showhdinfo "d:\vhds\filename.vhd"
UUID: b8f612f1-6410-4057-938a-b6ff3c57631c
Parent UUID: base
State: inaccessible
Access Error: Could not open the medium 'D:\VHDs\filename.vhd'.
VD: Image file 'D:\VHDs\filename.vhd' is corrupted and can't be opened (VERR_VD_IMAGE_CORRUPTED)
Type: normal (base)
Location: D:\VHDs\filename.vhd
Storage format: VHD
Format variant: dynamic default
Capacity: 0 MBytes
Size on disk: 0 MBytes
Encryption: disabled
In use by VMs: filename.vhd (UUID: 39904c95-9280-47ad-a29b-003563cf157e)
The following cmd also ends with error message "Failed to resize medium".

Code: Select all

vboxmanage modifymedium "d:\vhds\filename.vhd" --resizebyte 118111600640
Is there a way I don't know to solve this problem?

Thanks in advance.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: vhd is corrupted after modifyhd crashed

Post by mpack »

txh wrote: Is there a way I don't know to solve this problem?
Not really, unless you count travelling back in time to reverse the decision to use the corruption-prone VHD format, along with the decision to make major changes to a VM without making a backup first.

There are absolutely no guarantees, but you can try cloning the VHD (to VDI) with CloneVDI. CloneVDI doesn't bother validating the footer (which is likely what got corrupted), so it sometimes works where VirtualBox doesn't. Even if it works there is a good chance that the guest filesystem will need some repair.
Post Reply