Opened 12 years ago
Closed 12 years ago
#11982 closed defect (invalid)
Resizing Ubuntu image to 40TB renders it unusable
Reported by: | georgevreilly | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 4.2.12 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | other |
Description
I had a 12GB VDI that was growing full, so I expanded it with
VBoxManage modifyhd Precise\ Pangolin\ 64/Precise\ Pangolin\ 64.vdi \ --resize $((40 * 1024 * 1024))
I inadvertently asked for 40TB instead of 40GB. I was no longer able to use that image. Ubuntu would show a GRUB screen then abort with a disk error. I assume the file system in the VDI was ext4.
I tried to use modifyhd --resize
to shrink the image down to 40GB, but VBoxManage refused to resize it.
Please sanity check --resize
arguments.
Note:
See TracTickets
for help on using tickets.
There is no way to sanity check <code>--resize</code> arguments in the way you expect it. After all a 40TB image is perfectly valid for VDI, as it supports up to almost 4PB. You're apparently bumping into a limitation of grub, freaking out on such large disks.
It is right now an intentional limitation of <code>modifyhd --resize</code> to refuse shrinking an image, because this operation can easily lead to data loss, for very similar reasons as you bumped into: getting the scale wrong.
There are ways to create a new disk image with the old content (actually the new size can be bigger or smaller with this recipe): http://alittletothewright.com/index.php/2009/11/expanding-virtualbox-dynamic-vdis/