VirtualBox

Opened 7 years ago

Closed 7 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)

header.vdi (254.0 KB ) - added by markusvm 7 years ago.
Header of VDI image before resize
diff.txt (2.0 KB ) - added by markusvm 7 years ago.
Diff of hexdump of the first 3145728 bytes of VDI image before and after resize
header.tar.bz2 (82.7 KB ) - added by markusvm 7 years ago.
Header of VDI image before and after resize and hex diff
header.zip (185.5 KB ) - added by markusvm 7 years ago.
Content of header.tar.bz2 as zip archive

Download all attachments as: .zip

Change History (15)

comment:1 by markusvm, 7 years ago

Could somebody please comment on the bug? Thank you.

comment:2 by aeichner, 7 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 markusvm, 7 years ago

Attachment: header.vdi added

Header of VDI image before resize

by markusvm, 7 years ago

Attachment: diff.txt added

Diff of hexdump of the first 3145728 bytes of VDI image before and after resize

comment:3 by markusvm, 7 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:4 by markusvm, 7 years ago

Is there any progress on the bug?

comment:5 by aeichner, 7 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 markusvm, 7 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 aeichner, 7 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 markusvm, 7 years ago

Attachment: header.tar.bz2 added

Header of VDI image before and after resize and hex diff

comment:8 by markusvm, 7 years ago

I added the image header before and after resize including hex diff.

by markusvm, 7 years ago

Attachment: header.zip added

Content of header.tar.bz2 as zip archive

comment:9 by aeichner, 7 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 markusvm, 7 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.

comment:11 by Frank Mehnert, 7 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 5.1.10.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use