Backup, Clone, Wipe Drives using Command Prompt

Updated

On Windows 11/10, open Terminal (Admin) and run mdcli.exe. This command will back up drive d1 to a ZIP file:

mdcli backup d1 E:\myfolder\backup.zip

mdcli clone d2 d3 clones drive d2 to d3
mdcli erase d4 wipes drive d4
mdcli restore E:\folder\backup.zip d3 writes a backup image to drive d3.

Every flag is listed on the CLI reference.

Quick way to launch MultiDrive CLI

From the MultiDrive window: open the app, then in the top right choose the menu and Launch CLI.

Run mdcli list to print connected drives. Use the Short ID (d1, d2, d3, d4, etc) or the System ID in backup, clone, erase, and restore tasks.

d1 is the boot drive. MultiDrive will not allow it to use as Target for clone, erase, or restore.

mdcli list output with Short ID and System ID for each connected driveBackup, Clone, Wipe Drives from Command Prompt
CLI installation tips

You can deploy MultiDrive silently across multiple machines using CLI parameters, or install it via Windows Package Manager (winget).
Silent install example:MultiDriveSetup.exe /s /d=c:\MyFolder
Winget install:winget install multidrive

Backup Hard Drive from Command Prompt

Usage:

mdcli.exe backup [source] [target] <OPTIONS>

Example:

mdcli backup d2 E:\myfolder\backup.zst

Benefits:

  • Backup to RAW, ZIP, or ZSTD
  • In a MultiDrive test, a 120 GB RAW backup took 14 minutes to a Toshiba 1 TB USB 3.0 HDD and 5 minutes to a Kingston USB SSD. See the backup speed comparison.
  • On-the-fly compression for ZIP and ZSTD
  • Data integrity checks using various hash algorithms: MD5, SHA1, SHA256, SHA512
  • The option to split the target backup file into segments

Detailed guide:

Clone Hard Drive from Command Prompt

Usage:

mdcli.exe clone [source] [target] <OPTIONS>

Example:

mdcli clone d1 d3

Benefits:

  • Byte-for-byte copy of the source drive onto the target
  • Data integrity checks using various hash algorithms: MD5, SHA1, SHA256, SHA512
  • The option to specify byte offset for both source and target drives
  • Automatically mounts the target drive partitions in Windows after cloning

Detailed guide:

Wipe Hard Drive from Command Prompt

Usage:

mdcli.exe erase [target] <OPTIONS>

Example:

mdcli erase d3

MultiDrive Benefits:

  • Irreversible and secure data erasure
  • Partial erasing is supported
  • Specify the HEX byte pattern to fill the drive with

Detailed guide:

Restore a Drive from Command Prompt

Usage:

mdcli.exe restore [source] [target] <OPTIONS>

Example:

mdcli restore E:\folder\backup.zip d3

Benefits:

  • Restore a RAW, ZIP, or ZST file to a drive or part of a drive
  • Split RAW and ZIP files are found and read automatically
  • On-the-fly decompression for ZIP and ZSTD
  • Data integrity checks using MD5, SHA1, SHA256, or SHA512
  • Automatically mounts the target drive partitions in Windows after restore

Detailed guide:

Download MultiDrive CLIVersion 1.5 · for Windows 11/10

How to Create Backup from Command Prompt in MultiDrive

Here's a step-by-step guide for using the command prompt to backup a drive in MultiDrive.

The 'backup' command

The mdcli.exe backup command backs up a drive or its part to a file in RAW, ZIP, or ZSTD format.

The 'backup' command syntax

mdcli.exe backup [source] [target] <OPTIONS>

Arguments for the 'backup' command

[source] The drive from which bytes are backed up

[target] The target file for storing a backup

For [source] and [target] arguments, use the drive's Short ID or System ID reported by the list command, for example: d1, d2, d3…

Flags for the backup command

Defaults and every flag: backup in the CLI reference.

Examples of command line backup

# Back up Drive #1 to a RAW file
mdcli backup d1 E:\myfolder\backup.raw

# Back up Drive #1 to a ZIP file with compression
mdcli backup d1 E:\myfolder\backup.zip

# Back up a source Drive #2 to a target ZIP file with compression
mdcli backup -s d2 -t E:\folder\backup.zip -z

# Back up a source Drive #1 to the target folder
mdcli backup -s d1 -t E:\folder\

# Back up a source Drive #1 with the offset of 1 million bytes to a zip file, split into segments of 2 GB each:
mdcli backup d1 E:\folder\backup.zip -b 1M -c 10G --zip --split 2G

