CMD Chkdsk To repair Bad Sectors (3 CMD)

This page will introduce several ways to use chkdsk cmd to repair bad blocks on your hard drive, external hard drive, usb stick, sd card etc. on Windows computers.

#1 Chkdsk /f

Here are the steps to use chkdsk /f to remove bad blocks on Windows computers.

Remove Bad Sector using the Chkdsk CommandRepair bad blocks with cmd chkdsk h: /f that you need to replace h with your own drive letter that you want to repair its bad blocks

  • Insert external storage such as usb disk or usb thumb drive to pc at first. If it's an sd card, or micro sd card, you need to use a memory card reader that can get it connected and recognized as a drive in Windows computer
  • Open THIS PC (Windows 10) or My Computer (Windows XP 7) and find out which drive letter your disk or usb shows, and remember it. Here we suppose the usb stick that we want to repair its bad blocks shows drive H in the computer.
  • Run cmd with admin privilege (You need to open your computer with admin privilege before all this. If you are using a visitor not admin privilege, you need to find out a computer that does give you the admin privilege to run the pc). You may go to the left corner blank space and type CMD and right click and run cmd with admin privilege
  • Type H: and press enter on the pop up cmd window (You need to replace the H drive letter with your own storage media drive letter, for example if your usb stick shows drive E, you need to type E: and press enter.)
  • Type chkdsk /f and press enter

Note: The example image shows the command chkdsk h: /f that combined the step 4 and step 5 into one command.

#2 Chkdsk /f /r

This is an advanced chkdsk command line based on chkdsk /f. You may use this one as well for a hard disk or usb stick or sd card bad blocks repairing with the following steps (almost the same as the previous steps).

chkdsk/f/r i: (when your drive shows drive letter i)

Remove Bad Sector from usb drive using the Chkdsk Command

  • Insert external drive to pc if it's a removable one (usb drive, external hdd, sd card...)
  • Open THIS PC on desktop to see which drive letter you want to get it repaired
  • Run cmd
  • Type i: and press enter key on your keyboard (You need to replace i with the drive letter of your own storage media)
  • Type chkdsk /f /r and press enter

#3 Chkdsk /f /r /x

This is another advanced command line that can be used for repairing bad blocks on your storage media no matter it's an internal disk partition or some external storage devices. Here are the steps to do the repairing.

  • Insert external storage media to pc if it's the external drive that you want to get it repaired
  • Open THIS PC on desktop, and remember which drive letter it has, suppose it has drive letter H
  • Run cmd
  • Type H: and press enter
  • Type chkdsk /f /r /x and press enter. Or you may combine the step 4 and step 5 into this command line: chkdsk h: /f /r /x and press enter (The following image shows a drive letter i as an instance)Remove Bad Sector from usb drive using the Chkdsk Command

Another example: chkdsk g: /f /r /x when you want to repair your G drive on your computer.

Remove Bad Sector from usb drive using the Chkdsk Command

The /f parameter tells CHKDSK to fix any errors it finds.
The /r parameter tells it to find bad sectors on the drive and restores readable information.
The /x parameter forces the drive to be unmounted before the process starts.

Chkdsk parameters

The detailed parameter description is as follows:

CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]
volume specifies the drive (followed by a colon), mount point, or volume name.
filename FAT/FAT32 only: Specifies the file to check for fragmentation.
/F Fix errors on disk.
/V on FAT/FAT32: Displays the full path and name of each file on the disk.
On NTFS: If there is a purge message, display it.
/R Finds incorrect sectors and restores readable information (implies /F).
/L:size NTFS only: Change the log file size to the specified number of KB.
If no size is specified, the current size is displayed.
/X Forces the volume to unmount first if necessary.
All open handles to the volume are invalidated (implies /F).
/I NTFS only: Perform a less intensive check on index entries.
/C NTFS only: Skip circular checking of folder structure.
The /I and /C command line switches skip certain checks for volumes, reducing the time required to run Chkdsk.

#4 Diskpart cmd to check bad blocks

Diskpart can also help fix logical errors on your storage media with its command line without quick format since quick format will start a formatting without checking bad blocks.

format fs=fat32

Format fs=fat32 is the diskpart command that you may use it to get your drive formatted to file system fat32.

format fs=ntfs

Format fs=ntfs is to format a drive with file system ntfs.

Some related errors

Here are some possible errors that you may see when you use chkdsk for repairing your storage media.

#1 chkdsk is not available for raw drives

Remove Bad Sector from usb drive using the Chkdsk Command

When your storage media shows error in the command such as: 'The type of the file system is raw. Chkdsk is not available for raw drives.' it could report such message when your device has logical errors especially when its file system is damaged.

#2 Chkdsk cannot run because the volume is in use

Remove Bad Sector from usb drive using the Chkdsk Command

It often happens to c drive when you want to repair the bad blocks on the system c volume which is currently running the OS.

As it instructed in the message that you may type Y in the cmd to give permission to the cmd and get the c drive checked next time when you run your computer.

Also read: how to remove bad sector in 5 ways

Related Questions

Question: how to check bad sector hdd cmd

If you want to check and repair bad sector on hdd using cmd, you may try chkdsk /f and get your hdd as target for the repairing since chkdsk is provided by Windows computer for checking and repairing bad sectors.

Question: Can chkdsk repair bad sectors?

Yes, chkdsk can detect and repair hard disk bad sectors with the following method:
Click "Start", "Run", enter CMD and press enter;
Open a command prompt window, Enter the following command in this window: for example, check and repair D partition: CHKDSK d: /f. Press enter to start CHKDSK disk inspection tool to scan D partition and get bad sectors repaired.

Related Articles