Formats an existing volume or a new volume on an existing partition on Windows
- The :ref:`community.windows.win_format <community.windows.win_format_module>` module formats an existing volume or a new volume on an existing partition on Windows
Note
- Microsoft Windows Server 2012 or Microsoft Windows 8 or newer is required to use this module. To check if your system is compatible, see https://docs.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version.
- One of three parameters (drive_letter, path and label) are mandatory to identify the target volume but more than one cannot be specified at the same time.
- This module is idempotent if force is not specified and file system labels remain preserved.
- For more information, see https://docs.microsoft.com/en-us/previous-versions/windows/desktop/stormgmt/format-msft-volume
.. seealso:: :ref:`community.windows.win_disk_facts_module` The official documentation on the **community.windows.win_disk_facts** module. :ref:`community.windows.win_partition_module` The official documentation on the **community.windows.win_partition** module.
- name: Create a partition with drive letter D and size 5 GiB
community.windows.win_partition:
drive_letter: D
partition_size: 5 GiB
disk_number: 1
- name: Full format the newly created partition as NTFS and label it
community.windows.win_format:
drive_letter: D
file_system: NTFS
new_label: Formatted
full: True
- Varun Chopra (@chopraaa) <[email protected]>