Solved

vmware directories deleted but running vm's still up/running/accessible SUSE 10.2 host

Posted on 2007-04-02
2
518 Views
Last Modified: 2013-12-05
I have a good one.  Suse 10.2 running on a Dell PowerEdge server.   On this server I am running the free version of VMware 1.0.1.   I have the VMware server console up and running.. I can access all my Windows 2k3 server vm's through the server console and remote desktop.  

The Virtual Machine directory is /home/Virtual Machines/

I was ssh'd into the host Suse machine and ***GET THIS***  ACCIDENTALLY!!!!!  typed rm -rd /home/

so by the time I realized it wasn't doing what I wanted it to do I hit CTRL+C

ok.  so now I have a MINIMAL Virtual Machine directory (almost completely deleted) but as I mentioned earlier.. All VM's are up/running/accessible!!!!!!   I am copying all important information to EXTERNAL but am afraid to do anything if there may be a chance to get those virtual directories back.

so.. vmware and vm's up and running but the directories which the vm's are no longer there on the host computer..

any suggestions???  HELP PLEASE!!!  I have been looking for undelete stuff but haven't found much..

Pete
0
Comment
Question by:panaroni
2 Comments
 
LVL 27

Accepted Solution

by:
Nopius earned 500 total points
ID: 18841238
That's known feature of Unix. You may delete file/directory, but while it's is in use, it's deleted only from directory structure (unlinked). Used i-node is freed only after file/directory closure. Even 'df' shows the same disk space until you stop all processes. So, once you stop your VM's, you loose all your virtual disks...

Now how to recover. I know how to do it while files are open. My restore scenario is following.
Before I created a file '/tmp/a', that is used by another program (say tail, in your case it would be vmware).

1) I found PIDs of processes who keeps my file open:

[root@ibm ~]# pgrep tail
4680

2) Find inode numbers of open file with 'lsof' command.
[root@ibm ~]# lsof -p 4680
COMMAND  PID USER   FD   TYPE DEVICE     SIZE   NODE NAME
...not interesting
tail    4680 root    3w   REG    8,2        5  84259 /tmp/a (deleted)
tail    4680 root    4r   REG    8,2        5  84259 /tmp/a (deleted)

3) Determine inode number of 'good' file to be restored, in my case it's 84259

4) Run 'debugfs' with appropriate device (where your /home is mounted), in my case:
debugfs -w /dev/sda2
debugfs 1.35 (28-Feb-2004)
debugfs:

5) In 'debugfs' I did:
debugfs:  cd /tmp
dump <84259> /tmp/a

6) Viola. In /tmp/a is a copy of deleted file (while original file is still opened).

0
 
LVL 9

Expert Comment

by:sda100
ID: 18841944
I have no idea if this would work, but have you tried creating a snapshot?  You may lose the .vmx file, but you can always create a new virtual machine and add your disk, if the snapshot can save it?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question