[SOLVED] How to resize dynamic VDI disk?

Discussions related to using VirtualBox on Linux hosts.

[SOLVED] How to resize dynamic VDI disk?

Postby macias » 28. Oct 2012, 12:13

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   Expand viewCollapse view
VBoxManage modifyhd UUID_of_the_VDI_disk --resize 80000


So how to resize it?

Kind regards.
Last edited by macias on 28. Oct 2012, 15:30, edited 1 time in total.
macias
 
Posts: 9
Joined: 26. Sep 2007, 20:31

Re: How to resize dynamic VDI disk?

Postby mpack » 28. Oct 2012, 13:55

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   Expand viewCollapse view
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.
mpack
Site Moderator
 
Posts: 13156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to resize dynamic VDI disk?

Postby macias » 28. Oct 2012, 15:25

No snapshots.

The output:

Code: Select all   Expand viewCollapse view
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   Expand viewCollapse view
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.
macias
 
Posts: 9
Joined: 26. Sep 2007, 20:31

Re: How to resize dynamic VDI disk?

Postby macias » 28. Oct 2012, 15:29

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.
macias
 
Posts: 9
Joined: 26. Sep 2007, 20:31

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

Postby mpack » 28. Oct 2012, 19:33

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.
mpack
Site Moderator
 
Posts: 13156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

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

Postby macias » 28. Oct 2012, 22:19

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.
macias
 
Posts: 9
Joined: 26. Sep 2007, 20:31

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

Postby Perryg » 28. Oct 2012, 22:50

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.
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 13 guests