Convert Dynamic to Fixed HD

Discussions about using Windows guests in VirtualBox.

Convert Dynamic to Fixed HD

Postby stanley » 20. May 2010, 17:52

I have not been able to find any way to convert an existing vdi from dynamic HD to fixed HD. Neither have I found any way to clone a dynamic HD vdi to a fixed disk HDI. I think I need a fixed HD because some antique software runs out of memory when the dynamic HD has plenty left to expand into. :cry:
stanley
 
Posts: 43
Joined: 14. Jan 2008, 13:49

Re: Convert Dynamic to Fixed HD

Postby mpack » 22. May 2010, 11:53

stanley wrote:I think I need a fixed HD because some antique software runs out of memory when the dynamic HD has plenty left to expand into. :cry:

That makes no sense. The guest has no way to detect the difference between a fixed vs dynamic disk, hence there is no possibility that your guess is correct.

More likely is that you made the maximum drive size too small (dynamic drive files grow to a maximum size selected at creation time, and will not grow above that size limit). Alternatively, the drives main partition was formatted with FAT32 and a file has reached 4GB in size, the FAT32 filesize limit.

If the former is the problem then the drive max size can be increased using the CloneVDI tool - this tool runs natively on Windows hosts, it can also run under Wine or inside a Windows XP+ VM.
mpack
Site Moderator
 
Posts: 13166
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Convert Dynamic to Fixed HD

Postby Forastan » 24. May 2010, 02:37

That makes no sense. The guest has no way to detect the difference between a fixed vs dynamic disk, hence there is no possibility that your guess is correct.
-----Why would the guest be detecting the difference? My comment was that the dynamic expansion failed to operate properly, and I guessed that it was caused by the use of DOS.

More likely is that you made the maximum drive size too small (dynamic drive files grow to a maximum size selected at creation time, and will not grow above that size limit). Alternatively, the drives main partition was formatted with FAT32 and a file has reached 4GB in size, the FAT32 filesize limit.
-----The maximum drive size was 35Gbytes, and it stopped expanding at 9.7Gbytes or thereabouts

If the former is the problem then the drive max size can be increased using the CloneVDI tool - this tool runs natively on Windows hosts, it can also run under Wine or inside a Windows XP+ VM.
-----I had already used the CloneVDI tool to expand the drive up to 35Gbytes, but my WinXP did not expand the dynamic size properly after the expansion was done. VBox correctly indicates the max size is 35Gbytes.

-----Thanks for your comments. I would appreciate any further suggestions about what to do, or an answer to my question about converting from dynamic to fixed memory so I can test my theory.
Forastan
 
Posts: 5
Joined: 7. Apr 2010, 15:45
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP

Re: Convert Dynamic to Fixed HD

Postby mpack » 24. May 2010, 07:02

Please use the "Quote" feature, it provides visual cues which make it easier to read your responses.

In direct answer to your original question, the user manual tells you how to create a fixed size HDD clone: "VBoxManage clonehd <srcfile.vdi> <dstfile.vdi> --variant Fixed". Make sure you have plenty of disk space.

Forastan wrote:
mpack wrote:That makes no sense. The guest has no way to detect the difference between a fixed vs dynamic disk
Why would the guest be detecting the difference? My comment was that the dynamic expansion failed to operate properly, and I guessed that it was caused by the use of DOS.

If a guest behaved differently with fixed vs dynamic VDI then that would imply that, however indirectly, it is able to detect the difference between those two formats. Since that ability is definitely not possible (for technical reasons I won't get into here), it means that the unwanted behaviour you see cannot be caused by this difference.

Forastan wrote:
mpack wrote:More likely is that you made the maximum drive size too small (dynamic drive files grow to a maximum size selected at creation time, and will not grow above that size limit).
The maximum drive size was 35Gbytes, and it stopped expanding at 9.7Gbytes or thereabouts

Then you tell me! The application is telling you it ran out of disk space in the guest filesystem. That usually means that the partition is too small (the only other time it happens is with the FAT32 issue I mentioned). If you already expanded the drive size, did you also remember to expand the partition?

I think you have a misunderstanding about dynamic disks. They are not "dynamically expanding" in the sense that you seem to expect - no guest OS I know of has support for disk drives or partitions that change dynamically in apparant size. A dynamic disk is instead "dynamically allocated"; meaning that to the guest it's a fixed size disk as always (which is one reason why it can't tell the difference between dynamic vs fixed), but host space for each 1MB block of the disk is only allocated when that block is first written to by the guest. There is no corresponding shrinkage feature - the disk can only grow on demand until all blocks are allocated, then it's the same as a fixed VDI. In other words the only difference between fixed and dynamic is that the former has all of its blocks allocated at creation time, the latter allocates each block on demand. Both drives have the same number of blocks, i.e. the same capacity, hence both will run out of space at the same time as far as the guest OS is concerned. If the host ran out of space first then the guest would see a write error, not an "out of space" error.
mpack
Site Moderator
 
Posts: 13166
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Convert Dynamic to Fixed HD

Postby Forastan » 7. Jun 2010, 18:30

Problem solved. I created a fixed size VM, loaded the applications just as before, and did not get the Out of Space error that I got with the dynamically expanding storage. My hypothesis appears to be correct; the antique DOS-based programs I am using do not interface well with the VM software that dynamically expands the hard drive up to the stated capacity. Googling this states that it is not only my program that had this problem and going to fixed-size disks solves it.

I'll just use fixed-size disks whenever I have old software with huge storage requirements that I need to run. The problem likely doesn't occur too often, so I don't suppose it is worthwhile putting in a change request. Also, the software I use is not publically available, so I don't know a VB person would be able to test the change.

Thanks to all!
Forastan
 
Posts: 5
Joined: 7. Apr 2010, 15:45
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP

Re: Convert Dynamic to Fixed HD

Postby mpack » 7. Jun 2010, 19:14

Forastan wrote:Problem solved. I created a fixed size VM, loaded the applications just as before, and did not get the Out of Space error that I got with the dynamically expanding storage. My hypothesis appears to be correct;

No, your hypothesis is impossible, as I already told you at some length. The significant change you undoubtedly made here is that when you created a new and larger hdd, you also created a new and larger partition to fill it (unlike before when you enlarged the hdd but neglected to resize the partition). The fact that the new hdd has a fixed size is completely irrelevant.
mpack
Site Moderator
 
Posts: 13166
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Convert Dynamic to Fixed HD

Postby Master Control » 5. Mar 2011, 05:02

The source can be a dynamic VDI, and it will produce a "fixed" size VDI at the destination.

Code: Select all   Expand viewCollapse view
 
VBoxManage clonehd <path/to/source.vdi> <path/to/destination.vdi> --variant Fixed
End of Line.
Master Control
 
Posts: 1
Joined: 5. Mar 2011, 04:55
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows 7 Pro 64bit

Re: Convert Dynamic to Fixed HD

Postby mpack » 5. Mar 2011, 11:17

Way to miss the point! In any case that info was already given - 2nd para of 4th message.
mpack
Site Moderator
 
Posts: 13166
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP


Return to Windows Guests

Who is online

Users browsing this forum: No registered users and 7 guests