.. _VM prl_disk_tool:

prl_disk_tool
---------------

The ``prl_disk_tool`` utility is used to manage virtual hard disk drives.

.. warning:: Only use ``prl_disk_tool`` on disks of stopped virtual machines.

::

    prl_disk_tool <command> [<options>] --hdd <disk_path> [<options>]
    prl_disk_tool --help

.. _VM prl_disk_tool compact:

prl_disk_tool compact
~~~~~~~~~~~~~~~~~~~~~~~

Removes all empty blocks from the expanding virtual disk to reduce its size on the physical hard disk. The virtual disk must be formatted to NTFS, ext2/ext3/ext4, btrfs, or xfs.

::

    prl_disk_tool compact --hdd <disk_path> [--force]
    prl_disk_tool compact -i, --info --hdd <disk_path>

+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| Name                                | Description                                                                                               |
+=====================================+===========================================================================================================+
| ``--hdd <disk_path>``               | Full path to the virtual disk.                                                                            |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``--force``                         | Forces the compacting operation for suspended virtual disks.                                              |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``-i, --info``                      | Do not compact the virtual disk; just display the information about the size the disk  will have after    |
|                                     | compacting.                                                                                               |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+

.. _VM prl_disk_tool merge:

prl_disk_tool merge
~~~~~~~~~~~~~~~~~~~~~

Merges all snapshots of the virtual hard disk.

::

    prl_disk_tool merge --hdd <disk_path>

+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| Name                                | Description                                                                                               |
+=====================================+===========================================================================================================+
| ``--hdd <disk_path>``               | Full path to the virtual disk.                                                                            |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+

.. _VM prl_disk_tool resize:

prl_disk_tool resize
~~~~~~~~~~~~~~~~~~~~~~

Changes the capacity of the specified virtual disk. During resizing, all data present on the disk volumes are left intact. You can also resize the last partition using the --resize_partition option. The supported file systems are NTFS, ext2/ext3/ext4, btrfs, or xfs.

::

    prl_disk_tool resize --size <size>[K|M|G|T] [--resize_partition] --hdd <disk_path> [--force]
    prl_disk_tool resize -i, --info [--units <K|M|G|T>] --hdd <disk_path>

+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| Name                                | Description                                                                                               |
+=====================================+===========================================================================================================+
| ``--size``                          | New size of the virtual disk. It can be set in kilobytes (specify ``K`` after the value), megabytes       |
|                                     | (``M``), gigabytes (``G``), or terabytes (``T``). By default, the size is set in megabytes.               |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``--resize_partition``              | Resizes the last partition of the specified virtual disk.                                                 |
|                                     |                                                                                                           |
|                                     | .. note:: You cannot reduce XFS filesystems (the default choice for CentOS 7 and Red Hat Enterprise       |
|                                     |    Linux 7).                                                                                              |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``--hdd <disk_path>``               | Full path to the virtual disk.                                                                            |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``--force``                         | Forces the resizing operation for suspended virtual disks.                                                |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``-i, --info``                      | Do not resize the virtual disk; just show the size the disk will have after resizing.                     |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
| ``--units``                         | Displays the disk size in kilobytes (``K``), megabytes (``M``, default), gigabytes (``G``), or terabyles  |
|                                     | (``T``).                                                                                                  |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------+
