PDF Creator | PDF Converter | PDF Software | Create PDF Send posts as PDF to


Share/Bookmark

Quick Fixed VHD Creation Tool

Quick Fixed VHD Creation Tool

Postby Ernie » Tue Sep 20, 2011 3:20 pm

This tool allows you to create fixed size virtual hard disks very rapidly. You should be aware that the technique used means that it is possible to access data that was previously deleted off of the physical hard disk by running data recovery tools inside the virtual machine. As such you should only use this tool when you can trust all users of the virtual machine.

VhdTool.zip
VHD Tool 2.0 Final
(29.42 KiB) Downloaded 426 times

Latest News

    • The final release of v2 is now available.
    • I've added a "repair" function which is designed to undo an expand operation on a base VHD when differencing VHDs are present. This is useful in cases where an admin accidentally expands a base VHD when Hyper-V snapshots are present.
    • To ensure data integrity in the case of an error, please make a backup copy of your VHDs before altering them with this tool.
Introduction

VHD tool is an unmanaged code command-line tool which provides useful VHD manipulation functions including instant creation of large fixed-size VHDs. The source code is included.

Requirements

    • A computer running one of the following Windows operating systems:
      ♦ Server: Windows Server 2003 or above
      ♦ Client: Windows XP or above
    • NTFS file system

Usage

    VhdTool.exe /create <FileName> <Size> [/quiet]
    VhdTool.exe /convert <FileName> [/quiet]
    VhdTool.exe /extend <FileName> <NewSize> [/quiet]
    VhdTool.exe /repair <BaseVhdFileName> <FirstSnapshotAVhdFileName> [/quiet]

    Create:
      Creates a new fixed format VHD of size <Size>.
      WARNING - this function is admin only and bypasses
      file system security. The resulting VHD file will
      contain data which currently exists on the physical disk.

    Convert:
      Converts an existing RAW disk image file to a fixed-format VHD.
      The existing file length, rounded up, will contain block data
      A VHD footer is appended to the current end of file.

    Extend:
      Extends an existing fixed format VHD to a larger size <Size>.
      WARNING - this function is admin only and bypasses
      file system security. The resulting VHD file will
      contain data which currently exists on the physical disk.

    Repair:
      Repairs a broken Hyper-V snapshot chain where an administrator
      has expanded the size of the root VHD. The base VHD will be
      returned to its original size. THIS MAY CAUSE DATA LOSS if the
      contents of the base VHD were changed after expansion.

Known Issues
There are currently no known issues.

Examples

Create a new 10 GB fixed VHD in the current directory.
VhdTool.exe /create "c:\Program Files\MyApp\foo.vhd" 10737418240

Convert an existing flat image file into a VHD & do not output status to the command line.
VhdTool.exe /convert bar.img /quiet

Extend an existing fixed format VHD to a larger size.
VhdTool.exe /extend foo.vhd 21474836480

Repair a Hyper-V snapshot chain broken by expanding the base VHD.
VhdTool.exe /repair base.vhd base_EF2F9402-E85B-402F-A979-631CB287C2C4.avhd

Drive Size Key

5GB = 5368709120
10GB = 10737418240
25GB = 26843545600
50GB = 53687091200
75GB = 80530636800
100GB = 107374182400
150GB = 161061273600
200GB = 214748364800
250GB = 268435456000
500GB = 536870912000

Links
VHD Specification

http://archive.msdn.microsoft.com/vhdtool
Ernie
Site Administrator
User avatar
Ernie

i'm still here

Site Admin
Site Admin
 
Posts: 206
Joined: Sat Nov 22, 2008 5:32 pm
Location: New Jersey
Highscores: 20
WordPress Blog: Visit User's Blog

Share/Bookmark

Re: Quick Fixed VHD Creation Tool

Postby rfuran » Wed Mar 18, 2015 11:17 am

Hi,
Trying to create a 2TB vhd file and getting this error. The file was created however.

Error: Unable to set valid data length with error:The system call level is not correct.

And when looking at the Properties of the drive that I am putting this file on, it appears that the space that it should be taking up is not accounted for...

Randy
rfuran
 
Posts: 2
Joined: Wed Mar 18, 2015 11:08 am

Share/Bookmark

Re: Quick Fixed VHD Creation Tool

Postby Ernie » Wed Mar 18, 2015 12:02 pm

The VHD tool has a 2TB limit which I suppose is the problem here. I have had similar issues creating a file that large and my only option was to create one a little smaller
Ernie
Site Administrator
User avatar
Ernie

i'm still here

Site Admin
Site Admin
 
Posts: 206
Joined: Sat Nov 22, 2008 5:32 pm
Location: New Jersey
Highscores: 20
WordPress Blog: Visit User's Blog

Share/Bookmark

Re: Quick Fixed VHD Creation Tool

Postby rfuran » Thu Mar 19, 2015 8:44 am

Thanks Ernie,
I thought that may be it as well so I tried it on a local drive and it worked. I need the files are on a NAS box and that's where it fails. Also tried it on a couple of other network shares and they failed too. Now I'm looking at Plan B...
rfuran
 
Posts: 2
Joined: Wed Mar 18, 2015 11:08 am

Share/Bookmark


Similar topics


Return to Hyper-V

Who is online

Users browsing this forum: No registered users and 0 guests

cron