Page 1 of 1

Q: HowTo merge differential .vdi leftover after vbox crash?

Posted: 20. Jul 2009, 03:41
by Seneca
Hi All,

What I did:
I am running VBox 2.2.4 on Mac OS X with a recent Xubuntu guest. I have three .vdi files configured as three harddisk, /home, /usr and / named homedisk.vdi, usrdisk.vdi and sysdisk.vdi, respectively. I have created a snapshot using the GUI and then did some major reorganizing of the guest file system.

What went wrong:
Finally I tried to merge the snapshot back to the base .vdi files using the GUI using discard snapshot (I think, my GUI is German and says "Sicherungspunkt verwerfen", its the second-right icon with the cross at its right lower corner). The discard process died due to a host disk full error, corrupting my sysdisk.vdi beyond repair.

Now the problem is:
I still have the differential .vdi files for homedisk.vdi and usrdisk.vdi around and visible in the GUI in the harddisk section. But in the snapshots section is no snapshot displayed. So I can not rerun "discrad snapshot" to get the remaining two diferential files merge using the GUI.
The VM is in the current state bootable and the guest sees the correct harddisk content from the differential .vdi files for homedisk.vdi and usr.vdi.
Is there any other way to merge these differential files into their base files? (Their content is still valuable, even after restoring sysdisk.vdi from backup to its pre-snapshot state.)

What I tried:
I looked into the FAQ and VDI-Tutorial here in the forum and also found this old mailing list thread about merge problems, but did not found a clear idea what to do now. The VBoxManage help output for snapshot and modifyhd command was also not helpful for me.

Best
Seneca

Re: Q: HowTo merge differential .vdi leftover after vbox crash?

Posted: 20. Jul 2009, 22:21
by vbox4me2
The only way out is to manually edit the xml files until it works again. You could for example, use another VM and create the same amount of snapshots so you have something to compare when rebuilding the other ones.

Re: Q: HowTo merge differential .vdi leftover after vbox crash?

Posted: 23. Jul 2009, 09:56
by Seneca
Many thanks vbox4me2 for the answer. Though I hopped for some more straight-forward method, I will either try editing the XML files as you suggested or have a look at the source and craft a special-case solution to "manually" merge the files. Judging from the VDI-Tutorial in the forum it shouldn't be difficult.

Which raises one more question:
Is there a good technical reason I am missing here for the lack of a "VBoxManage modifyhd --merge <differential_disk_file>" subcommand? Especially as there is the "VBoxManage modifyhd --type immutable" which - if I understood the manual correctly - will attach a differential disk file to a normal one without creating a "full" snapshot. Feels a bit like a one-way ticket.

(If this has already been discussed or should go into a new topic, just say so, I'll follow.)

Best
Seneca

Re: Q: HowTo merge differential .vdi leftover after vbox crash?

Posted: 23. Jul 2009, 12:28
by vbox4me2
The problem as I see it are the reference ID's inside the main VM and its diff's, that needs to match up crossways, once that is gone/lost the vbox tools don't know who belongs to who.