0

I have a large raid 5 volume in virtualbox windows server 2008 encrypted with Truecrypt, i wanted to decrypt the entire volume, and so i clicked on permanently decrypt in Truecrypt, this went fine for several days until it reached 95%. Now, it has filled up the entire volume with only 700kb to spare, virtualbox freezes the VM because it has run out of space on the host machine... Why is truecrypt using space, and how can i fix this? thanks.

3
  • This is the way the Truecrypt decryption works.
    – Ramhound
    Jun 3, 2014 at 17:28
  • Why was it not using any space prior to 95%, and what would you suggest i do about it? Jun 3, 2014 at 17:30
  • Anyway, because the drives are dynamic, i was able to insert an additional drive, and then expand the dynamic drive into this drive, essentialy rendering the raid useless and no more reliable than raid 0, but hopefully it will give me a chance to extract the data... :) Jun 3, 2014 at 17:53

1 Answer 1

1

Assuming you chose a larger maximum size for the dynamically extended guest drive than available on the host OS:

TrueCrypt writes to the whole volume (including "free" space) during the decryption process (replacing zeroed "ciphertext" with garbage data plaintext in the process, if there was previously unused space), so the guest disk file is extended to its maximum capacity.

According to this post by Robert Setiadi you can use SDelete to restore the zeroed areas and compact the disk image afterwards:

  1. Open VirtualBox and run the client OS (this guide will only works if the client OS is Windows).

  2. Do some cleanup (uninstall unnecessary applications, delete unused files, clean up temporary files, etc). You might want to run Windows Disk Cleanup tool.

  3. Perform Disk Defragmenter.

  4. Download this small application called sdelete.

  5. Extract the application to your user folder, then open command window and type sdelete -z c: (this will put zero bits on your unused space).

  6. Shut down your Windows client OS and close VirtualBox.

  7. Execute the following command in your host OS: VBoxManage modifyhd my.vdi –compact (replace “my.vdi” with the path and filename of your vdi file). If your host OS is Windows, type it in command prompt. If your host OS is Mac, open Terminal and type the command. This command has been tested in VirtualBox 4.2.6 and works perfectly. Future releases of VirtualBox might change the syntax though.

  8. Done, check your VDI file size now.

However, as the author puts it:

Tested on Mac OSX 10.8.2 Mountain Lion (host OS) with Windows XP Home Edition (guest OS) using VirtualBox 4.2.6. Different OS or different VirtualBox version might produce different outcome. Use this guide at your own risk.

This method assumes you can currently run programs on the guest OS, which means you may have to move the image to a larger drive first, to get it to start again. Then you should be able to pause TrueCrypt and follow the steps above to compact the image, before tackling the remaining 5%.

If you have a drive large enough to hold the whole volume you can also let it complete and compact afterwards, which will yield a smaller file (unless you repeat the compacting steps after the process completes otherwise).

6
  • My bad i guess. I created the virtual disks using command line (as they were 3TB big) when doing so, the (dynamic) disks became a few MB bigger than the host capacity. Not realizing that Truecrypt would use any more data than already in use, the virtual disks "over expanded" ... However, as commented, i was able to further extend the dynamic disks by portioning out a spare drive and letting the dynamic drives extend into it temporarily. Truecrypt resumed decrypting, and will hopefully complete now... Now the only thing i need is a safe way to "shrink" away the extensions into the spare drive. Jun 3, 2014 at 18:11
  • I'm pretty sure you can just shrink it with Disk Management once you've made enough free space. Any files on the spare drive should be relocated automatically.
    – Tamschi
    Jun 3, 2014 at 18:18
  • Will compacting the virtual drives using the method described above work/be safe if the guest is using a windows server 2008 raid 5 volume? Jun 3, 2014 at 19:44
  • According to the SDelete page it will run on the guest, whether compacting the volume file from the host will work depends on the Raid5 checksum for (0, 0). If it's 0 there's no problem but I couldn't verify this with a quick search. (I would assume it is though.) Still, I recommend making a backup before modifying anything on that scale.
    – Tamschi
    Jun 3, 2014 at 20:32
  • Good. Why exactly does free space need to be nullified? remember, i only need it to shrink a few megabytes so i can remove my spare drive... Will using the compact command without nullifying the entire volume damage the virtual disks? zeroing 9TB is going to take a long time... Jun 4, 2014 at 2:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .