Page 1 of 1

[SOLVED] How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 12:13
by macias
Hi,

Before I begin -- yes, it is VDI disk, yes, it is dynamic, and yes -- I try to increase the size of it. So 3 common mistakes are avoided by me.

The disk is 40GB now, I would like to make it 80GB.

So far I tried VB 4.1, when using it I had to use UUID to specify the disk, because I used filename VB claimed the disk is already in use. However even with UUID the result was an error "Resize hard disk operation for this format is not implemented yet".

Then I tried VB 4.2 (the latest one), now the error message changed to "The given path 'here goes UUID' is not fully qualified".

I also tried to do the resizing from root account, no success.

I call VB like thise:

Code: Select all

VBoxManage modifyhd UUID_of_the_VDI_disk --resize 80000
So how to resize it?

Kind regards.

Re: How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 13:55
by mpack
Are you using snapshots in this VM?

Other than that, there is no particular reason why what you've tried should not have worked. Given the error message I would suspect that you already really using a dynamic VDI - perhaps it's some other format that has mistakenly been given a .VDI extension. To settle this you can issue the showhdinfo command, ie. :-

Code: Select all

VBoxManage showhdinfo <disk image filename>
... and post the output here.

Please also provide an explicit example of an command you are using: I want actual filenames or actual UUIDs, no placeholders.

Re: How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 15:25
by macias
No snapshots.

The output:

Code: Select all

UUID:                 3cf99bd8-b052-4d43-aaa4-97ffe39e23ca
Accessible:           yes
Logical size:         122880 MBytes
Current size on disk: 36814 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /home/kitten/VDI/./Win7 Devel.vdi
I noticed that there is a huge difference between logical and physical size, so just in case I also increased the size even further. Explicit command is:

Code: Select all

VBoxManage modifyhd 3cf99bd8-b052-4d43-aaa4-97ffe39e23ca --resize 200000
and executed with regular user (owner) or root.

The effects are exactly the same I described in OP.

Re: How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 15:29
by macias
SOLVED (kind of):

The difference in sizes made me to downgrade VB back to 4.1, and tried to resize from there. For root it failed, but for regular user (owner) it finally worked.

So for one thing it was my mistake (Windows 7 reported no free space, and I assumed at this point both sizes would be equal), but for another -- 4.2 latest release has a bug somewhere, because it is not capable of resize of a disk (vdi) that 4.1 is.

Re: [SOLVED] How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 19:33
by mpack
I rather doubt that 4.2 has a new bug, since I can't imagine any reason the devteam would have had to change this code. It looks like you were passing the wrong parameters, e.g. you were shrinking the disk. That, plus of course you need appropriate permission to modify files in certain folders.

Re: [SOLVED] How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 22:19
by macias
Bash has history recall (up arrow), so in one terminal I was installing and reinstalling VirtualBoxes, and after each change, in the second terminal I simply was executing the same command over and over again by hitting up arrow. I didn't type it manually.

So I doubt it was because of my some mistake, because it was *exactly* the command I executed a second ago for 4.2. In 4.2 it didn't work (note the odd error) for 4.2 and it did for 4.1.

Re: [SOLVED] How to resize dynamic VDI disk?

Posted: 28. Oct 2012, 22:50
by Perryg
Well for what ever reason I don't see this as a bug, simply because it does not happen to me (I just tested it again) and I also don't see others reporting it. Have joy in the fact that what you wanted is now working. Hopefully you will not see this again.