Quantcast
Channel: VMware Communities : Unanswered Discussions - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 872

How to repair corrupt vmware disk with linux partition on it?

$
0
0

Okay I have a damaged windows disk running vmplayer and linux ubuntu12 on the VM, and amazingly my backup portable hardrive also has corruption so the only thing I can do is try repair.

 

I have looked at vmware-vdiskmanager and vmwarediskmout but it ooks like they only handle windows virtual disks? link ---> Running the VMware Virtual Disk Manager Utility

 

The main problem is that vmwareplayer will not allow the vm to run if it thinks there is a problem with the disk so I cannot access the drive at all without getting vmwareplayer to load the system.

 

So I started playing with things to see what I could do.

 

The VM had 2 virtual disks only 1 is corrupt, the disks are split as 2Gb sections on a windows system.

 

So luckily the corrupt drive was not the boot drive so I edit the VM .vmx file and change the config line to remove the corrupt virtual disk ( scsi0:1.present = "FALSE"), so now my VM boots and I can get some of my files back, but still there is a huge amount of important data on the second drive.

 

The next bit is a terrible hack but it got a little more data off the corrupt virtual disk file, I could see which 2Gb file was corrupt cause the copy had a different file mod date as it could not be correctly copied from the host windows systems disk, so I copied one of the other 2Gb .vmdk files and renamed it to the same as the corrupted file then edit the machine .vmx file back to  ( scsi0:1.present = "TRUE"), and amazingly the is now no problem booting and mounting the linux ext2 drive within the VM. I have started copying off some files but there are a few directorys that have errors filessystem superblock error (obviously dues to the image being totally incorrect) I want to go  further with trying to get as much data as possible restored,

 

What I need to know is how does vmwareplayer decide a file is corrupted and refuse to run because of it?

 

Obviously it does not do a perfect check as simply copying one of the other .vmdk files and renaming it allows the VM to boot and access the diskfiles.

 

I am wondering what the low level layout of the vmdk files is, my guess is if I either reset the timestamp date of the 2gb corruptfile, add some extra blank data to the end of the file to make it the correct size, or modify the first few bytes of the file to have a correct checksum then it will allow access to the file.

 

The corrupt file obviously should be 2Gb, and shows on the backup as 2,095,488kb the only problem I see is the tamestamp is different to all other .vmdk files.

 

Anyone have any ideas about how vmware disks can be repaired and how they are structured and error checked?


Viewing all articles
Browse latest Browse all 872

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>