Jump to content











Photo
- - - - -

vhd2img


  • Please log in to reply
6 replies to this topic

#1 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 30 December 2011 - 01:21 PM

Posted Image

File Name: vhd2img
File Submitter: erwan.l
File Submitted: 30 Dec 2011
File Category: Tools

This is a command line tool to manipulate vhd files : conversion (from/to vhd) and resizing.

This is alpha version.
Idea is to share the code source (delphi) to help other dev guys out there and to eventually add options later on.

Do not use this in your production environement unless you have backups !

Converting to img will create a new file.
Converting to a dynamic vhd will create a new file.
Converting to a fixed vhd will not create a new file but alter the current img file.

/Erwan

Click here to download this file
  • Nuno Brito likes this

#2 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 30 December 2011 - 02:44 PM

Thanks Erwan,

I'm going to try it. A question though: when you convert a fixed IMG to fixed VHD in-place, can it change adjacent HD sectors, if they hold bytes from a different unrelated file?

#3 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 30 December 2011 - 03:22 PM

Hi Sambul61,

When converting an image file (raw and therefore always fixed is not it?) I simply append a footer at the end of the file.
This is actually the most simple scenario.

Is this what you meant?

Regards,
Erwan

#4 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 30 December 2011 - 03:55 PM

Yes,

But appending the footer takes some space after the image file - correct? What if some bytes from an unrelated file are store in that space - possible? Would you be inclined to check beforehand and move them to a different place in the right manner before appending the footer? :) What if there is no adjacent free space available to keep the fixed VHD contiguous?

#5 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 30 December 2011 - 04:37 PM

appending the footer to the file does not create any extra space except the 512 bytes footer.
so if your raw file was 1gb, the new file will be 1gb+512 bytes.

now if you are talking about unused space in the disk image (aka the raw file), the converter does not care about it.
same for the vhd file : it has no knowledge about what is in the file : it is a simple container with a footer giving basic informations like file size, type of vhd, etc.

to the question, could the converter re organise / optimise the vhd file, this is possible.
i could for example suggest converting a raw file containing a NTFS system to a dynamic VHD, copying only the used cluster.
that to me could be a good idea?

/erwan

#6 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 30 December 2011 - 05:44 PM

It sounds like a good idea. :)

Sfinktah plans to offer Plugin functionality in VHD Director. Your tool might be ideally suited for this role after some adjustment for compatibility - it would be the 1st 3rd party plugin for it. :thumbsup: You might want to ask him for more details, if interested.

#7 Dynthor

Dynthor

    Newbie

  • Validating
  • 13 posts
  •  
    United States

Posted 03 March 2012 - 04:12 AM

can you at least add a read me file explaining how to run




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users