Page 1 of 1
Bug in modifyhd --compact
Posted: 20. Nov 2012, 16:57
by skoehler
Hi,
when running VBoxManage modifyhd <file> --compact on a fixed VDI file, that actually works and compressed the VDI file. However, afterwards, the file still is of type fixed according to showhdinfo.
Also, various other commands (like modifyhd --resize) report that the VDI file is still fixed.
I have used --compact + --resize in the past, at least once. So this seems to be a regression.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 17:02
by mpack
In VirtualBox version ... ?
If you've found a repeatable bug then you should raise a ticket for it on the BugTracker site.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 17:11
by skoehler
mpack wrote:In VirtualBox version ... ?
If you've found a repeatable bug then you should raise a ticket for it on the BugTracker site.
Virtualbox 4.2.4. Yes, it's repeatable. I'm too lazy to file a ticket right now. I will do that later.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 17:38
by Perryg
Wait a minute. You can't resize a Fixed drive & compacting will not change it to anything else either. Reporting a bug on that will be useless.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 18:04
by skoehler
Perryg wrote:Wait a minute. You can't resize a Fixed drive & compacting will not change it to anything else either. Reporting a bug on that will be useless.
The status quo is:
VBoxManage modifyhd <path to fixed size VDI> --compact is possible. It actually compacts the VDI file.
It seems, you think that it should not be possible to do that (and I think that forbidding that is pretty stupid). Anyhow: one of the two bugs exist:
a) it shouldn't be possible to compact a fixed size VDI (but it is currently possible).
b) Compacting a fixed size VDI should change its type to dynamic (but it currently doesn't).
Try this, if you don't believe me:
Code: Select all
$ VBoxManage createhd --filename Test.vdi --size 32 --format VDI -variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: a0f42cc6-823b-4ef7-bbd5-7826098af029
$ ls -la Test.vdi
-rw------- 1 koehler users 33562624 20. Nov 17:17 Test.vdi
koehler@h3a-wks-buchwald /tmp $ VBoxManage modifyhd Test.vdi --compact
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
$ ls -la Test.vdi
-rw------- 1 koehler users 8192 20. Nov 17:17 Test.vdi
$ VBoxManage showhdinfo Test.vdi
UUID: d85a500b-74a8-47c1-bbef-fd3786e245ea
Accessible: yes
Logical size: 32 MBytes
Current size on disk: 0 MBytes
Type: normal (base)
Storage format: VDI
Format variant: fixed default
Location: /tmp/Test.vdi
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 18:17
by Perryg
You don't think they know?
If you read the manual is states it will not work and if you run the command is says not supported at this time.
So it may be an inconvenience but it is not a bug if it is stated that way to begin with.
At the very most it should be reported as an enhancement request, but certainly not a bug.
Edit: that test does not have data in it, so useless for a test.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 18:19
by skoehler
Perryg wrote:You don't think they know?
If you read the manual is states it will not work and if you run the command is says not supported at this time.
Please re-read my previous post very slowly. The command does NOT say "not supported" at this time.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 18:22
by Perryg
And if you read my original post I said resize a fixed drive is not supported. I would be more interested in seeing the output of the --compact on a drive that actually has data.
Re: Bug in modifyhd --compact
Posted: 20. Nov 2012, 18:34
by skoehler
Perryg wrote:And if you read my original post I said resize a fixed drive is not supported.
Yes, I read that. However, this thread is about --compact. When I opened this thread, --resize was almost merely mentioned as evidence, that the VDI file (after --compact) is still marked as being a fixed size VDI.
Even though I'm still pretty confident, that a combination of --compact and --resize worked in the past on fixed size disks. However, in this thread, I was not complaining about that. I started another thread about that. Again: this is about the incorrect behaviour of --compact.
Perryg wrote:I would be more interested in seeing the output of the --compact on a drive that actually has data.
For what it's worth: --compact still runs. The VDI file actually shrinks in size. The VDI is still marked as fixed size afterwards.
Now don't tell me, you consider it correct, that a VDI file which has 2GB size on disk but 4GB logical size is still marked as a fixed size VDI.