zoukankan      html  css  js  c++  java
  • DiskPart.exe and managing Virtual Hard Disks (VHDs) in Windows 7

    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.

    1. 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: est.vhd maximum=20000 type=expandable
    2. 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: est.vhd
      attach vdisk
      create partition primary
      format fs=ntfs label="Test VHD" quick
      assign letter=v

    3. Detaching the VHD
      To detach (i.e. unmount) the VHD, use the following example:

      select vdisk file=c: est.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:

    • create vdisk file=c: estdiff.vhd parent=c: est.vhd – This will create a differencing "child" VHD (testdiff.vhd) so that the existing parent VHD (test.vhd) is not modified.  Useful when you have an image on the parent VHD that you don’t want modified.  When needing to go back to the default image, only the differencing VHD would need to be replaced.  The differencing VHD typically starts out very small – usually less than a megabyte.  As a result, it is easy to back up and replace.
    • expand vdisk maximum=<size in mb> – This expands the maximum size on a VHD.  For this to work, the virtual disk must already be selected, detached and be a non-differencing VHD.  In addition, if you do have a differencing VHD and expand the parent VHD, you will need to create a new differencing VHD.  Otherwise you will encounter a VHD corruption error when trying to select/manage the differencing VHD.
    • merge vdisk depth=1 – Merges a child VHD with its parent.  This command can be used to merge one or more differencing ("child") VHDs with its corresponding parent VHD.
    • compact vdisk – Compacts a selected VHD to reduce the physical size.  Can only be used on VHDs that are type expandable and are either detached, or attached as read only.

    Resources

  • 相关阅读:
    swift--使用URLSession异步加载图片
    swift--浮点数转换成整数(四舍五入/直接截断)
    swift--环形进度条(UIActivityIndicatorView)的用法
    swift--Timer实现定时器功能,每个一段时间执行具体函数,可以重复,也可以只执行一次
    HTML节点树
    网页的结构
    网页的组成
    HTTP 请求过程
    HTTP 基础术语
    《投资最重要的事》
  • 原文地址:https://www.cnblogs.com/liujx2019/p/11692457.html
Copyright © 2011-2022 走看看