VMware Cloud Community
CSLaw
Contributor
Contributor

Help!!! Accidently reformatted the VMFS partition

Help!!  I recently set up a new host server for home as well as my test environment use.  4 separate SATA disks only.  My file server VM resided on one of the disk (750GB), with a second .vmdk backup disk on another disk (2TB).  Yesterday the SATA disk with the system disk died, but since the backup SATA disk with the backup .vmdk was there, I was fine.  Crap happened after, when I opened the case to check and pull out the bad disk, I accidentally pulled some SATA cables but then plugged them back in no knowing that I plugged in the wrong sequence.  After booted up, now even the 2TB disk showed inaccessible.  In a panic mode, I checked the disk was still visible, so I did the stupid thing of re-adding it back without thinking.  The moment I hit enter and remembered that I would refomat the disk, but it was too late.

Now I have dead disk, and a re-formatted disk, and all my data are on these drives.  My other servers are safe, just all my family's data are now gone.:smileycry:

Much appreciated if anyone can help in this.  Is there a way to unformat it?  Other than the stupid reformat, I haven't put anything there.

Thanks!!!

0 Kudos
11 Replies
continuum
Immortal
Immortal

First of all: unmount the drive and power off the ESXi

Then boot the host with this LiveCD

http://sanbarrow.com/mcs-esxi5-recovery-X-001.iso
I made for recovery purposes.
Try to mount / read the volumes with vmfs-tools.

If that only shows blank directories - use photorec or other recovery tools to recover raw files


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CSLaw
Contributor
Contributor

Thanks!!  Downloading, I'll give it a try tonight.  Smiley Happy

0 Kudos
CSLaw
Contributor
Contributor

Hi Ulli,

Sorry to bug you again. Smiley Sad I'm totally a Windows guy and don't know much about linux. I have no clue what to do to salvage the data and my family is not very happy at me either. Probably have to stay in a dog house for a while. Smiley Sad

Here's what I did. I disconnected the other good drives and left the backup drive connected (didn't want to screw up again). After I booted up the iso (CD now) and ran "Live". I typed in the admin password, got the $ prompt, and was totally stuck next step.

Would you mind showing me a step to step what to do? I know I'm asking a lot but all my wife's business data, my nieces' baby pics from new born to 6 year old now, and movies....etc. are all in there. I feel sorry and responsible for not providing them a solid backup plan.

Much appreciated if you can help on this and thanks for you prompt response!

Thanks,

Clement

0 Kudos
continuum
Immortal
Immortal

Hi
to avoid a holiday in the doghouse ...
at the prompt enter
su
and provide the password - then enter
startx
then you find something like a Windows startmenu with a tool named gparted (gnome partition editor) - open that
you then get a GUI-tool to find out which drive you need to mount - remember the device name for the partition - something like /dev/sdb1

then open a terminal and enter this commands - replace /dev/sdb1 with what you found out in last step

mkdir /mnt/vmfs
vmfs-fuse /dev/sdb1 /mnt/mfs

when that works without error messages open "gnome commander" and navigate to /mnt/vmfs


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CSLaw
Contributor
Contributor

Thanks Ulli! I’ll try tonight. Hopefully I can stay out of the dog house.

Looks like this is to mount the existing vmfs partition, but since I reformatted it, I would unlikely to see the folders, correct? And that’s when I run the Photorec?

Thanks again!!

0 Kudos
continuum
Immortal
Immortal

You are right -  very likely you will only see only a handful of .**.sf files in the root of the volume.
But you should try it  - it just takes 15 minutes to do that

If your vmdks are not there your options are:
- Ontrack - expensive - you could build a luxurious doghouse with pool and TV for the same money

- try to carve out the vmdk you need  - only works in some rare cases when the VMFS was almost empty when you created the vmdk

- try raw recovery of the missing photos, videos or what ever you have to find to get access to your house again.

The LiveCD has two tools for such a task: scalpel and photorec - but you could also use commercial Windows based tools like GetDataBack, UFS-explorer or similar


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CSLaw
Contributor
Contributor

Thanks!!

I did some research on how to use Scalpel and Photorec. One question I have is that the VMFS partition contains only the .vmdk files, how do these tools extract the raw data from within?

Sorry, as said, I know nothing about Linux. May be I shouldn’t have used ESX the first place although I like it better. ☹

Thanks!!!

0 Kudos
continuum
Immortal
Immortal

What ? - you find the vmdk files with the CD ?

Then all is well - copy them to an external; USB-drive or a networkshare then.

You can later add this vmdks to existing VMs and saz goodbye doghouse.

but I think I missunderstand you - do you have used the CD yet ?


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
CSLaw
Contributor
Contributor

Nah, I’m at work, haven’t had a good sleep for the last 2 days. I’ve been spending all my time in researching the fix at work. I do most VM support at work, so I still look like I’m working. ☺

I haven’t used the CD yet. I have read some instructions on Photorec and it looks like it reads the files from the partition directly, e.g. .jpg, .doc…etc.. My question is actually that my reformatted partition should contain all the .vmdk files only since this is for my file server VM disk, so does it browse within the .vmdk files? My file server had the data disk (C-vmdk and D-vmdk) on the dead drive and the backup disk (E-vmdk) on the reformatted drive. So I would expect Photorec can only see the .vmdk files (if I’m lucky), correct?

Fingers crossed…..

Thanks again!!

0 Kudos
CSLaw
Contributor
Contributor

I read further and realized that I misunderstood how recovery was done by these tools.  (haven't done one disk recovery using these tools or others before).  So I guess these tools read the disk disregarding what partition format it's using, scan for NTFS files pattern bit by bit, then extract the files for you.  Am I right?  I can see the light to get back to my house in weekend (or before). Smiley Happy

Thanks!!!!!

0 Kudos
CSLaw
Contributor
Contributor

Hi Ulli,

Finally, got out of the dog house!!!!!  :smileylaugh:

I looked around further and found other posts that got similar problem.  I had a misunderstanding that the recovery tools read only the supported formats of partition, so I thought the VMFS disk needed to have a tool that could read VMFS partition to recover data.  It turned out the recovery tools were to scan through the disk disregarding what partition format the disk was.  That made it easy to recover then for a Windows guy like me.

Thanks again for your help and prompt response!!!!

Clement

In case some Windows guys one need it for future reference.........

1. Unmount the Datastore/LUN from the host.

2. Shut down the host and remove the disk

3. Plug the disk in to a Windows workstation

4. Install a raw disk recovery tool.  (I used Active File Recovery, around $100.)

5. Scan thru the entire disk.  The tool will pick up any NTFS pattern files / folders

6. It will take hours if your disk is large.  After that just browse thru the result folders/files and recover the ones you want.  Depends on how clean the disk is, if there has be nothing written on the disk, most likely you'll get the files back.

7. Unfortunately you will lose the .vmdk pattern files (if the tool does not support), but you'll have the system disk files back.  Rebuild or reinstall windows on top after you recover the files.

I did a rebuild since they are just file servers.

0 Kudos