VMware Communities
User20200713
Contributor
Contributor

How to restore deleted .vmdk file?

Hello,

I've accidentally removed my .vmdk file. How to restore it? My data files "<mymachinename>-s00**.vmdk" are present. I have  I use VMware Player 15.5.6 build-16341506

Log and vmx file attached.
I think I need to point valid offsets in this vmdk file based on file sizes. Here are file sizes:

-rwxrwxrwx 1 root root 4261937152 июл 13 11:21 'Windows 10 x64-s001.vmdk'

-rwxrwxrwx 1 root root 4261937152 июл 10 19:05 'Windows 10 x64-s002.vmdk'

-rwxrwxrwx 1 root root 4259053568 июл 10 19:07 'Windows 10 x64-s003.vmdk'

-rwxrwxrwx 1 root root 4240834560 июл 10 19:07 'Windows 10 x64-s004.vmdk'

-rwxrwxrwx 1 root root 4261806080 июл 10 19:07 'Windows 10 x64-s005.vmdk'

-rwxrwxrwx 1 root root 4261871616 июл 10 19:07 'Windows 10 x64-s006.vmdk'

-rwxrwxrwx 1 root root 4260298752 июл 10 19:07 'Windows 10 x64-s007.vmdk'

-rwxrwxrwx 1 root root 4261543936 июл 10 19:05 'Windows 10 x64-s008.vmdk'

-rwxrwxrwx 1 root root 4245225472 июл 10 19:05 'Windows 10 x64-s009.vmdk'

-rwxrwxrwx 1 root root 4261871616 июл 10 19:05 'Windows 10 x64-s010.vmdk'

-rwxrwxrwx 1 root root  335609856 июл 10 19:05 'Windows 10 x64-s011.vmdk'

-rwxrwxrwx 1 root root 4261871616 июл 10 19:07 'Windows 10 x64-s012.vmdk'

-rwxrwxrwx 1 root root 4261937152 июл 10 19:05 'Windows 10 x64-s013.vmdk'

-rwxrwxrwx 1 root root 2214920192 июл 10 19:05 'Windows 10 x64-s014.vmdk'

-rwxrwxrwx 1 root root 1073938432 июл 10 19:05 'Windows 10 x64-s015.vmdk'

-rwxrwxrwx 1 root root 4261937152 июл 10 19:05 'Windows 10 x64-s016.vmdk'

-rwxrwxrwx 1 root root 4261937152 июл 10 19:07 'Windows 10 x64-s017.vmdk'

-rwxrwxrwx 1 root root 1141047296 июл 10 19:05 'Windows 10 x64-s018.vmdk'

-rwxrwxrwx 1 root root 4261609472 июл 10 19:05 'Windows 10 x64-s019.vmdk'

-rwxrwxrwx 1 root root 4261937152 июл 10 19:05 'Windows 10 x64-s020.vmdk'

-rwxrwxrwx 1 root root 2214592512 июл 10 19:07 'Windows 10 x64-s021.vmdk'

-rw-rw-rw- 1 root root 1320878080 июл 10 19:07 'Windows 10 x64-s022.vmdk'

-rw-rw-rw- 1 root root     458752 июл  9 17:49 'Windows 10 x64-s023.vmdk'

-rw-rw-rw- 1 root root     524288 июл 13 11:39 'Windows 10 x64-s024.vmdk'

-rw-rw-rw- 1 root root     524288 июл 13 11:39 'Windows 10 x64-s025.vmdk'

-rw-rw-rw- 1 root root     458752 июл  9 18:20 'Windows 10 x64-s026.vmdk'

I created another drive and have copied its vmdk but how to figure out the offsets? Example vmdk attached.

0 Kudos
17 Replies
continuum
Immortal
Immortal

Next time you post something please make sure the line breaks dont get lost - or evenbetter just attach the file in question.

So you deleted the vmdk descriptor file ?

Attach the vmware.log from the last successful start of the VM and attach a filelisting of all the s00*.vmdks you got.

Make sure the list gives the fullname,size and date.


________________________________________________
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
scott28tt
VMware Employee
VMware Employee

Moderator: Thread moved to the Workstation Player area. Please use the Attach function in the bottom right of the post creator when uploading VMX or other files.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
User20200713
Contributor
Contributor

Thanks. Please see the attached files and the listing

0 Kudos
continuum
Immortal
Immortal

Did you expand this vmdk after you created in the first place ?


