coreygoOctober 7, 2009
In Windows 7, new commands have been added in DiskPart to allow for the creation and management of Virtual Hard Disks (.vhd files). The DiskPart VHD management commands have been provided below in 2 sections – commonly used commands with examples and other commands. It is assumed in each of the examples that DiskPart.exe has already been launched in an elevated command prompt.
**Creating a VHD
**The example below creates
a 20GB dynamically expanding VHD called "test.vhd" and places it in the
root of the C: drive. Note that the type parameter is optional and the default type is fixed.
_
create vdisk file=c:\test.vhd maximum=20000 type=expandable
_
**Attaching a VHD
**The following example
shows how to select and attach the VHD. It also provides steps for
partitioning, formatting and assigning a drive letter to the attached
VHD.
select vdisk file=c:\test.vhd attach vdisk create partition primary format fs=ntfs label="Test VHD" quick assign letter=v
**Detaching the VHD
**To detach (i.e. unmount) the VHD, use the following example:
select vdisk file=c:\test.vhd detach vdisk
Note: All 3 of these VHD actions can also be performed in the Disk Management Console of Windows 7.
In addition, below are some other DiskPart commands that can be used to manage VHDs:
****Resources
Tags
手机扫一扫
移动阅读更方便
你可能感兴趣的文章