Mirroring harddisk with compressed files with Robocopy

compressionmirroringntfsrobocopy

I tried to mirroring an existing disks on a new disks with less space. It is very important that the file structure, attributes and ACL's are exact as on the source disk.

For this I tried robocopy.exe:

robocopy $sourceDisk $destinationDisk /mir /XD "System Volume Information" "`$RECYCLE.BIN" /copyall /r:1 /NP /NFL

That command copies all folders and files with attributes, ACL's, etc. over to the destination disk, except for the compress-attribute, i.e. files or folders which are compressed on the source disk are on the destination disk not longer compressed. This attribute is missing.

Is there an option for robocopy to do this (I didn't find it). Or are there existing other approaches to make an exact copy of an disk or file structure to another disk?

Best Answer

I was able to manage this problem with the commandline tool strarc.exe from LTR-Data.

This tool copies the files, as far as I understand, on a lower layer than robocopy. All attributes, ACL's are exact on the destination like the source - even the timestamps. The junctions where also correct copied.

The command is

$srcDisk = "Y:"
$dstDisk = "Z:"
cmd /c "C:\temp\strarc.exe -cjd:$srcDisk | C:\temp\strarc -s:8 -xd:$dstDisk"

It makes a copy of the $srcDisk, i.e. Y: to $dstDisk, i.e. Z: including junctions and ignoring messages about 8.3 compability (-s:8).

I recommend this tool for exact backups via commandline.