0

An Ubuntu LTS 10.04 vdi I was running crashed, and I'm unable to boot from it. I get stuck in initramfs.

I'm able to mount the image as a secondary device on a working Ubuntu LTS 10.04 image, after first repairing the volume with fsck.

Oddly, the data on the image is out of date! When I look at the vdi file on the host machine, it has an old modification time.

Strangely, I had rebooted this image in the past, and if changes weren't being written to the vdi file, I would have noticed it on reboot. I have also checked my other vdis to make sure they didn't contain the data instead, but no luck.

Where could all of that data been written to? Any place other than the vdi? I don't understand how it could have just disappeared like that, nor do I understand the modification time on the vdi file, unless VirtualBox was actually writing the data to a location other than the vdi!

Simian
  • 125
  • 1
  • 6
  • Also something to note-- I do see a snapshot vdi that is very large with a newer modification time, and is 6.53 GB. I'm thinking I should look there, but am doubtful it will have what I'm looking for. I did not take that snapshot myself AFAIK. – Simian May 05 '11 at 23:47

2 Answers2

2

Did the host crash? It could be that VirtualBox wrote the data and it ended in the disk cache of the host which then crashed and lost it.

Do you have any snapshots? If so, the main disk image won't have been written to, only the snapshot disk files.

You could try SysInternals Processmon or equivalent to see which files it is writing to if you aren't sure.

Lastly, on VMWare ESX, you can set a disk to not keep changes, but they aren't lost if the guest OS does a soft reset, only if the virtual machine is powered off. Perhaps that's similar on VirtualBox?

TessellatingHeckler
  • 5,726
  • 3
  • 26
  • 44
  • Wow, that was a nightmare. It looks like the data was in the snapshot file! Here's something very peculiar. The snapshot file disappeared, or changed location after I mounted it and restarted the working image. Luckily, I backed up all my data beforehand, and I'm still able to mount the image. Sadly, I am not able to boot from it. All of this happened on VirtualBox OSX. I have had other data problems with it in the not so distant past with both Fedora and Ubuntu, but none as severe as this. I would NEVER recommend using Virtualbox on OSX after this experience. – Simian May 06 '11 at 00:18
2

Did you take a snapshot of that VDI? VirtualBox writes data to a separate snapshot file so that it can revert to the previous state (by simply discarding everything in said snapshot file and reading the VDI directly, as you are now). It's kind of like Windows' System Restore, except that it actually works!

I believe the command-line tools will allow you to "discard" that snapshot -- that is, to write the snapshot data to the VDI so that you have an up-to-date VDI that you can use in a different VM, but you would no longer have that snapshot. Unfortunately, I don't know off the top of my head what that command/sequence of commands would be, but hopefully this'll get you pointed in the right direction.

Kromey
  • 3,641
  • 4
  • 25
  • 30