VMware

This Question is Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
6 Replies Last post: Nov 3, 2009 8:42 AM by sudarsan  

Mapping disk to drive letter posted: Oct 21, 2009 1:16 PM

Click to view giladb's profile Enthusiast 37 posts since
Mar 21, 2008
I am running on Linux, and inspecting a Windows disk.
How can my application find out what drive letter the disk is mounted on ?
Is VixMntapi_GetVolumeInfo the right API ?

Re: Mapping disk to drive letter

2. Oct 26, 2009 10:06 AM in response to: giladb
Click to view sudarsan's profile Expert 263 posts since
Sep 20, 2006
Not sure what you are trying to do - but extracting such information from Windows (NTFS or FAT) volumes is not supported if the application is running on Linux - this is because VDDK uses Windows API's to parse the registry hives of the guest to get information like drive letters.

Thanks
Sudarsan

Re: Mapping disk to drive letter

4. Oct 26, 2009 10:23 AM in response to: giladb
Click to view sudarsan's profile Expert 263 posts since
Sep 20, 2006
OK, thanks. I will make sure I will get it documented.

Apologies for the confusion,

-Sudarsan

Re: Mapping disk to drive letter

6. Nov 3, 2009 8:42 AM in response to: giladb
Click to view sudarsan's profile Expert 263 posts since
Sep 20, 2006
It is a bit convoluted, hopefully you can make it all work:

  • You need libraries to parse the NTFS and / or FAT
  • You also need code to parse the mbr and get the offsets for the volumes
  • Looking at the MBR, you can find which is the system volume - and from here get either boot.ini or boot bcd.
  • Once you have the volume offsets, you can parse the ntfs / fat file system structures to get to the boot.ini (or bcd hive) and look for the boot volume (the one that has windows directory)
  • You can then read the registry file and parse it in anyway you like

There are some additional issues with dynamic volumes - but once you have the above working, it is not that difficult.

Thanks
Sudarsan

Developer Social Media

Communities