________________________________________________
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
User20200713
Contributor
Contributor

This vmdk attached is another one. I created it manually with the hope it will work. Created it using creating a new disk for this machine and then copied this vmdk file. But the offsets are wrong.

0 Kudos
continuum
Immortal
Immortal

Copied from the log ...

DISKLIB-DSCPTR: Opened [0]: "Windows 10 x64-s001.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [1]: "Windows 10 x64-s002.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [2]: "Windows 10 x64-s003.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [3]: "Windows 10 x64-s004.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [4]: "Windows 10 x64-s005.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [5]: "Windows 10 x64-s006.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [6]: "Windows 10 x64-s007.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [7]: "Windows 10 x64-s008.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [8]: "Windows 10 x64-s009.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [9]: "Windows 10 x64-s010.vmdk" (0xa) 
DISKLIB-DSCPTR: Opened [10]: "Windows 10 x64-s011.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [11]: "Windows 10 x64-s012.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [12]: "Windows 10 x64-s013.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [13]: "Windows 10 x64-s014.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [14]: "Windows 10 x64-s015.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [15]: "Windows 10 x64-s016.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [16]: "Windows 10 x64-s017.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [17]: "Windows 10 x64-s018.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [18]: "Windows 10 x64-s019.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [19]: "Windows 10 x64-s020.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [20]: "Windows 10 x64-s021.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [21]: "Windows 10 x64-s022.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [22]: "Windows 10 x64-s023.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [23]: "Windows 10 x64-s024.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [24]: "Windows 10 x64-s025.vmdk" (0xa)
DISKLIB-DSCPTR: Opened [25]: "Windows 10 x64-s026.vmdk" (0xa)

your vmdk has 26 slices - but a newly created vmdk with the same size of 86gb  has only 22.

This means your vmdk was expanded at least once.

Please try to remember the original size.


________________________________________________
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
User20200713
Contributor
Contributor

I don't remember original size. I expanded it several times (3+).

0 Kudos
continuum
Immortal
Immortal

Tried to start with a 80 gb vmdk expanded to 86gb - does not work.

Tried to start with a 70gb expanded to 80gb expanded to 86gb - does not work.


________________________________________________
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
User20200713
Contributor
Contributor

Didn't understand. You suggest to start with 80GB vmdk and then expand? But what I should write in vmdk that refers to those slices (...-s000.vmdk) ?

0 Kudos
continuum
Immortal
Immortal

We need to create a new empty vmdk that uses the same size for all the 26 slices.

So far I tried to start with

80gb > expanded to 86: number of slices wrong

70 gb > 80gb > 86gb : does not match number of slices

Your task now is to guess the history of expands.

Lets assume you start with an empty disk of 50gb - then expand to 60, then to 70, then to 80 then to 86gb.

When you manage to get to a final size of 86gb after 3 or more expands and also reach a number of 26slices then we can try to use those numbers for the new vmdk.

Please try to find older logs of this VM - that may help


________________________________________________
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
User20200713
Contributor
Contributor

Interesting idea, thanks! But I don't see old logs in the directory with the VM. It starts since 9th of July. All attached here. And the oldest entry is this

2020-07-09T17:48:52.787+03:00| vmx| I005: DISKLIB-LINK : Opened '/home/art/VMs/Windows 10 x64/Windows 10 x64.vmdk' (0xa): twoGbMaxExtentSparse, 180355072 sectors / 86 GB. 2020-07-09T17:48:52.787+03:00| vmx| I005: DISKLIB-LIB : Opened "/home/art/VMs/Windows 10 x64/Windows 10 x64.vmdk" (flags 0xa, type twoGbMaxExtentSparse). 2020-07-09T17:48:52.787+03:00| vmx| I005: DISKLIB-LIB_MISC : DiskLib_GetStorageBlockSizes: Failed to get storage block sizes, The virtual disk requires a feature not supported by this program. 2020-07-09T17:48:52.787+03:00| vmx| I005: DiskGetGeometry: Reading of disk partition table 2020-07-09T17:48:52.787+03:00| vmx| I005: DISK: Disk '/home/art/VMs/Windows 10 x64/Windows 10 x64.vmdk' has UUID '60 00 c2 9f 78 bf fb 85-c1 a0 8a 1d f8 99 4c d7' 2020-07-09T17:48:52.787+03:00| vmx| I005: DISK: OPEN '/home/art/VMs/Windows 10 x64/Windows 10 x64.vmdk' Geo (11226/255/63) BIOS Geo (0/0/0) 2020-07-09T17:48:52.834+03:00| vmx| I005: DISK: DiskConfigureVirtualSSD: Disk 'nvme0:0' identified as Virtual SSD device.

