Page 1 of 1
disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 20:04
by carlsonj
I had a Windows XP crash, and I couldn't even use "Host-F" to get back out of full-screen mode. It was frozen. I had to use Ctrl-Alt-Backspace to kill the window manager and log back in.
That was bad news. Now my Windows XP disk is "inaccessible." I can't figure out how to fix it. Attempting to discard the "current snapshot" gives me an error -- the same one that keeps me from booting up Windows. It says:
Failed to discard the current snapshot and the current state of the virtual machine XP.
Could not open the hard disk storage unit
'/vbox/HardDisks/XP Hard Disk.vhd'.
VD: error opening image file
'/vbox/HardDisks/XP Hard Disk.vhd'
(VERR_VD_VHD_INVALID_HEADER).
Details:
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
HardDisk
Interface:
IHardDisk {62551115-83b8-4d20-925f-79e9d3c00f96}
Is there any way to fix this? Have I just lost everything?
(That 80004005 seems to be the "something's vaguely wrong" message. I get that for USB as well.)
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 20:36
by vbox4me2
Can you start a linuxlife ISO(like knoppix) and attach that vhd?
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 21:57
by carlsonj
vbox4me2 wrote:Can you start a linuxlife ISO(like knoppix) and attach that vhd?
I don't think I understand. VirtualBox won't let me assign that vhd file to *ANY* virtual machine at all. Something is now wrong with the file header.
What I'd really like to do is to wind back to the last snapshot, but it won't even let me do that -- again, because the header is corrupt. I don't understand what I'm supposed to do with a snapshot if I can't roll back.
Aren't there any commands to 'fix' the header?
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 22:33
by carlsonj
vbox4me2 wrote:Can you start a linuxlife ISO(like knoppix) and attach that vhd?
I tried booting up Ubuntu, but I can't attach to the disk there. It's not surprising, as VirtualBox itself says that it can't open the file anymore.
I tried copying over one of the snapshots from the 'Machine' directory -- out of desperation -- and patching up all the UUIDs to match. It didn't work, either. I was able to make the VirtualBox GUI happy with the updated XML, but the machine itself was unable to boot from the image. It looks like that VM is just completely lost.
Searching the web produces no hits at all on this error message. I must be the "only one."
At least I learned some valuable lessons: the snapshotting process in VirtualBox is worthless, and the disk handlers are not reliable when processes are terminated. I'm much better off taking a ZFS snapshot of the file system before firing up any VMs, and using that if I ever need to roll back.
I'm going to try reinstalling, and just cross my fingers hoping that the evil folks in Redmond don't accuse me of piracy for registering again.
:-<
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 22:54
by vbox4me2
Its not such an issue with VBox but with how the image got damaged, on a real HD it would error as well. You could try to load this image into a real spare HD (with dd) and use getdataback or some other repair/recovery tool on that HD.
The leason here is one single word "backup", a 35$ external drive is a good investment, here I have 4 backups of each VM (one per week) between 2 disks allowing me to go back 2 months simply because I'm not in any mood to loose anything.
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 22:57
by carlsonj
vbox4me2 wrote:Its not such an issue with VBox but with how the image got damaged, on a real HD it would error as well. You could try to load this image into a real spare HD (with dd) and use getdataback or some other repair/recovery tool on that HD.
The leason here is one single word "backup", a 35$ external drive is a good investment, here I have 4 backups of each VM (one per week) between 2 disks allowing me to go back 2 months simply because I'm not in any mood to loose anything.
I _thought_ I was doing just that by "snapshotting" using the VirtualBox GUI. If anything bad happens, I can always revert to an older snapshot, right?
Well, wrong. The snapshots seem to share fate with the disk image itself, making them substantially less effective than I'd expected. In the future, I'll do backups externally by using the ZFS snapshot mechanism -- at least that's reliable.
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 23:30
by skoehler
vbox4me2 wrote:Its not such an issue with VBox but with how the image got damaged
It's an issue with VBox since there doesn't seem to be a way to repair vdi files.
(I assume, that snashotting means, that all changes are written to some second vdi file and the base-image is left intact. In this case, it should be easy to get rid of the defective vdi image)
Re: disk lost, can't roll back to snapshot
Posted: 25. Jul 2009, 23:36
by Perryg
Look in the snapshot folder and see if you have a .VDI file in there. (Mine has (2) files .sav and .vdi)
If so create a new VM and attache it to the Snapshot VDI See if this works.
I will do some testing later and see if I can make it come to life as well.
Re: disk lost, can't roll back to snapshot
Posted: 18. Sep 2009, 04:33
by jvogt
I had the same problem.
My fix was to convert the vhd to raw then to vdi using the instructions here:
http://www.qc4blog.com/?p=84
Good luck!
Re: disk lost, can't roll back to snapshot
Posted: 4. Jun 2012, 11:50
by EPicure
Hi,
I had the same problem. I followed the instructions on this web site mentionned by jvogt. Everything works fine.
But when i start my virtual machine, after linux system select in Grub, I have an error message : invalid magic number.
Any help will be appreciated. Thx
Re: disk lost, can't roll back to snapshot
Posted: 4. Jun 2012, 12:00
by mpack
Best not to hijack obsolete threads. Start your own thread and provide better information about what you did, and precise symptoms / error messages.