Disk management

1.5 Given a scenario, use the appropriate Microsoft command-line tools.

📘CompTIA A+ Core 2 (220-1202)


In Windows, managing disks and storage isn’t only done through the graphical interface (like Disk Management). You can also use command-line tools, which are faster, scriptable, and essential for troubleshooting in IT environments.

There are three main tools you need to know:

  1. chkdsk
  2. format
  3. diskpart

Let’s go through each one.


1. chkdsk (Check Disk)

Purpose:
chkdsk is used to check a disk for errors and fix file system problems. In IT, hard drives or SSDs can develop errors due to improper shutdowns, power outages, or software crashes. chkdsk helps maintain the health of the disk.

Basic Usage:
Open Command Prompt as Administrator and type:

chkdsk [drive letter]: [options]

Examples:

  • Check a disk for errors (without fixing):
chkdsk C:
  • Check and fix errors automatically:
chkdsk C: /f
  • Scan and attempt to recover bad sectors (both logical and physical):
chkdsk C: /r

Important Options:

OptionWhat it does
/fFixes errors on the disk
/rLocates bad sectors and recovers readable information
/xForces the drive to dismount before checking (useful if the drive is in use)

Real-life IT example:
A server’s C: drive is acting slow and showing corrupted files. An IT technician runs:

chkdsk C: /f /r

This will check the drive, fix any file system errors, and recover data from bad sectors if possible.

Exam Tip:
Remember: /f fixes errors, /r locates bad sectors. /r implies /f.


2. format

Purpose:
format is used to prepare a disk for use by creating a new file system. This erases all existing data on the disk, so it’s used for initializing new drives or wiping old drives.

Basic Usage:

format [drive letter]: /FS:[file system]

Examples:

  • Format a drive with NTFS file system:
format D: /FS:NTFS
  • Format a USB drive with FAT32:
format E: /FS:FAT32

Important Options:

OptionWhat it does
/FS:NTFSCreates NTFS file system
/FS:FAT32Creates FAT32 file system
/QQuick format (does not scan for bad sectors)
/V:labelAssigns a name (volume label) to the disk

Real-life IT example:
An IT technician receives a new hard drive for a workstation. To make it usable, they run:

format F: /FS:NTFS /V:Data

This prepares the disk, sets it as NTFS, and names it “Data.”

Exam Tip:
Quick format (/Q) is faster but doesn’t check for bad sectors. Full format is slower but more thorough.


3. diskpart

Purpose:
diskpart is a powerful disk management tool that lets IT technicians create, delete, resize, and manage partitions on a disk. Unlike Disk Management GUI, diskpart works in command-line environments, scripts, and remote sessions.

How to start:
Open Command Prompt as Administrator and type:

diskpart

You will enter the diskpart prompt, where all commands are issued.


Common Commands in diskpart:

  1. List disks:
list disk
  • Shows all connected disks with size and status.
  1. Select a disk to work on:
select disk 1
  • Targets disk 1 for operations.
  1. Create a new partition:
create partition primary size=10000
  • Creates a primary partition of 10,000 MB (~10 GB).
  1. Format the partition:
format fs=ntfs quick label=Data
  • Quick formats the partition as NTFS and names it “Data.”
  1. Assign a drive letter:
assign letter=E
  • Makes the partition visible as drive E:.
  1. Delete a partition:
delete partition
  • Deletes the currently selected partition.

Real-life IT example:
A technician needs to set up a server with multiple partitions. Using diskpart, they:

  1. List all disks.
  2. Select the new disk.
  3. Create multiple partitions.
  4. Format them.
  5. Assign drive letters for different departments.

Key Exam Tips for Disk Management Commands

  • chkdsk = Check and repair disk errors.
  • format = Prepare or wipe a disk (file system creation).
  • diskpart = Advanced disk and partition management.

Remember:

  • chkdsk /f fixes errors.
  • chkdsk /r locates bad sectors.
  • format /FS:NTFS sets the file system.
  • diskpart commands are hierarchical: select disk → create partition → format → assign letter.

Quick Summary Table for Exam:

ToolFunctionKey Options/Commands
chkdskCheck/fix disk errors/f, /r, /x
formatFormat disk / create file system/FS:NTFS, /FS:FAT32, /Q, /V:label
diskpartManage disks and partitionslist disk, select disk, create partition, format fs=ntfs, assign letter

This is everything you need for the exam for disk management command-line tools, explained in a way that’s easy for both IT and non-IT students to understand.


Buy Me a Coffee