So it is already with 86GB.

When I chose sizes I was entering numbers with keyboard which I don't remember (bad move). Will think about

0 Kudos
continuum
Immortal
Immortal

The first original size may have been slightly larger than 40 gb - but even that is a just a guess.

Dont try to start the VM if you do not have the numbers right - that will corrupt the vmdk .

Working with copies would be ok.


________________________________________________
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
a_p_
Leadership
Leadership

Please extract the first 512 Bytes from each .vmdk file, into a .bin file (e.g. dd if="Windows 10 x64-s001.vmdk" of="Windows 10 x64-s001.bin" bs=512 count=1).

Then compress/zip all the .bin files, and attach the .zip archive to your next reply. These files contain the required information in their metadata/header.


André

0 Kudos
User20200713
Contributor
Contributor

Please see it attached

0 Kudos
continuum
Immortal
Immortal

Oh dear ... I start to forget Workstation tricks ....

Thanks Andre - for the reminder ...

Do you had something like this in mind ?

#!/bin/sh

# Display some basic details for a VMware ESXi - Delta.vmdk

echo

echo '### SNAPSHOT INFO '

echo 'file   snapinfo: ' "$1"

  hexdump  -n 4 -v -e '"magic          : " 4/4 "%s" "\n"' "$1" | grep -v /vmfs

   hexdump -s 12 -n 4 -v -e '"size basedisk  : " "%4u" "\n"' "$1" | grep -v /vmfs

   hexdump -s 28 -n 4 -v -e '"min size delta : " "%4u" "\n"' "$1" | grep -v /vmfs

echo '-------------------------------------------------------------------'

echo

???

The results look reasonable:

### SNAPSHOT INFO

file   snapinfo:  Windows10x64-s001.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s002.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s003.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s004.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s005.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s006.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s007.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s008.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s009.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s010.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s011.vmdk.bin

magic          : KDMV

size basedisk  : 655360

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s012.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s013.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s014.vmdk.bin

magic          : KDMV

size basedisk  : 4325376

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s015.vmdk.bin

magic          : KDMV

size basedisk  : 2097152

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s016.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s017.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s018.vmdk.bin

magic          : KDMV

size basedisk  : 2228224

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s019.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s020.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s021.vmdk.bin

magic          : KDMV

size basedisk  : 4325376

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s022.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s023.vmdk.bin

magic          : KDMV

size basedisk  : 4259840

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s024.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s025.vmdk.bin

magic          : KDMV

size basedisk  : 8323072

### SNAPSHOT INFO

file   snapinfo:  Windows 10 x64-s026.vmdk.bin

magic          : KDMV

size basedisk  : 4325376

This would be the full list of slices


RW 8323072 SPARSE  "Windows 10 x64-s001.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s002.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s003.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s004.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s005.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s006.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s007.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s008.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s009.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s010.vmdk"
RW 655360  SPARSE  "Windows 10 x64-s011.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s012.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s013.vmdk"
RW 4325376 SPARSE  "Windows 10 x64-s014.vmdk"
RW 2097152 SPARSE  "Windows 10 x64-s015.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s016.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s017.vmdk"
RW 2228224 SPARSE  "Windows 10 x64-s018.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s019.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s020.vmdk"
RW 4325376 SPARSE  "Windows 10 x64-s021.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s022.vmdk"
RW 4259840 SPARSE  "Windows 10 x64-s023.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s024.vmdk"
RW 8323072 SPARSE  "Windows 10 x64-s025.vmdk"
RW 4325376 SPARSE  "Windows 10 x64-s026.vmdk"

Who knows why pasting text like this creates tables ??? - stupid function ....


________________________________________________
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
a_p_
Leadership
Leadership

Do you had something like this in mind ?

Yes, exactly.

I've created a virtual disk's descriptor file from that information (see attached .vmdk file).

The disk has been expanded 6 times: 40 -> 50 -> 51 -> 60 -> 70 -> 76 -> 86GB

André

0 Kudos
User20200713
Contributor
Contributor

Thank you for you help! Really appreciate it. Unfortunatly no chance to test it now as I got my machine broken. The vmware machine files are there.

0 Kudos