Skip to content

Commit b0b4781

Browse files
authored
Merge pull request #210863 from fauhse/lfsm
Adding WS 2022 RoboCopy bug and mitigation for reference in a video
2 parents 6d6c0b7 + ba47d6c commit b0b4781

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

includes/storage-files-migration-robocopy-optimize.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ More threads will copy our 1-TiB example of small files considerably faster than
5151
During a first RoboCopy into an empty target or a differential run with lots of changed files, you are likely constrained by your network throughput. Start with a high thread count for an initial run. A high thread count, even beyond your currently available threads on the machine, helps saturate the available network bandwidth. Subsequent /MIR runs are progressively impacted by processing items. Fewer changes in a differential run mean less transport of data over the network. Your speed is now more dependent on your ability to process namespace items than to move them over the network link. For subsequent runs, match your thread count value to your processor core count and thread count per core. Consider if cores need to be reserved for other tasks a production server may have.
5252

5353
> [!TIP]
54-
> Rule of thumb: The first RoboCopy run, that will move a lot of data of a higher-latency network, benefits from over-provisioning the thread count (`/MT:n`). Subsequent runs will copy fewer differences and you are more likely to shift from network throughput constrained to compute constrained. Under these circumstances, it is often better to match the robocopy thread count to the actually available threads on the machine. Over-provisioning in that scenario can lead to more context shifts in the processor, possibly slowing down your copy.
54+
> Rule of thumb: The first RoboCopy run, that will move a lot of data of a higher-latency network, benefits from over-provisioning the thread count (`/MT:n`). Subsequent runs will copy fewer differences and you are more likely to shift from network throughput constrained to compute constrained. Under these circumstances, it is often better to match the RoboCopy thread count to the actually available threads on the machine. Over-provisioning in that scenario can lead to more context shifts in the processor, possibly slowing down your copy.
5555
5656
### Avoid unnecessary work
5757

@@ -68,3 +68,25 @@ You should be prepared to run multiple rounds of RoboCopy against a given namesp
6868
* `/W:n` n = how many seconds to wait between retries
6969

7070
`/R:5 /W:5` is a reasonable setting that you can adjust to your liking. In this example, a failed file will be retried five times, with five-second wait time between retries. If the file still fails to copy, the next RoboCopy job will try again. Often files that failed because they are in use or because of timeout issues might eventually be copied successfully this way.
71+
72+
### Windows Server 2022 and RoboCopy LFSM
73+
74+
The RoboCopy switch `/LFSM` can be used to avoid a RoboCopy job failing with a *volume full* error. RoboCopy will pause whenever a file copy would cause the destination volume's free space to go below a "floor" value.
75+
76+
Use RoboCopy with Windows Server 2022. Only this version of RoboCopy contains important bug fixes and features that make the switch compatible with additional flags needed in most migrations. For example, compatibility with the `/B` flag.
77+
78+
`/B` runs RoboCopy in the same mode that a backup application would use. This switch allows RoboCopy to move files that the current user doesn't have permissions for.
79+
80+
Normally, RoboCopy can be run on the Source, Destination or a third machine.
81+
82+
> [!IMPORTANT]
83+
> If you intend to use `/LFSM`, RoboCopy must be run on the Windows Server 2022 target Azure File Sync server.
84+
85+
Note also that with `/LFSM` you must also use a local path for the destination, not a UNC path. For example as a destination path you should use *E:\Foldername* rather than a UNC path like *\\\\ServerName\FolderName*.
86+
87+
> [!CAUTION]
88+
> The currently available version of RoboCopy on Windows Server 2022 has a bug that causes the pauses to count against the per file error count. Apply the following workaround.
89+
90+
The recommended `/R:2 /W:1` flags increase the probability that a file is failed due to an `/LFSM` induced pause. In this example, a file that wasn't copied after 3 pauses because `/LFSM` caused the pause, will incorrectly make RoboCopy fail the file. The workaround for this is to use higher values for `/R:n` and `/W:n`. A good example is `/R:10 /W:1800` (10 retries of 30 minutes each). This should give the Azure File Sync tiering algorithm time to create space on the destination volume.
91+
92+
This bug has been fixed but the fix is not yet publicly available. Check this paragraph for updates on the availability of the fix and how to deploy it.

includes/storage-files-migration-robocopy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: storage
55
author: khdownie
66
ms.service: storage
77
ms.topic: include
8-
ms.date: 4/05/2021
8+
ms.date: 9/12/2021
99
ms.author: kendownie
1010
ms.custom: include file
1111
---
@@ -30,7 +30,7 @@ robocopy <SourcePath> <Dest.Path> /MT:20 /R:2 /W:1 /B /MIR /IT /COPY:DATSO /DCOP
3030
| `/XD` | Specifies directories to be excluded. When running Robocopy on the root of a volume, consider excluding the hidden `System Volume Information` folder. If used as designed, all information in there is specific to the exact volume on this exact system and can be rebuilt on-demand. Copying this information won't be helpful in the cloud or when the data is ever copied back to another Windows volume. Leaving this content behind should not be considered data loss. |
3131
| `/UNILOG:<file name>` | Writes status to the log file as Unicode. (Overwrites the existing log.) |
3232
| `/L` | **Only for a test run** </br> Files are to be listed only. They won't be copied, not deleted, and not time stamped. Often used with `/TEE` for console output. Flags from the sample script, like `/NP`, `/NFL`, and `/NDL`, might need to be removed to achieve you properly documented test results. |
33-
| `/LFSM` | **Only for targets with tiered storage. Not supported when the destination is a remote SMB share.** </br>Specifies that Robocopy operates in "low free space mode." This switch is useful only for targets with tiered storage that might run out of local capacity before Robocopy finishes. It was added specifically for use with a target enabled for Azure File Sync cloud tiering. It can be used independently of Azure File Sync. In this mode, Robocopy will pause whenever a file copy would cause the destination volume's free space to go below a "floor" value. This value can be specified by the `/LFSM:n` form of the flag. The parameter `n` is specified in base 2: `nKB`, `nMB`, or `nGB`. If `/LFSM` is specified with no explicit floor value, the floor is set to 10 percent of the destination volume's size. Low free space mode isn't compatible with `/MT`, `/EFSRAW`, or `/ZB`. Support for `/B` was added in Windows Server 2022. |
33+
| `/LFSM` | **Only for targets with tiered storage. Not supported when the destination is a remote SMB share.** </br>Specifies that Robocopy operates in "low free space mode." This switch is useful only for targets with tiered storage that might run out of local capacity before Robocopy finishes. It was added specifically for use with a target enabled for Azure File Sync cloud tiering. It can be used independently of Azure File Sync. In this mode, Robocopy will pause whenever a file copy would cause the destination volume's free space to go below a "floor" value. This value can be specified by the `/LFSM:n` form of the flag. The parameter `n` is specified in base 2: `nKB`, `nMB`, or `nGB`. If `/LFSM` is specified with no explicit floor value, the floor is set to 10 percent of the destination volume's size. Low free space mode isn't compatible with `/MT`, `/EFSRAW`, or `/ZB`. Support for `/B` was added in Windows Server 2022. Please see section Windows Server 2022 and RoboCopy LFSM below for more information including detail about a related bug and workaround. |
3434
| `/Z` | **Use cautiously** </br>Copies files in restart mode. This switch is recommended only in an unstable network environment. It significantly reduces copy performance because of extra logging. |
3535
| `/ZB` | **Use cautiously** </br>Uses restart mode. If access is denied, this option uses backup mode. This option significantly reduces copy performance because of checkpointing. |
3636

0 commit comments

Comments
 (0)