keepcalculator

06 Numbers and Powers

Robocopy Clone Disk: Full Drive Copy Guide

Card No. 06·66077 · Updated · Standard formula, shown below

Robocopy can clone a disk by copying all files and folders from one drive to another, but it does not copy the boot sector, partition table, or system reserved partitions, so the destination drive will not be bootable on its own. To get a true bootable clone, you must also copy the system partitions and set the destination partition active, or use a dedicated imaging tool. This guide explains exactly what Robocopy can and cannot do, how to run it correctly, and when you should use a different method.

What Robocopy Actually Does

Robocopy (Robust File Copy) is a command-line tool built into Windows that copies files and directories with high reliability. It can mirror a source folder to a destination folder, preserving attributes, timestamps, and security settings. When you point it at the root of a drive (e.g., C:\ to D:\), it copies all user data, installed programs, and Windows system files that are not locked.

However, a disk is more than just files. A bootable Windows drive contains:

  • Partition table – defines the layout of partitions on the disk.
  • System Reserved partition (or EFI partition) – holds boot configuration files.
  • Boot sector – the first sector that starts the OS loader.

Robocopy copies the contents of partitions, not the partition structure itself. So after a Robocopy clone, the destination drive has all your files but lacks the boot loader, and Windows will not start from it.

How to Run a Robocopy Clone

If you only need to transfer data (not create a bootable OS drive), Robocopy is excellent. Here is the standard command that mirrors all files and subfolders, including empty directories and hidden/system files:

robocopy C:\ D:\ /E /COPY:DAT /DCOPY:DAT /R:1 /W:1 /NFL /NDL /NP
  • /E – copies subdirectories, including empty ones.
  • /COPY:DAT – copies Data, Attributes, and Timestamps.
  • /DCOPY:DAT – copies directory info.
  • /R:1 /W:1 – retry once, wait 1 second (speeds up on locked files).
  • /NFL /NDL – suppress file/directory names for a cleaner log.
  • /NP – no progress percentage, useful for logging.

To make the destination bootable, you must also copy the System Reserved partition (usually a small 100–500 MB partition) and then mark the destination partition as active. The exact steps depend on your Windows version and whether the disk is MBR or GPT. A safer route is to use a tool like diskpart to set the active flag, but this is error-prone; most users should use a disk imaging tool instead.

When Robocopy Is the Right Choice

Robocopy is ideal when you want to:

  • Back up files to an external drive.
  • Migrate data to a new drive without cloning the OS.
  • Sync two folders (e.g., a project directory).
  • Copy a large dataset with error recovery.

It is not suitable for creating a bootable backup of your entire Windows installation, because the boot files are not copied. If you need a full system backup that you can restore to the same or different hardware, use a disk imaging tool like Windows Backup, Macrium Reflect, or Clonezilla. These tools copy the entire disk structure, including boot sectors and partitions.

Common Problems and Mistakes

Users often run Robocopy and then wonder why the new drive won’t boot. The number one mistake is expecting a bootable clone without copying the boot partition. Another common issue is not excluding certain folders (like Windows\System32\config or Users\*\AppData) that may be locked or cause errors. Robocopy will skip locked files, which can corrupt the copy if you are trying to clone a running system.

Other pitfalls:

  • Wrong destination drive – double-check the drive letters; copying to the wrong drive can delete data.
  • Not using /MIR correctly – /MIR mirrors by deleting extra files on the destination; if you point it at the wrong folder, it can wipe data.
  • Running without admin rights – some system files require elevation.
  • Ignoring the exit code – Robocopy returns a code; 0 means success, 1 means files copied, 2 means extra files, etc. Check it after the run.

Robocopy vs. Disk Imaging Tools

Robocopy is a file-level copy; imaging tools are sector-level. Here’s a quick comparison:

  • Robocopy – copies files, preserves permissions, works on any filesystem, fast for large data, but doesn’t copy boot sectors or partition layout.
  • Disk imaging (e.g., Clonezilla, Macrium Reflect) – creates a snapshot of the entire disk, including boot files, and can restore to a new drive. Takes more space and time, but produces a bootable clone.

For a data backup, Robocopy is often sufficient. For a disaster recovery clone, imaging is the way to go. Some users combine both: use Robocopy for daily file syncing and a monthly imaging backup.

How to Make a Bootable Clone with Robocopy (Advanced)

If you insist on using Robocopy to create a bootable drive, you can, but it requires extra steps. First, prepare the destination disk with the same partition layout (using Disk Management or diskpart). Then copy the System Reserved partition (if MBR) or EFI partition (if GPT) using Robocopy as well. Finally, set the destination partition active and rebuild the boot configuration with bootrec or bcdboot.

Here’s a high-level outline:

  1. Create partitions on the destination disk (e.g., System Reserved 100 MB, then C: partition).
  2. Format them with the same filesystems (NTFS for C:, FAT32 for System Reserved).
  3. Use Robocopy to copy the system partition content to the new C: partition.
  4. Use Robocopy to copy the System Reserved files to the new system partition.
  5. Boot from Windows installation media, open Command Prompt, and run bootrec /rebuildbcd.

This is complex and easy to get wrong. For most users, a dedicated imaging tool is far simpler and more reliable.

Frequently Asked Questions

Can Robocopy clone a hard drive to SSD?

Yes, Robocopy can copy all files to an SSD, but the SSD will not be bootable unless you also copy the boot partitions. If you just want to move data, it works fine. For a bootable OS migration, use a disk imaging tool or the manufacturer’s migration software.

Does Robocopy copy hidden and system files?

Yes, by default Robocopy copies all files, including hidden and system files, as long as you use the /E flag. Without /E, it skips empty directories but still copies hidden files.

Why does my cloned drive not boot?

Because Robocopy doesn’t copy the boot sector or partition table. The destination drive lacks the necessary boot files. You need to copy the System Reserved/EFI partition and set the partition active, or use an imaging tool.

What is the difference between /MIR and /E?

/E copies all subdirectories, including empty ones. /MIR mirrors the source to the destination, which means it also deletes files on the destination that don’t exist on the source. Use /MIR only when you want an exact replica.

Can I clone a disk while Windows is running?

Robocopy can run while Windows is running, but some files (like the registry hives) are locked and will be skipped. This can lead to an incomplete clone. For a reliable clone, boot from a rescue environment or use a tool that handles locked files (like Volume Shadow Copy).

Does Robocopy preserve file permissions?

Yes, if you use /COPY:DAT or /COPYALL, it copies security attributes (ACLs) and ownership. This is important when moving files between servers or user profiles.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →