Accidentally detached snapshot
Posted: 21. Jul 2019, 13:46
Hi, guys. I really need some help!
I don't know if my VM is salvageable anymore, but if you have any suggestions, please let me know.
Ok. So here is what happened:
1. My host machine ran out of space. It has a 2TB hard drive.
I was running two VMs on the host.
VM1: 400GB fixed storage and one snapshot
VM2: 800GB fixed storage and one snapshot
VM2 was running Nextcloud (a self hosted cloud solution otherwise much like Google Drive). All the cloud files was being stored on a separate 4TB harddrive.
What I didn't know was that the main hard drive would fill up while Nextcloud was copying files to the external drive. I guess this is because of the snapshot, which grew really big and ended up consuming the main drive. The VM2's Snapshot grew to 553GB before the host system ran out of space and paused the guest VMs.
I tried to delete the snapshots to free up space, but that apparently required a lot of free disk space, which i didn't have.
My solution:
What I ended up trying, was moving my Snapshots folders over to the external drive and then putting a symlink in their original location.
This seemed to work fine. When I started up VirtualBox everything looked fine again (with some minor hiccups that involved renaming `...-prev` files), so I deleted the VM1's snapshot. After the snapshot was merged, I could finally boot it up. It was fine!
So I proceeded to delete VM2's snapshot. It wasn't there?! So, dumb as I am, I tried to boot it up. `FATAL: Could not read from the boot medium! System halted`. After a bit of research, I realised that the VM's drives was missing..? But I just readded the `.vdi` file and tried to boot up again. `Out of memory` (or something). Only then I realised that all of the VM's settings was reset to default.
Not knowing what else to do, I reassigned it 3GB of ram and 12MB of VRAM and booted it up again. It worked! Or so I thought. I had booted up into the year old snapshot! Without doing anything, I quickly shut the VM down again.
The problem:
VM2 is working, but I have apparently lost a year worth of important work and data. I have all the VM files, but I am worried that booting up the VM changed it, so that it's no longer possible to merge it with the snapshot. Is this the case or are there any way to extract my data from the snapshot?
Also, what happens if I swap the current harddrive `.vdi` with the snapshot's `.vdi`?
Structure:
VM2 (VM2's name is `Octopus`) folder:
After my hours of googleing I found this related issue (which didn't help me): ...cannot post urls yet... But it was the second result after googleing for `virtualbox detached snapshot` (View topic - accidentally "released" my snapshot ...)
I also tried to merge my snapshot with this app: ...Can't post urls yet. It's a VDI cloning tool posted on these forums (CloneVDI tool - Discussion & Support)
But I got an error saying `Source is a different image. Sorry, this tool cannot clone these (for now)`. But I may have misunderstood something.
I don't know if my VM is salvageable anymore, but if you have any suggestions, please let me know.
Ok. So here is what happened:
1. My host machine ran out of space. It has a 2TB hard drive.
I was running two VMs on the host.
VM1: 400GB fixed storage and one snapshot
VM2: 800GB fixed storage and one snapshot
VM2 was running Nextcloud (a self hosted cloud solution otherwise much like Google Drive). All the cloud files was being stored on a separate 4TB harddrive.
What I didn't know was that the main hard drive would fill up while Nextcloud was copying files to the external drive. I guess this is because of the snapshot, which grew really big and ended up consuming the main drive. The VM2's Snapshot grew to 553GB before the host system ran out of space and paused the guest VMs.
I tried to delete the snapshots to free up space, but that apparently required a lot of free disk space, which i didn't have.
My solution:
What I ended up trying, was moving my Snapshots folders over to the external drive and then putting a symlink in their original location.
This seemed to work fine. When I started up VirtualBox everything looked fine again (with some minor hiccups that involved renaming `...-prev` files), so I deleted the VM1's snapshot. After the snapshot was merged, I could finally boot it up. It was fine!
So I proceeded to delete VM2's snapshot. It wasn't there?! So, dumb as I am, I tried to boot it up. `FATAL: Could not read from the boot medium! System halted`. After a bit of research, I realised that the VM's drives was missing..? But I just readded the `.vdi` file and tried to boot up again. `Out of memory` (or something). Only then I realised that all of the VM's settings was reset to default.
Not knowing what else to do, I reassigned it 3GB of ram and 12MB of VRAM and booted it up again. It worked! Or so I thought. I had booted up into the year old snapshot! Without doing anything, I quickly shut the VM down again.
The problem:
VM2 is working, but I have apparently lost a year worth of important work and data. I have all the VM files, but I am worried that booting up the VM changed it, so that it's no longer possible to merge it with the snapshot. Is this the case or are there any way to extract my data from the snapshot?
Also, what happens if I swap the current harddrive `.vdi` with the snapshot's `.vdi`?
Structure:
VM2 (VM2's name is `Octopus`) folder:
Snapshot folder:drwx------ 2 root root 4,0K juli 20 18:49 Logs -rw------- 1 root root 2,9K juli 20 18:53 Octopus.vbox -rw------- 1 root root 2,9K juli 20 18:53 Octopus.vbox-prev -rw------- 1 root root 801G juli 20 18:53 Octopus.vdi -rw-r--r-- 1 root root 1,0K juli 20 19:05 .Octopus.vdi.swp lrwxrwxrwx 1 root root 48 juli 20 18:05 Snapshots -> /mnt/[external drive]/[path to snapshot]
Related:-rw------- 1 root root 1,4G april 29 2018 2018-04-29T19-21-23-821307000Z.sav -rw------- 1 root root 553G juli 20 12:20 {39######-####-####-####-######667e96}.vmdk -rw------- 1 root root 26G juli 20 12:20 {95######-####-####-####-######220193}.vdi
After my hours of googleing I found this related issue (which didn't help me): ...cannot post urls yet... But it was the second result after googleing for `virtualbox detached snapshot` (View topic - accidentally "released" my snapshot ...)
I also tried to merge my snapshot with this app: ...Can't post urls yet. It's a VDI cloning tool posted on these forums (CloneVDI tool - Discussion & Support)
But I got an error saying `Source is a different image. Sorry, this tool cannot clone these (for now)`. But I may have misunderstood something.