Format Drive command
In Windows, we can format a disk drive using inbuilt command ‘format’ . What ever we can do in the disk management tool, we can do the same using format command.В This article explains the different options available for the command.
Format a disk drive
When you execute this command, you will be asked to enter the current label of the drive(if it has a label) and also to confirm if you really want to format the drive. Accidentally running a format command would cause data loss. So be sure you are running the command on the right drive.
Example: Format the drive F: with NTFS filesystem and assign the label ‘Backup’
How to do Quick format
The above command may take several minutes depending on the size of the drive. If you want to quicky format the drive, you can use the option ‘/q’.
If you want to enable compression on the drive, you can do that by adding the option ‘/C‘. This can be done later also by opening the properties of the disk drive.
We can also configure the file system allocation unit size. For example, if you want to use 4096 bytes as one allocation unit, then you can run the below command.
Format command works on all Windows releases : XP, Server 2003, Vista, Windows 7 and Windows 8.
This command should be executed from elevated administrator command prompt. Otherwise, you would get the below error.
go to start/program/accessories/command prompt Steve Macha
How would I use the in-line disk format command and suppress all user interactivity? It seem that with Windows 10 the /y switch no longer works.
Looks like you need to use /x option to unmount the drive first which should suspend all user activity. I do not see /y in documentation or in help for the command.
Hi, if you’re still reading, the other trick, to push a ‘y’ at any CLI instruction that demands confirmation is ‘echo y | format XYZ’ the | character streams whatever the previous command outputs into the next command as if it were keyboard input.
i want to reinstall from disc after the f disc command how do ido that it inspiron ;laptop with xp pro
Format
Applies to: Windows 10, Windows Server 2016
Formats a disk to accept Windows files. You must be a member of the Administrators group to format a hard drive.
You can also use the format command, with different parameters, from the Recovery Console. For more information about the recovery console, see Windows Recovery Environment (Windows RE).
Syntax
Parameters
Parameter | Description | ||
---|---|---|---|
Specifies the mount point, volume name, or drive letter (followed by a colon) of the drive that you want to format. If you do not specify any of the following command-line options, format uses the volume type to determine the default format for the disk. | |||
/fs: FAT32 | NTFS> | Specifies the type of file system (FAT, FAT32, NTFS). | |
/v: | Specifies the volume label. If you omit the /v command-line option or use it without specifying a volume label, format prompts you for the volume label after the formatting is complete. Use the syntax /v: to prevent the prompt for a volume label. If you use a single format command to format more than one disk, all of the disks will be given the same volume label. | ||
/a: | Specifies the allocation unit size to use on FAT, FAT32, or NTFS volumes. If you don’t specify unitsize, it’s chosen based on volume size. Default settings are strongly recommended for general use. The following list presents valid values for NTFS, FAT, and FAT32 unitsize:
FAT and FAT32 also support 128K and 256K for a sector size greater than 512 bytes. | ||
/q | Performs a quick format. Deletes the file table and the root directory of a previously formatted volume, but does not perform a sector-by-sector scan for bad areas. You should use the /q command-line option to format only previously formatted volumes that you know are in good condition. Note that /q overrides /p. | ||
/f: | Specifies the size of the floppy disk to format. When possible, use this command-line option instead of the /t and /n command-line options. Windows accepts the following values for size:
| ||
/t: | Specifies the number of tracks on the disk. When possible, use the /f command-line option instead. If you use the /t option, you must also use the /n option. These options together provide an alternative method of specifying the size of the disk that is being formatted. This option is not valid with the /f option. | ||
/n: | Specifies the number of sectors per track. When possible, use the /f command-line option instead of /n. If you use /n, you must also use /t. These two options together provide an alternative method of specifying the size of the disk that is being formatted. This option is not valid with the /f option. | ||
/p: |
Remarks
The format command creates a new root directory and file system for the disk. It can also check for bad areas on the disk, and it can delete all data on the disk. To be able to use a new disk, you must first use this command to format the disk.
After formatting a floppy disk, format displays the following message:
Volume label (11 characters, ENTER for none)?
To add a volume label, type up to 11 characters (including spaces). If you do not want to add a volume label to the disk, press ENTER.
When you use the format command to format a hard disk, a warning message similar to the following displays:
To format the hard disk, press Y; if you do not want to format the disk, press N.
FAT file systems restrict the number of clusters to no more than 65526. FAT32 file systems restrict the number of clusters to between 65527 and 4177917.
NTFS compression is not supported for allocation unit sizes above 4096.
Format will immediately stop processing if it determines that the previous requirements can’t be met using the specified cluster size.
When formatting is complete, format displays messages that show the total disk space, the spaces marked as defective, and the space available for your files.
You can speed up the formatting process by using the /q command-line option. Use this option only if there are no bad sectors on your hard disk.
You shouldn’t use the format command on a drive that was prepared by using the subst command. You can’t format disks over a network.
The following table lists each exit code and a brief description of its meaning.
Exit code | Description |
---|---|
0 | The format operation was successful. |
1 | Incorrect parameters were supplied. |
4 | A fatal error occurred (which is any error other than 0, 1, or 5). |
5 | The user pressed N in response to the prompt «Proceed with Format (Y/N)?» to stop the process. |
You can check these exit codes by using the ERRORLEVEL environment variable with the if batch command.
Examples
To format a new floppy disk in drive A using the default size, type:
To perform a quick format operation on a previously formatted floppy disk in drive A, type:
To format a floppy disk in drive A and assign it the volume label DATA, type:
MS-DOS and Windows command line format command
The format command is used to erase information from a computer diskette or fixed drive.
Although the information appears to be erased, it is still possible for software recovery programs to recover information from a formatted drive. If you want to make sure no information can be recovered from a drive, use a software utility to make sure all data is erased and overwritten. See: How to make sure all data is erased on a computer hard drive.
Availability
Format is an external command that is available for the following Microsoft operating systems as format.com.
Format syntax
Windows Vista and later syntax
volume | Specifies the drive letter (followed by a colon), mount point, or volume name. |
/FS:filesystem | Specifies the file system (FAT, FAT32, exFAT, NTFS, UDF, ReFS). |
/V:label | Specifies the volume label. |
/Q | Performs a quick format. Note that this switch overrides /P. |
/C | NTFS only: Files created on the new volume will be compressed by default. |
/X | Forces the volume to dismount first if necessary. All opened handles to the volume would no longer be valid. |
/R:revision | UDF only: Forces the format to a specific UDF version (1.02, 1.50, 2.00, 2.01, 2.50). The default revision is 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 |