Skip to content

Zero Copy VHD Converter

License

Notifications You must be signed in to change notification settings

0xbadfca11/makevhdx

Repository files navigation

MakeVHDX Build status

Converting a VHD/VHDX to VHD/VHDX using block cloning to share used data blocks. This is proof of concept.

Make VHD/VHDX that shares data blocks with source.

MakeVHDX [-fixed | -dynamic] [-bN] [-sparse] Source [Destination]

Source       Specifies conversion source.
Destination  Specifies conversion destination.
             If not specified, will use file extension
             exchanged with ".vhd" when the source is ".vhdx", exchanged with ".vhdx" otherwise.
-fixed       Make output image is fixed file size type.
-dynamic     Make output image is variable file size type.
             If neither is specified, will be same type as source.
-b           Specifies output image block size by 1MB. It must be power of 2.
             Silently ignore, if output is image type that doesn't use blocks. (Such as fixed VHD)
-sparse      Make output image is sparse file.
             By default, output file is also sparse only when source file is sparse.

Supported Image Types and File Extensions
 VHDX : .vhdx (.avhdx Disallowed)
 VHD  : .vhd  (.avhd  Disallowed)
 RAW  : .* (Other than above)

Requirements and Limitations

  • Source and destination must have placed on same ReFS v2 volume.
  • Differencing type can not be source and/or destination.

Convertion from VHD

Convertion to VHD

  • When cluster size is 64 KB, alignment will be 64 KB. Will break alignment when update with any VHD parser.
  • Block size less than 1 MB can not be specified.
  • Block size other than 2 MB can be specified, but only 2 MB can be used by Microsoft VHD parser.

Convertion from Fixed type to Dynamic type

  • Output image will be large. This tool does not inspect file system free space in image, or zero-ed data block.

License

MIT License