Opened 8 years ago
Closed 8 years ago
#15983 closed defect (fixed)
VDI image resize yields unbootable VDI
Reported by: | markusvm | Owned by: | |
---|---|---|---|
Component: | virtual disk | Version: | VirtualBox 5.1.6 |
Keywords: | Cc: | ||
Guest type: | Windows | Host type: | Linux |
Description
Using
VBoxManage modifymedium disk <file> --resize <size>
in VirtualBox 5.1.6 r110634 turns the VDI image (no snapshots used) into an unbootable medium, i.e., the MBR is garbage.
In my specific case, the capacity of the image before resize is 64000 MBytes (61599 MBytes size on disk). I tried 68000 MBytes and 72000 MBytes as resize goal. Both operations complete almost instantly without error and
VBoxManage showhdinfo <file>
outputs the correct capacity and unchanged size of disk.
I used resize before with other VirtualBox versions on this image and it was never a problem.
Attachments (4)
Change History (15)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
I couldn't reproduce this so far so it must be dependent on the order the blocks are stored in the image. Can you please extract the first 3145728 bytes of the image before the resize (assuming you still have an unmodified backup) and attach it to the ticket?
by , 8 years ago
Diff of hexdump of the first 3145728 bytes of VDI image before and after resize
comment:3 by , 8 years ago
I added the VDI image header as well as a hexdump diff of the first 3145728 bytes of the original VDI image vs the resized VDI image. Can you see the problem?
comment:5 by , 8 years ago
The header you attached is too short and doesn't contain the full block allocation table, please attach the first 3145728 bytes of the image completely like I asked for previously.
comment:6 by , 8 years ago
I performed a resize with VirtualBox version 5.0.24 r108355 (Ubuntu 16.04.1) and it worked. Hence, there must be a regression in between version 5.0.24 r108355 and version 5.1.6 r110634. I also compiled VirtualBox from the sources (trunk). The bug was also present there.
Note that I cannot send the first 3145728 bytes since they contain actual data. From my understanding of the VDI file format, the data I submitted should be enough to understand the problem. It would be great if you could find the regression.
comment:7 by , 8 years ago
The data you sent is not complete as it chops off a part of the block table which is used to map the logical block number to offsets in the image file. I need the complete table to create an image with which I can hopefully replicate your issue. Your header indicates that real data in the image starts at offset 1048576 which is 1MB into the image, so please attach at least the first 1MB of the image which does not contain any data from the guest.
by , 8 years ago
Attachment: | header.tar.bz2 added |
---|
Header of VDI image before and after resize and hex diff
comment:9 by , 8 years ago
Thanks for the updated header! I was finally able to find the bug and did a fix, please try the latest 5.1 build from our Testbuilds page.
comment:10 by , 8 years ago
It took a while until i could try it out but I am happy to confirm that the fix solved the problem for me. Thank you.
Could somebody please comment on the bug? Thank you.