I'm using Robocopy within a PowerShell script to backup my main SSD to another SSD, but I'm having problems with the file transfer speed.
While in Windows Explorer I have writing speeds of 300~400 MB/s, in Robocopy the average is 80 MB/s.
My command line is this:
robocopy "$($source = $drv;$source)" "$($destination = "$dst";$destination)" /e /MT:4 /NJH /NDL /NC /BYTES /copyall /A-:SH /xd $IgnorarPastas /xf $IgnorarArquivos /log:"$dst\_Backup Logs\$filedate-robocopylog.txt" /tee | Get-RobocopyProgress -ErrorAction 0
The reason I'm using Robocopy within PowerShell is because I created a script to detect the backup and destination drives automatically, this makes the process simpler and more visual.
Another point is that I use a function to have copy progress with PowerShell.
What I've already tried.
I have already tried to change the number of cores by changing the
/MT
parameterI've already tried disabling the progress function to see if it was interfering. I got the same speeds.
I've already tried disabling the log, same speeds.
Considerations:
- Both SSDs are Corsair MP600 Core.
- The SSDs are external and are connected by Orico enclosures, one has a 40Gbps Thunderbolt interface and the other has a 20Gbps USB 3.2 Gen 2 interface.
- One of the SSDs uses my notebook's Thunderbolt 4 interface, the other is connected to USB 3.2 Gen 1. I've already tried reversing their connection.
Comments
Analyzing the behavior of the SSD in the task manager, I see that the SSD that is receiving the backup has 100% usage and a high average response time, around 2000ms.
Any ideas on how I can resolve this?
Edit - Additional Information
Initially I thought it was something related to Robocopy because I don't usually copy large folders directly in Windows Explorer, so I wasn't seeing this oscillation since the copy speed remains high for about 10 seconds, which is often enough to accomplish copying the files.
Now I did in-depth tests, copying large folders to be able to analyze the Explorer copy process for longer, and the result is this in the photo:
In the graph it is possible to observe the speed oscillation, it remains for a while at around 400MB/s, oscillates, and then remains stable at around 80MB/s.