Format Drive command

by admin on April 15, 2012

In Windows, we can format a disk drive from command line also. We can use the inbuilt command ‘format’ for this. 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 this command.

Format a disk drive

format driveletter /fs:Fstype /v:newlabel

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 runnin the command on the right drive.

Example: Format the drive F: with ntfs filesystem and assign the label ‘Backup’

format f: /fs:ntfs  /v:Backup

How to do Quick format?

The above command may take serveral minutes depending on the size of the drive. If you want to quicky format the drive, you can use the option ‘/q’.

format f: /fs:ntfs  /v:Backup  /q

Example:

c:\>format f: /fs:ntfs /v:NewVolume /q
The type of the file system is NTFS.

WARNING, ALL DATA ON NON-REMOVABLE DISK
DRIVE F: WILL BE LOST!
Proceed with Format (Y/N)? y
QuickFormatting 185055M
Creating file system structures.
Format complete.
     180.7 GB total disk space.
     180.6 GB are available.
c:\>

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 F: /fs:ntfs /v:backup /q /a:4096

Format command works on all Windows releases : XP, Server 2003, Vista, Windows 7 and Windows 8.

This command should be executed from elevated admistrator command prompt. Otherwise, you would get the below error.

C:\>format f: /fs:ntfs
Access Denied as you do not have sufficient privileges.
You have to invoke this utility running in elevated mode.

Related Posts:

Command line disk cleanup

{ 0 comments… add one now }

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: