1 2 Previous Next 17 Replies Latest reply on Jul 18, 2020 12:05 AM by User20200713

    How to restore deleted .vmdk file?

    User20200713 Novice

      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.

        • 1. Re: How to restore deleted .vmdk file?
          continuum Guru
          vExpertCommunity Warriors

          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.

          • 2. Re: How to restore deleted .vmdk file?
            scott28tt Guru
            User ModeratorsVMware EmployeesCommunity Warriors

            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.

            • 3. Re: How to restore deleted .vmdk file?
              User20200713 Novice

              Thanks. Please see the attached files and the listing

              • 4. Re: How to restore deleted .vmdk file?
                continuum Guru
                Community WarriorsvExpert

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

                • 5. Re: How to restore deleted .vmdk file?
                  User20200713 Novice

                  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.

                  • 6. Re: How to restore deleted .vmdk file?
                    continuum Guru
                    vExpertCommunity Warriors

                    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.

                    • 7. Re: How to restore deleted .vmdk file?
                      User20200713 Novice

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

                      • 8. Re: How to restore deleted .vmdk file?
                        continuum Guru
                        vExpertCommunity Warriors

                        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.

                        • 9. Re: How to restore deleted .vmdk file?
                          User20200713 Novice

                          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) ?

                          • 10. Re: How to restore deleted .vmdk file?
                            continuum Guru
                            Community WarriorsvExpert

                            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

                            • 11. Re: How to restore deleted .vmdk file?
                              User20200713 Novice

                              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

                              • 12. Re: How to restore deleted .vmdk file?
                                continuum Guru
                                Community WarriorsvExpert

                                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.

                                • 13. Re: How to restore deleted .vmdk file?
                                  a.p. Guru
                                  Community WarriorsvExpertUser Moderators

                                  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é

                                  1 2 Previous Next