Robocopy to NetApp target slow due to all files modified

Problem

When running Robocopy to sync data from an existing NAS to a NetApp, you may see in the logs that every file is modified when doing subsequent runs. By default, ONTAP does not permit the ctime to be set to an earlier time to maintain compatibility with NFS and UNIX backup utilities. When Robocopy tries to update the ctime for a file or directory, ONTAP silently ignores this, and it results in the source and destination ctimes not matching. When Robocopy runs again it sees the source and destination do not match and tries to update the files again.

This presents two problems:

  • The files/directories are inconsistent between the source and target.
  • Subsequent Robocopy runs are much longer than they should be.

Workaround

If you have active support you should probably open a case first to confirm you're not going to break anything (especially if you are using SnapDiff, NDMP, etc). Proceed at your own risk.

  1. Enable CLI diagnostic mode.
1cluster::> set diag
2Warning: These diagnostic commands are for use by NetApp personnel only.
3Do you want to continue? {y|n}: y
  1. Set bootarg option to allow CIFS users to change ctime backwards:
1cluster::*> run * bootargs set bootarg.wafl.allow_ctime_backward true -persist true
22 entries were acted on.
3Node: cluster-node1
4bootarg.wafl.allow_ctime_backward =true
5Node: cluster-node2
6bootarg.wafl.allow_ctime_backward =true
  1. Perform a giveback/takeback to reboot each node.
    https://kb.netapp.com/on-prem/ontap/Ontap_OS/OS-KBs/How_to_perform_Takeover_Giveback

  2. Run Robocopy again. This time will take the same amount of time as before, but when you run it again after this one completes, it will complete much faster due to not having to update every file on the target.

References

https://kb.netapp.com/on-prem/ontap/da/NAS/NAS-KBs/Why_is_Ctime_not_updated_when_copying_a_file_from_a_Windows_client_to_a_CIFS_share
https://kb.netapp.com/on-prem/ontap/da/NAS/NAS-Issues/CONTAP-30616