Format a disk for use with Windows.

      FORMAT volume [/FS:file-system] [/V:label] [/Q] [/L] [/A:size] [/C] [/I:state] [ /X] [/P:passes] [/S:state]
      FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes]
      FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes]
      FORMAT volume [/V:label] [/Q] [/P:passes]
      FORMAT volume [/Q]

   volume          The drive letter (followed by a colon), mount point, or volume name.

   /FS:file-system The type of the file system (FAT, FAT32, exFAT, NTFS, UDF, ReFS).
/V:label The volume label.
/Q Perform a quick format. This switch overrides /P (zero out bytes).
/C Compression - files added to the new disk will be compressed by default (NTFS only). /X Force the volume to dismount first if necessary. All opened handles to the volume would no longer be valid. /R:revision UDF only: Force the format to a specific UDF version (1.02, 1.50, 2.00, 2.01, 2.50). default= 2.01 /D UDF 2.50 only: Metadata will be duplicated. /L NTFS Only: Use large size file records. By default, the volume will be formatted with small size file records. /A:size Override the default allocation unit size. Default settings are strongly recommended for general use. See below for allocation unit sizes. NTFS compression is not supported for allocation unit sizes above 4096. /T:tracks The number of tracks per disk side. /N:sectors The number of sectors per track. /P:count Zero every sector on the volume. After that, the volume will be overwritten "count" times using a different random number each time. If "count" is zero, no additional overwrites are made after zeroing every sector. This switchis ignored when /Q is specified. /S:state Support for short filenames (enable, disable) Short names are disabled by default /I:state ReFS only: enable integrity on the new volume. "state" is either "enable" or "disable" Integrity is enabled on storage that supports data redundancy by default. /F:size The size of the floppy disk to format (720, 1.2, 1.44, 2.88, or 20.8). /DAX[:state] NTFS Only: Enable direct access storage (DAX) mode for this volume. In DAX mode, the volume is accessed via the memory bus, boosting IO performance. A volume can be formatted with DAX mode only if the hardware is DAX capable. State can specify "enable" or "disable". * Windows 10+ /DAX is considered as /DAX:enable. /LogSize[:size] NTFS Only: The size for NTFS log file in kilobytes. The minimum supported size is 2MB, so specifying size smaller than 2MB will result in a 2MB log file. Zero indicates the default value which generally depend on the volume size. * Windows 10+ /NoRepairLogs NTFS Only: Disable NTFS repair logs. * Windows 10+ If the flag is set spotfix (i.e. chkdsk /spotfix) will not work. Allocation unit sizes: ReFS supports 64K. NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K. FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes). FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes). exFAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M.

The FAT and FAT32 files systems impose the following restrictions on the number of clusters on a volume:
FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 4177918


@echo off
Echo Warning this will reformat the entire D: disk!
format D: /FS:NTFS /x

"The disks had a recording density of 1,100 bits per inch, and could move data out of the drive at 77 kilobytes per second" ~ Early hard drive specs.

Related commands

DISKPART - Disk Administration.
SYSPREP - (Generalize) a Windows installation.
Q140365 - Default cluster size for NTFS, FAT, and exFAT.
Q17423 - How to create a Bootdisk.
Equivalent bash command (Linux): mkfs, in FreeBSD & OSX: newfs, fsck_exfat

Copyright © 1999-2024
Some rights reserved