# Back up a source Drive #2 to a network share folder with ZSTD compression and network share authentication specified
mdcli backup -s d2 -t "\\nas\my dir\backup.zst" --share-user corp\operator --share-pass P@ssw0rd!

How to Clone Disk from cmd

Here's how to clone a hard drive using the command prompt with the MultiDrive command line interface.

The 'clone' command

The mdcli.exe clone command clones one drive to another, creating an exact bit-by-bit replica of the source drive on the target one.

The 'clone' command syntax

mdcli.exe clone [source] [target] <OPTIONS>

Arguments for the 'clone' command

[source] Drive from which bytes are cloned

[target] Drive to which bytes are cloned

For [source] and [target] arguments, use the drive's Short ID or System ID reported by the list command, for example: d1, d2, d3…

Flags for the clone command

Defaults and every flag: clone in the CLI reference.

Examples of using the 'clone' command

# Clone Drive #1 to Drive #3
mdcli clone d1 d3

# Clone a source Drive #1 to a target Drive #3
mdcli clone -s d1 -t d3

# Clone 1 TB from Drive #3 with the offset of 500 MB to a target Drive #4, mount Drive #4 to Windows after cloning is complete
mdcli clone d3 d4 -b 500M -c 1T -m

# Clone 1 TB from a source Drive #3 with the offset of 500 MB to a target Drive #4, calculate SHA1 hash to verify data integrity
mdcli clone -s d3 -t d4 -b 500M -c 1T -q SHA1

How to Wipe Hard Drive from Command Prompt

MultiDrive offers a secure erase CLI command to completely wipe hard drives, SSDs, USB flash drives or SD cards.

The 'erase' command

The mdcli.exe erase command erases a drive by overwriting it with zeros or a specified HEX pattern. Partial erasing is supported.

The 'erase' command syntax

mdcli.exe erase [target] <OPTIONS>

Arguments for the 'erase' command

[target] Target drive to erase

For the [target] argument, use the drive's Short ID or System ID reported by the list command, for example: d1, d2, d3…

Flags for the erase command

Defaults and every flag: erase in the CLI reference.

Examples of using the 'erase' command

# Erase Drive #3 by filling it with the 'FF' byte pattern
mdcli erase -t d3 --pattern FF

# Erase 1 gigabyte from Drive #3 by filling it with the '9A7B' byte pattern
mdcli erase d3 -p 9A7B -b 1G -c 30G

How to Restore a Drive from Command Prompt in MultiDrive

Here is how to write a backup file back to a drive with the MultiDrive command line interface.

The 'restore' command

The mdcli.exe restore command restores a RAW, ZIP, or ZST file to a drive or part of a drive. It automatically finds and reads split RAW and ZIP files with these extensions:

  • zip.001, zip.002 … zip.999, zip.1000, zip.1001…
  • zip, z01, z02 … z99, z100, z101…
  • raw.001, raw.002 … raw.999, raw.1000, raw.1001…

The 'restore' command syntax

mdcli.exe restore [source] [target] <OPTIONS>

Arguments for the 'restore' command

[source] Backup file to restore

[target] Drive to which bytes from the source file are written

For the [target] argument, use the drive's Short ID or System ID reported by the list command, for example: d1, d2, d3…

Flags for the restore command

Defaults and every flag: restore in the CLI reference.

Examples of using the 'restore' command

# Restore a RAW backup to Drive #3
mdcli restore E:\folder\backup.raw d3

# Restore a ZIP backup to Drive #3, starting at offset 1 GB
mdcli restore E:\folder\backup.zip d3 -b 1G

# Restore a ZST backup to Drive #3
mdcli restore E:\folder\backup.zst d3

# Restore 1 TB of a ZIP backup to Drive #3 from offset 1 GB, and calculate SHA512
mdcli restore -s E:\folder\backup.zip -t d3 -b 1G -c 1T -q sha512

# Restore a RAW backup to Drive #3 and mount it when finished
mdcli restore -s E:\folder\backup.raw -t d3 --mount

# Restore a ZIP backup from a network share
mdcli restore "\10.0.0.3\my dir\backup.zip" d3 --share-user corp\operator --share-pass P@ssw0rd!

Author

Vitaliy Mokosiy, CTO at Atola Technology

Vitaliy Mokosiy

CTO at Atola Technology

18 years of building software and hardware systems for HDDs/SSDs and file systems. Expert in data recovery and digital forensics.
Leads engineering at Atola Technology, whose forensic imagers are used by DFIR labs across the globe.

Get Free CLI Disk ToolVersion 1.5 · for Windows 11/10