If I create a disk in Media Manager Virtual Size and Actual Size are similar.
I have reduced size of a vdi disk (Win10) from 300 to 65 Gb.
Is working without problem and the fisical file is shrinked, now in Media Virtual Manager Actual Size is 65Gb but Virtual Size remain 300.
So I have try to convert vdi Standard disk to fixed size disk, the new disk is 300Gb, I have compacted it, after compact same situazion Actual Size is 65 but Virtual Size remain 300.
Howto reduce Virtual Size?
What effect does it have to have a much larger virtualsize than the physical file?
Virtual Size and Effective Size after shrink
-
- Site Moderator
- Posts: 39156
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: Virtual Size and Effective Size after shrink
No they aren't, unless you create a fixed size disk. A dynamic disk is 2MB when first created.PaoloHolzl wrote:If I create a disk in Media Manager Virtual Size and Actual Size are similar.
How did you do that? VirtualBox does not provide a disk shrinkage feature.PaoloHolzl wrote: I have reduced size of a vdi disk (Win10) from 300 to 65 Gb.
Why on earth would you do that? Also you can't compact a fixed size disk. Fixed size disks have... fixed size.PaoloHolzl wrote: So I have try to convert vdi Standard disk to fixed size disk, the new disk is 300Gb
Why do you expect an effect? This is like having a shopping bag which you normally keep folded. When you fill it with stuff the volume will grow. There is no disadvantage attached to keep it folded when not full. And it's usually more convenient (for the host) if it doesn't fill space unnecessarily.PaoloHolzl wrote: What effect does it have to have a much larger virtualsize than the physical file?
-
- Posts: 3
- Joined: 13. Jan 2023, 13:03
Re: Virtual Size and Effective Size after shrink
Ok but if I know that at most I will put 10 kg of stuff into the bag each time, I don't want a one meter bag * one meter.mpack wrote:No they aren't, unless you create a fixed size disk. A dynamic disk is 2MB when first created.PaoloHolzl wrote:If I create a disk in Media Manager Virtual Size and Actual Size are similar.
Ok but after shrink virtual size is 300Gb real 10Gb (file size).
How did you do that? VirtualBox does not provide a disk shrinkage feature.PaoloHolzl wrote: I have reduced size of a vdi disk (Win10) from 300 to 65 Gb.
It is not simple but the system exists.
For a guest system Win you need resize partitions, use program sdelete (download from Microsoft),
Use VBoxManage modifymedium disk diskname.vdi --compact.
You can simply find detail on Internet.
Why on earth would you do that? Also you can't compact a fixed size disk. Fixed size disks have... fixed size.PaoloHolzl wrote: So I have try to convert vdi Standard disk to fixed size disk, the new disk is 300Gb
Ok but if you have a vdi created of 100 Gb and you need only 20 Gb is better reduce IT for disk space, backup ...
Why do you expect an effect? This is like having a shopping bag which you normally keep folded. When you fill it with stuff the volume will grow. There is no disadvantage attached to keep it folded when not full. And it's usually more convenient (for the host) if it doesn't fill space unnecessarily.PaoloHolzl wrote: What effect does it have to have a much larger virtualsize than the physical file?
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Virtual Size and Effective Size after shrink
The Virtual Size is the upper limit that the disk file will grow to.PaoloHolzl wrote:in Media Virtual Manager Actual Size is 65Gb but Virtual Size remain 300.
So the Actual size of the disk file is 65GB today. It can grow to 300GB in the future if the host OS decides to write to the whole disk for whatever reason.
If you no longer want the disk file to grow to 300GB on the host, then after you have the disk file compacted, go into the VM OS's partition manager and shrink the main data partition until all partitions total the final smaller size you want the disk to limit out at. Then the OS will only write to that new smaller partition size and the disk file won't get used the rest of the way on the host.
All of the above applies only to dynamic disk files, not fixed-size disk files.