VirtualBox

Opened 10 years ago

Closed 8 years ago

#13405 closed defect (worksforme)

Compact of fixed-size VDI broken

Reported by: soliver84 Owned by:
Component: virtual disk Version: VirtualBox 4.3.12
Keywords: Compact fixed-size Cc:
Guest type: Linux Host type: Windows

Description

Hi, I just broke a set of shared VDI disks.

I was running out of diskspace so i thought it would be a good idea to compact my fixed-size shared disks. Well its not.

I was able to execute the modifyhd --compact command successfull for the fixed-size disks.

Writing to the disks is not persistent anymore.

This is how you can reproduce the bug:

Tested with Ubuntu 14.04 on Windows7 x64 Hosts

Scenario 1: Create Fixed Disks VDI, compact VDI, create partition table, create FS.

Scenario 2: Create Fixed Disks VDI, create partition table, create FS, compact VDI.

  1. Create Disks

1- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename TEST1.vdi --size 256 --format VDI --variant Fixed

2- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename TEST2.vdi --size 256 --format VDI --variant Fixed

1- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd TEST1.vdi --type writethrough --compact

2- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd TEST2.vdi --type writethrough

  1. Attach Disks to VM

1- TEST1.vdi -- /dev/sdb

2- TEST2.vdi -- /dev/sdc

  1. Create partition tables

1- creation of Partiontable failed. fdisk -l /dev/sdb returns nothing.

2- OK

  1. Poweroff vm
  1. Compact TEST2.vdi

2- "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd TEST2.vdi compact

-> Size of VDI ~ 36MB

  1. Start VM

2-

root@1404:~# mount /dev/sdc1 /mnt

root@1404:~# cp /dev/urandom /mnt/out.rnd

cp: Fehler beim Schreiben von »/mnt/out.rnd“: Auf dem Gerät ist kein Speicherplatz mehr verfügbar

cp: »/mnt/out.rnd“ konnte nicht erweitert werden: Auf dem Gerät ist kein Speicherplatz mehr verfügbar

root@1404:~# md5sum

md5sum md5sum.textutils

root@1404:~# md5sum /mnt/out.rnd

60cae031f9476b3b22767881cee55c29 /mnt/out.rnd

root@1404:~# ls -ls /mnt/out.rnd

250817 -rw-r--r-- 1 root root 255832064 Sep 16 10:04 /mnt/out.rnd

  1. Poweroff VM
  1. Check size of VDI File in Hosts

==> STILL ~36MB !!!!!

  1. Startup VM

root@1404:~# mount /dev/sdc1 /mnt

root@1404:~# ls -ls /mnt/out.rnd

ls: Zugriff auf /mnt/out.rnd nicht möglich: Datei oder Verzeichnis nicht gefunden

==> File not found

Cheers Oliver

Change History (2)

comment:1 by aeichner, 10 years ago

This is not reproducible at least on OS X so far (the host shouldn't matter). What exactly do you mean with "shared disks"? That the disks are used by multiple VMs simultaneously or that they only contain data which is shared across multiple VMs but the VMs are not running in parallel? The former shouldn't allow the compaction of VDI images because that would result in data corruption if the image is expanded during a write later. Can you please post the output of the affected images before and after compaction using the following command?

VBoxManage showhdinfo <filename>

Having the VM config files of the affected VMs and at least one VBox.log of one of the VMs would help with investigating this issue further too.

comment:2 by aeichner, 8 years ago

Resolution: worksforme
Status: newclosed

Closing, please reopen if still relevant and you provided the requested information.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use