Page 1 of 1

I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 22:31
by MKVCrazy
Ok, I mistakenly messed up my VirtualBox files because of my storage issue yesterday.

The story

Yesterday, my main hard drive ran out of space. It only had 2GB left. So I went and check my files where I have a lot of space being used but all my files combined don't exceed 50GB and my max capacity is 288GB. Then I found the huge .VDI files in VirtualBox. There were a lot of 73GB VDI files and I am pretty sure those were from the restore/snapshots. So I thought I'll delete the very old snapshots and leave the latest one to free some space. I deleted mistakenly using Shift button - permanently deleted them. At the time I did this, I was using 3.1.4-BETA 1 so I went ahead and installed BETA 2 to do a complete clean reinstall. I clear the folders and stuff from /.VirtualBox and restarted my system. I kept only the latest snapshot .VDI on my desktop. Now I created a new Virtual Machine and loaded that .VDI in place of the harddrive. I get the following messages:

I created a new machine and I selected this .VDI file from "existing boot drive"
Image

I click start on the machine and I get this error
Image

Please help, I have all my business files which I can't work in linux in this .VDI file. What might be the problem?

Re: I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 22:45
by dmcgraw
My first guess would be that you are in real trouble. Sorry to tell you that.

The VB snapshots contain difference information relative to the previous snapshot or the base VDI file. If you deleted any of the previous snapshots or the base VDI file, as far as I know, there is no way to recover the data.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 22:57
by MKVCrazy
Which one is the base VDI file? I have one .VDI that's 1.7GB and it doesn't get any bigger. I tried matching up the UUID's and I'm still trying but got some new errors:

Image

Re: I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 23:10
by Perryg
The base vdi would have been in the ~/.VirtualBox/HardDisk folder
While the snapshots are in the ~/.VirtualBox/Machines/<VM-name>/Snapshots folder

Re: I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 23:15
by MKVCrazy
Ok, then I still have the base VDI. Can I still make it? So in total I have the base and this 1 snapshot VDI file.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 3. Mar 2010, 23:30
by Perryg
The problem with snapshots are they are a differencing drive and only related to the moment in time they were taken. I don't do a lot with them myself due to the reason that I find them very delicate and easy to delete and they take up a huge amount of disk space. I simply clone the drives as a means to back them up.
It may be possible to recover but the only people here that I know that could help with this are mpack or MarkCranness. They seem to be the snapshot gurus here. Drop them a PM and see if they have a solution for you.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 00:08
by MKVCrazy
Thank you for the advice. I've sent him a PM. I really hope he replies.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 05:35
by MarkCranness
The best that can be hoped for is to restore your hard disk to the state it was in when you took the very first snapshot (assuming that is even possible).
By manually deleting the snapshot differencing {hexUUID}.vdi files, you have lost almost all chance of recoverying any changes made after the very first snapshot was taken, sorry to tell you.

The date/time of your first snapshot will probably be the same as the current date/time stamp on the base VDI file.
(The date is also shown on the Snapshots tab of the WinXP VM.)

Please 'upload attachment' your VirtualBox.xml and WinXP.xml files and we can advise further.
(/home/owner/.VirtualBox/VirtualBox.xml and /home/owner/.VirtualBox/Machines/WinXP/WinXP.xml)

Edit: Also please upload a directory listing of your /home/owner/.VirtualBox/Machines/WinXP/Snasphots/ directory, including filesizes and date/times.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 10:15
by mpack
+1 to what MarkCranness said, it seems that you have discovered the best way to totally hose your data. One additional question however: I don't suppose you ever made any backups of your .VirtualBox folder? If you did then some of the intermediate snapshots may be recoverable.

As it is, you can recover your base VDI, but from the size I'd guess that consists of a basic OS install, so while that's useful, it'll be a lot less than you hoped.

For the future: (1) stop using snapshots, (2) invest in a second (big) hard drive for your PC.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 10:42
by MKVCrazy
This is sad :( so sad. Right now all I have is the base .VDI file, the lastest snapshot and the latest 3.1.4 vBOX that I installed a few mins ago. So all the settings are new in VirtualBox.xml and WinXP.xml. I have nothing more. If that's going to help in figuring our, I'll try posting it.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 11:46
by jorgensen
I had a similar problem recently, where I suspect using snapshots and VB's Save State is not safe.

Had to delete the profile in VB and all snapshots and only leave the main vdi file intact.
Can't remember exactly how the snapshot where removed from the manager.

Created a new similar profile with the main vdi file only.

That gave I was back to where the snapshot were taken, and only lost what was made after that.

When using snapshots, the main vdi file will not be touched, and as sectors are changed they goes to the snapshot file which will grow and making the guest slower by time.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 18:07
by MKVCrazy
From my understanding. My snapshot file is looking for a specific UUID VDI file. Is it possible to change one VDI's UUID to a target UUID value? So that when the snapshot looks for it again, it'll find it? I am aware that UUID values can be randomly created via the commands but not sure about targeting to a value.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 18:19
by mpack
MKVCrazy wrote:From my understanding. My snapshot file is looking for a specific UUID VDI file
Sorry, not correct.

Each child VDI (what you call a snapshot file) needs the data from all its ancestors in order to construct a complete disk image. The UUIDs are just a means which VBox uses to piece the together the ancestor/child relationships. So while you might fool VBox into getting those relationships wrong, you would not find the result useful. By deleting the oldest ancestor (except for the base VDI) you killed all of the child snapshots that depended on it - which was all of them.

I'm afraid there's simply no kind way to say this: data deleted (and no backups) == data gone.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 4. Mar 2010, 19:41
by jorgensen
mpack wrote:I'm afraid there's simply no kind way to say this: data deleted (and no backups) == data gone.
That why I keep my valuable data on the D: drive which is made writethrough - not a simple task, but worth it.

Re: I am left with one .VDI file, how do I make it useful?

Posted: 5. Mar 2010, 05:52
by MarkCranness
MKVCrazy wrote:So all the settings are new in VirtualBox.xml and WinXP.xml. I have nothing more.
Sorry, I missed that fact (that you did state) in your original post.

To recover your VDI (for what it is worth), use File>Virtual Media Manager>Add (button)>Navigate to your VDI>Open>
Then Select the new WinXP VM, Settings>Storage>select the existing hard disk in the tree (if any), or select the IDE Controller and use the Add Attachment '+' button, then select your VDI from the dropdown on the right>OK.

IF your last latest snapshot differencing VDI is quite large, there is a very remote chance to recover some of your data in the way you suggest: Editing the UUID values (and also editing VirtualBox.xml). The result would be a severely damaged filesystem, but might contain some data that could be extracted.
How big is the virtual VDI (Actual Size and Virtual Size) and how big is the actual size of the snapshot VDI you did save?