[vbox-dev] vhd resize corruption

Alexander Eichner Alexander.Eichner at oracle.com
Mon Sep 8 11:24:03 GMT 2014


Hi Aaron,

sorry for the late answer (was on vacation last week). I’m not able to reproduce the
resize corruption you report (I was never able to looking at the mentioned ticket).
Which tool did you use to create the original VHD image?

Regards,
Alexander Eichner

On 29.08.2014 21:14, Aaron Brice <aaron.brice at datasoft.com> wrote:

> So the 40GB .vhd file that contained a Windows 7 VM was running out of 
> room, and I wanted to resize it.
> 
> With VBoxManage 4.3.10 on Ubuntu I ran:
> 
> VBoxManage modifyhd --resize 61440
> 
> Anyway, long story short it won't boot, gparted live ISO doesn't find a 
> partition table..
> 
> So I started investigating the .vhd file format.  There is 512 bytes in 
> the beginning consisting of a copy of the footer, then 1024 bytes of the 
> header, then a variably sized BAT (Block Allocation Table), then the 
> blocks of data.  When the max size of the disk changes the BAT has to be 
> resized to accommodate potential new blocks.  It looks like modifyhd 
> resizes the BAT, but did not shift the BAT pointers or move the data, it 
> just expanded the BAT into the first data block, wiping out the MBR.  I 
> don't have the original for comparison, but now the first entry in the 
> BAT is 0xa3 (163).  This used to point to the sector just after the BAT, 
> but now the BAT has expanded (from 20480 4-byte entries to 30720) and 
> sector 163 is entry 20481 in the table, and the MBR table is all 0xff's..
> 
> Relevant bug: https://www.virtualbox.org/ticket/11960
> 
> Thanks,
> Aaron
> 
> 
> 
> 
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list