Recovering a VHD after resizing it using VBoxManage
- by tjrobinson
I am using VirtualBox 4.1.18 and had a virtual machine running Windows 8 RC with a single VHD, which was initially sized at 25GB (too small!).
After installing the OS and some applications I ran out of disk space so shut down the guest and then used this command to resize the VHD to 80GB:
C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe modifyhd "D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vhd" --resize 81920
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe showhdinfo "D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vhd"
UUID: 03fb26e7-d8bb-49b5-8cc2-1dc350750e64
Accessible: yes
Logical size: 81920 MBytes
Current size on disk: 24954 MBytes
Type: normal (base)
Storage format: VHD
Format variant: dynamic default
In use by VMs: Windows 8 RC (UUID: a6e6aa57-2d3a-421b-8042-7aae566e3e0b)
Location: D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vhd
So far so good. However, when I started the guest up again I got the dreaded:
Fatal: No bootable medium found! system halted
If I boot into GParted it shows a single 80GB drive as "unallocated". The option to scan for and attempt to repair a filesystem doesn't find anything.
I also tried cloning the VHD into a VDI file, just in case that magically fixed it:
C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe clonehd "D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vhd" "D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vdi" --format VDI
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: baf0c2c4-362f-4f6c-846a-37bb1ffc027b
C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe showhdinfo "D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vdi"
UUID: baf0c2c4-362f-4f6c-846a-37bb1ffc027b
Accessible: yes
Logical size: 81920 MBytes
Current size on disk: 24798 MBytes
Type: normal (base)
Storage format: VDI
Format variant: dynamic default
In use by VMs: Windows 8 RC (UUID: a6e6aa57-2d3a-421b-8042-7aae566e3e0b)
Location: D:\VirtualBox VMs\Windows 8 RC\Windows 8 RC.vdi
Is there anything else I could try to recover the drive?
No, I don't have a backup :(
My host OS is Windows 7 64-bit.