1 2 Previous Next 19 Replies Latest reply: Apr 11, 2007 9:59 AM by yt100 RSS

    Basic VMDK-repair know-how

    pbJalas Novice

      Okay - I had a VMDK crash and I would like to provide some information and instruction about VMDK repair here.

       

      First of all:

       

      As KevinG told me in this topic:

      http://www.vmware.com/community/thread.jspa?threadID=23014&tstart=15

       

      The basic repair attempt is alsway done by your VMware Server during startup of the virtual machine.

      VMware checks the disks and if there are some inconsistencies which can be done by a basic repair VMware will do this.

       

      If there are severe errors in the VMDK file, VMware won´t mount the disk. And VMware provides NO tool like "chckdsk" or "vrepair" etc.

       

      So, what to do?

       

      1.) Consider a restore from your backup.

       

      2.) Install the VMware diskmount utility found under the Utilities section on the Workstation download page at http://www.vmware.com/download/ws/. On a Windows machine, make available the corrupted VMDK file to the Windows machine and try to mount the disk.

       

      How to?

       

      Install the driver using the installer. Change to the directory where you installed it.

       

      Syntax:

       

      vmware-mount /p[/code]

      This shows the partitions/volumes within the vmdk.file. Determine which partition to mount. Call this partition N.

       

      vmware-mount /v:N R:  has to be substituted by the VMDK file.

      This may be a local or a network drive. I think that accessing the VMDK file through a local drive is the safest way.

       

      In this case, the disk will be mounted as drive R.

       

      3.) If the VMware diskmount utility does not mount the VMDK, try Ken Kato's virtual disk driver: http://chitchat.at.infoseek.co.jp/vmware/vdk.html

       

      (If Ken Kato´s tool helps to recover your data, do a paypal donation for him.)

       

      How to?

       

      Install the driver using the installer. Change to the directory where you installed it.

       

      Syntax:

      vdk start

      vdk open 0  /L:R:

      /code

       

      has to be substituted by the vmdk-file.

      /L:R: says: mount it as drive R:

       

      4.) If you succeed in mounting the VMDK file, copy the data to a new virtual disk. Use, for example, robocopy for this. It is included in Windows Server 2003 Resource Kit Tools at

       

      http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

       

      5.) If you´re still not able to mount your disk, I don´t know, what else you can do.

       

      Best regards

      Thorsten Jalas

       

      Message was edited by:

              pbJalas

       

      Message was edited by:

              jbrodeur: changes in grammar and formatting

        • 1. Re: Basic VMDK-repair know-how is missing !
          pbJalas Novice

          Let me provide some basics about VMDK file syntax.

           

          If you use 2GB splitted drives (or raw-devices or physical discs) the VMDK file is a text-only descriptor file. If you edit it, DO NOT use a Windows editor. Use vi, nano or something else.

           

          (I don't know if the VMDK files are also only descriptors and can be edited if you use monolithic (non-2GB splitted files.)

           

          This is how a basic VMDK file may look:

           

          \# file - basedisk.vmdk

          \# Disk DescriptorFile

          version=1

          CID=08690745

          parentCID=ffffffff

          createType="twoGbMaxExtentSparse"

           

          \# Extent description

          RW 4192256 SPARSE "basedisk-s001.vmdk"

          RW 4192256 SPARSE "basedisk-s002.vmdk"

          RW 4192256 SPARSE "basedisk-s003.vmdk"

          RW 4192256 SPARSE "basedisk-s004.vmdk"

          RW 8192 SPARSE "basedisk-s005.vmdk"

           

          \# The Disk Data Base

          #DDB

           

          ddb.toolsVersion = "0"

          ddb.adapterType = "scsi"

          ddb.adapterType = "buslogic"

          ddb.geometry.sectors = "63"

          ddb.geometry.heads = "16"

          ddb.geometry.cylinders = "16383"

          ddb.virtualHWVersion = "3"

          /code

           

          This VMDK consists of 5 VMDK files, which are defined in the "Extent description" section (plus the descriptor file itself).

           

          The first letters in these lines are "RW", which means these files are writable.

           

          The "CID" is a timestamp, which is dependent on the last modification.

           

          The "parentCID" should always be ffffffff - except it is a .vmdk.REDO-file.

           

          The "createType" says, in this case,  ("twoGbMaxExtentSparse") that it's a 2GB splitted, growable file.

           

          Also possible values:

           

          "monolithicFlat" = preallocated one-file (monolithic = not splitted into 2GB extents)

           

          "twoGbMaxExtentFlat" = 2GB-splitted, preallocated

           

          "monolithicSparse" = one-file, growable (doesn't make sense because of overhead)

           

          "partitionedDevice" = raw disk

           

          "fullDevice" = ??? 

           

          In the VMX file of the virtual machine, you'll find some entries like this:

          scsi0:0.fileName = "basedisk.vmdk"

          scsi0:0.active = "TRUE"

          scsi0:0.mode =  "undoable"

          /code

           

          (Also possible values: "persistent" and "nonpersistent")

           

          After creating a snapshot (which is basically creating the REDO files and leaving the base files unchanged), you should find REDO files.

           

          This is how the VMDK file of a REDO file (for example,  basedisk.vmdk.REDO_a01768) may look:

          version=1

          CID=ffffedcb

          parentCID=08690745

          createType="twoGbMaxExtentSparse"

          parentFileNameHint=".\basedisk.vmdk"

          \# Extent description

          RW 4192256 SPARSE "basedisk-s001.REDO_a01768"

          RW 4192256 SPARSE "basedisk-s002.REDO_a01768"

          RW 4192256 SPARSE "basedisk-s003.REDO_a01768"

          RW 4192256 SPARSE "basedisk-s004.REDO_a01768"

          RW 8192 SPARSE "basedisk-s005.REDO_a01768"

           

          \# The Disk Data Base

          #DDB

           

          ddb.toolsVersion = "0"

          ddb.adapterType = "scsi"

          ddb.adapterType = "buslogic"

          ddb.geometry.sectors = "63"

          ddb.geometry.heads = "16"

          ddb.geometry.cylinders = "16383"

          ddb.virtualHWVersion = "3"

          /code

           

          Relevant:

           

          The "parentFileNameHint" must point to the appropriate VMDK file. You can use an absolute or an relative path, but it must be CORRECT.

           

          "parentCID" must be identical with the CID in the parent VMDK file.

           

          The createType must be identical to the parentfile.

           

          The dbo-entries must be identical to the parentfile.

           

          Info:

           

          For each extent of the parent disk there will be a REDO file in the filesystem.

           

          The .REDO_xxxxx entries should all be identical. In this case, ".REDO_a01768".

           

          And for all of them, there must be an entry in the "Extent Description" section of the REDO VMDK file.

           

          You should find an additional entry in the VMX file of the virtual machine:

          scsi0:0.redo = "basedisk.vmdk.REDO_a01768"

          /code

           

          If you change the scsi0:0.disktype from undoable or nonpersitent to persistent and power on the virtual machine, you should notice that there are REDO files for the virtual disk and should be asked if you want to commit or discard the changes.

           

          Best regards

          Thorsten Jalas

           

          Message was edited by:

                  pbJalas

           

          Message was edited by:

                  jbrodeur: grammar and formatting updates

          • 2. Re: Basic VMDK-repair know-how is missing !
            jbrodeur Enthusiast VMware Employees

            Thanks for posting this info.

            • 3. Re: Basic VMDK-repair know-how is missing !
              peternolan9 Lurker

              Hi,

              I have copied a vmware machine and then tried to start it..I am getting corrupted registry file message.....could be large portions of hte machine were corrupted in the copy....

               

              I have installed vdk and when I try to open up a disk I get the following messages...however I get this message even on disks I know to be ok...can anyone point me to where I must be making some obvious error here?

               

              Thanks

               

              Peter

               

               

               

              O:\MyDownloads\vmware>vdk.exe open 0 "I:\temp\Windows 2000 Professional-cl1-s005

              .vmdk" /L:R

              Virtual Disk Driver for Windows version 3.1

              http://chitchat.at.infoseek.co.jp/vmware/

               

              'I:\temp\Windows 2000 Professional-cl1-s005.vmdk' does not contain a virtual dis

              k description.

              Failed to open the virtual disk image.

              The data is invalid.

               

              O:\MyDownloads\vmware>

              • 4. Re: Basic VMDK-repair know-how is missing !
                continuum Guru User Moderators vExpert

                You should have posted in WS-forum ...

                 

                anyway - you point vdk to the wrong file - you must use

                 

                I:\temp\Windows 2000 Professional-cl1.vmdk" /L:R

                 

                not

                 

                I:\temp\Windows 2000 Professional-cl1-s005.vmdk" /L:R

                • 5. Re: Basic VMDK-repair know-how is missing !
                  continuum Guru User Moderators vExpert

                  Warning: this post should be read with caution.

                   

                  The information is partly out-dated and partly incorrect!

                   

                  Ulli

                  • 6. Re: Basic VMDK-repair know-how
                    yt100 Novice

                    Hi, to get my data out of the corrupted vmdk file, I tried your method. VMWare-mount didn't work. VDK seemed to have mounted my vmdk file to R: but I can't get robocopy to copy files off it. It said it can't find path R:

                     

                    This is what I did:

                    robocopy R: z:\prev

                     

                    where z:\prev is another virtual disk. Copying files from c:\ to z:\prev works.

                     

                    Why is this?

                     

                    Thank you very much for your help!

                    • 7. Re: Basic VMDK-repair know-how
                      continuum Guru User Moderators vExpert

                      Looks like either partition-table is invalid, or you assigned the wrong partition or ...

                       

                      What did vdk say about the disk?

                      • 8. Re: Basic VMDK-repair know-how
                        yt100 Novice

                        When mounting my corrupted disk using vdk as in your message, it said:

                         

                        Partitions:

                        \#  start sector     Length in sectors               Type

                        0             0         31457280 (15360 MB)    

                        1            63        787122 (  384 MB)          82th: Linux swap

                        2        787185    30668085 (14974 MB)     83th: Linux

                         

                        But when I did:

                        dir R:

                        it said 'The system cannot find the path specified.' And can't copy files either.

                         

                        I also tried: adding the bad disk to a good vmx file and starting VMWare using a good vmdk file. Then mount the bad disk. But I can't see any of my data there. The bad disk file is 12GB in size, should occupy over 70% of the 15GB disk. But a 'df' showed only 17% occupied - only the basic files on the disk, not my data.

                         

                        Is there any other things I can try? Thanks a lot!!

                        • 9. Re: Basic VMDK-repair know-how
                          RDPetruska Guru User Moderators vExpert

                          Do you have an ext2/ext3 filesystem driver installed/running on your Windows host?  Since you've tried to mount a virtual disk which only has Linux partitions on it, unless you have a filesystem driver running on your Windows host, Windows will not understand that filesystem on the virtual disk.  And, therefore, cannot copy files from it - as it is not a recognized filesystem.

                          • 10. Re: Basic VMDK-repair know-how
                            continuum Guru User Moderators vExpert

                            But a 'df' showed only 17% occupied - only the basic files on the disk, not my data. 

                             

                            Oh dear - sounds like you are about to messup the data you got inside a snapshot.

                             

                            STOP playing with the disk now.

                            Post more info so that we better understand what you are doing.

                            • 11. Re: Basic VMDK-repair know-how
                              yt100 Novice

                              When I tried vmwar-mount:

                              vmwar-mount.ext R: baddisk.vmdk

                              It didn't complain, then I did

                              dir R:

                              It said: The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. I tried to see it from a windows explorer and it showed Local Disk (R:). But when I clicked it, it said 'disk in drive R: is not formated. Do you want to format it now?'

                               

                              When I mounted a good disk using vdk, I still can't do dir to see what's on it. Have I missed anything? I'm using suse Linux ReiserFS filesystem. Is this a problem?

                               

                              Concerning question from  RDPetruska: I think I should have had some filesystem drivers installed - I used to map the (currently broken) disk to drive z: and access files there from windows. Should I start the drivers specifically? If so, how do I do this?

                               

                              I guess I messed it up by doing this:

                              I had a vmx1.vmx which contains some settings and later I had another vmx2.vmx containing different settings. The differences are:

                              vmx1.vmx: using NAT;

                              vmx2.vmx: using bridged, and different mac address at the line: Ethernet0.address from vmx1.vmx

                               

                              But the brutal bit I guess is that they both use the same vmdk file. When I start VMWare using either of the .vmx files, I see 2 sets of different files, feeling like they're using 2 different disks. It didn't break until files grew rapidly using vmx2.vmx (I haven't used vmx1.vmx for some time now). 

                               

                              I don't know what happened exactly but what I did must have been wrong. I haven't lost too much unsaved data but it'd be nice if I can get it back. Also I'd like to know if there is a cure for this messy problem.

                              • 12. Re: Basic VMDK-repair know-how
                                continuum Guru User Moderators vExpert

                                using riserFS from a vdk-mounted disk will be tricky.

                                I don't know if there is a good and stable driver for riserFS-for-win32 at all ...

                                 

                                If you want to dig into your disk-problem post the vmx-file you want to use.

                                Also post the output of

                                dir /b \*.* > filelist.txt

                                • 13. Re: Basic VMDK-repair know-how
                                  yt100 Novice

                                  Here is the file list: you can see 2 sets of files for the 2 vmx files. The "_2" files are the corrupted ones.

                                   

                                  filelist.txt

                                  nvram

                                  RED_VMWare_Build_VM_0_05.vmem

                                  RED_VMWare_Build_VM_0_05.vmss

                                  RED_VMWare_Build_VM_0_05.vmx

                                  RED_VMWare_Build_VM_0_05_2.vmem

                                  RED_VMWare_Build_VM_0_05_2.vmss

                                  RED_VMWare_Build_VM_0_05_2.vmx

                                  vmware-0.log

                                  vmware-1.log

                                  vmware-2.log

                                  vmware.log

                                   

                                   

                                  The .vmx file for the corrupted disk:

                                   

                                  #!/usr/bin/vmware

                                  config.version = "7"

                                  virtualHW.version = "3"

                                  memsize = "1480"

                                  ide0:0.present="TRUE"

                                  ide0:0.fileName = "15Gdrive.vmdk"

                                  ide1:0.present = "TRUE"

                                  ide1:0.fileName = "auto detect"

                                  ide1:0.deviceType = "atapi-cdrom"

                                  floppy0.fileName = "/dev/fd0"

                                  Ethernet0.present = "TRUE"

                                  usb.present = "TRUE"

                                  displayName = "KDE 3.5 on SUSE Linux 10"

                                  guestOS = "other26xlinux"

                                  priority.grabbed = "normal"

                                  priority.ungrabbed = "normal"

                                  powerType.powerOff = "soft"

                                  powerType.powerOn = "hard"

                                  powerType.suspend = "hard"

                                  powerType.reset = "soft"

                                   

                                  floppy0.present = "FALSE"

                                  sound.present = "TRUE"

                                  sound.virtualDev = "es1371"

                                  sound.fileName = "-1"

                                   

                                  ide1:0.startConnected = "FALSE"

                                  Ethernet0.addressType = "static"

                                  ethernet0.address = "00:50:56:11:22:33"

                                   

                                  ide1:0.clientDevice = "FALSE"

                                  Ethernet0.connectionType = "bridged"

                                   

                                  uuid.action = "create"

                                   

                                  sound.startConnected = "FALSE"

                                   

                                  undopoints.seqNum = "0"

                                  scsi0:0.mode = "persistent"

                                  undopoint.restoreFromCheckpoint = "FALSE"

                                  undopoint.checkpointedOnline = "TRUE"

                                   

                                  undopoint.protected = "FALSE"

                                  gui.restricted = "FALSE"

                                   

                                  tools.syncTime = "FALSE"

                                   

                                  scsi0:0.redo = ""

                                  sound.autodetect = "TRUE"

                                   

                                  ide1:0.autodetect = "TRUE"

                                   

                                  uuid.location = "56 4d e2 a7 07 31 54 84-34 69 8a 55 9c 89 e2 0c"

                                  uuid.bios = "56 4d e2 a7 07 31 54 84-34 69 8a 55 9c 89 e2 0c"

                                   

                                  usb.autoConnect.device0 = ""

                                   

                                  scsi0:1.redo = ""

                                   

                                  ide0:0.redo = ""

                                  ide0:0.deviceType = "ata-hardDisk"

                                   

                                  tools.remindInstall = "FALSE"

                                   

                                   

                                  Thanks very much!

                                  • 14. Re: Basic VMDK-repair know-how
                                    continuum Guru User Moderators vExpert

                                    ?

                                     

                                    you use subdirectories to store the vmdk-files ?

                                     

                                    Please post a filelist that list up all files - including the *.vmdks - where -ever you may have stored them ?

                                    1 2 Previous Next