# Restore *.vdi after rm



## oliwiak82 (Apr 23, 2013)

Hello,

I removed a running guest .vdi (Virtualbox image file) by mistake. Is there any way to restore it? I see that file in `lsof` output (I can still access this guest via HTTP. I don't have the SSH port forward enabled to make a dump) :


```
VBoxHeadl  3537        oli   18r    VREG     107,2946105432             351160 1184203 /usr/local/lib/virtualbox/VBoxDDGC.gc
VBoxHeadl  3537        oli   19r    VREG     107,2946105432              34456 1184213 /usr/local/lib/virtualbox/VBoxDD2GC.gc
V[B]BoxHeadl  3537        oli   20u    VREG     207,2058682589        67545600000     125 /usr/home (zroot/usr-home)[/B]
VBoxHeadl  3537        oli   21u    PIPE 0xfffffe006631cb60              16384         ->0xfffffe006631ccb8
VBoxHeadl  3537        oli   22u    PIPE 0xfffffe006631ccb8                  0         ->0xfffffe006631cb60
VBoxHeadl  3537        oli   23u    IPv4 0xfffffe00664aa000                0t0     TCP *:rdp (LISTEN)
VBoxHeadl  3537        oli   24u    IPv4 0xfffffe00664763d0                0t0     TCP *:http (LISTEN)
VBoxHeadl  3537        oli   26u    IPv4 0xfffffe00470592e0                0t0     UDP *:27512
VBoxHeadl  3537        oli   29u    IPv4 0xfffffe0008f7c760                0t0     UDP *:12384
VBoxHeadl  3537        oli   31u    IPv4 0xfffffe0008f7c070                0t0     UDP *:49447
```

Please help.


----------



## zspider (Apr 23, 2013)

Is this on a system you own, or a server host?

If you own it, you should shut it down and pull the drive, assuming it's not doing anything mission critical. Put it in an enclosure and run recovery tools on it, (if you can find any for ZFS, I think that's what the zroot refers to). The longer you delay doing this, the less chance you have of getting anything back.

If it's being hosted on someone else's server, good luck.


----------



## SirDice (Apr 24, 2013)

oliwiak82 said:
			
		

> I removed a running guest .vdi (Virtualbox image file) by mistake. Is there any way to restore it?


And that's why you should make backups.


----------

