After restarting your computer, OneDrive for Business may get stuck in a sync loop when syncing a shared library that contains thousands of files or folders. The sync progress bar cycles through “Processing changes” repeatedly without completing. This loop occurs because the sync engine tries to index and compare all metadata for every item in the library every time the app restarts, and the processing time exceeds the internal timeout threshold. This article explains why large shared libraries trigger this restart loop and provides a set of targeted fixes to break the cycle and restore stable syncing.
Key Takeaways: Breaking the Sync Loop After Restart
- OneDrive Settings > Sync and backup > Advanced settings > Files On-Demand: Disabling Files On-Demand forces full local download, which avoids repeated metadata scans on restart.
- OneDrive Settings > Sync and backup > Manage backup > Stop sync for shared library: Stopping and re-adding the library with selective folder sync reduces the item count that must be indexed on restart.
- Windows Registry > HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts\Business1 > MaxDownloadSizeInMB: Increasing this value allows OneDrive to process larger file batches without timing out during the initial scan after restart.
Why OneDrive Sync Loops After Restart for Large Shared Libraries
When you restart Windows, OneDrive must re-establish sync for every library it manages. For a standard personal or team site library with fewer than 5,000 items, this re-indexing completes within seconds. A shared library with 20,000 or more items, especially one that contains deeply nested folders or many file versions, creates a different situation.
The technical root cause is the way OneDrive handles the “Processing changes” state. After restart, OneDrive performs a full enumeration of the local sync database and compares it with the server-side metadata. For a large library, this enumeration can take several minutes. During this time, OneDrive’s internal health-check timer triggers a restart of the sync engine if the enumeration does not finish within a predefined window. The engine restarts, begins enumeration again, and the cycle repeats indefinitely.
Files On-Demand makes the problem worse. With Files On-Demand enabled, only placeholder files exist locally. After restart, OneDrive must re-download the placeholder metadata for every item before it can compare file states. For a library with 50,000 placeholders, this metadata download plus the comparison process almost always exceeds the timeout threshold, creating the loop.
Shared libraries have an additional complication. The sync engine must verify permissions for each user who has access to the library. A shared library with many members or complex permission inheritance adds extra server round-trips during the enumeration phase, further delaying completion and increasing the chance of a timeout-triggered restart.
Steps to Stop the Sync Loop and Restore Normal Operation
Apply these steps in the order shown. Test sync after each step to see if the loop has stopped before moving to the next step.
- Pause and resume sync
Right-click the OneDrive cloud icon in the notification area. Select Pause syncing > 2 hours. Wait 30 seconds. Right-click the icon again and select Resume syncing. This resets the sync engine without a full restart and sometimes breaks a short loop. - Disable Files On-Demand for the affected library
Open OneDrive settings by right-clicking the cloud icon and selecting Settings. Go to the Sync and backup tab. Click Advanced settings. Under Files On-Demand, turn off the switch. OneDrive will begin downloading all files from the shared library to your local hard drive. This eliminates the placeholder-metadata re-download that triggers the loop after restart. Wait for the download to complete before restarting your computer. - Stop syncing the shared library and re-add it with selective folders
In OneDrive settings > Sync and backup > Manage backup, click Stop sync next to the problematic shared library. Confirm the stop. Open File Explorer and navigate to the local OneDrive folder. Delete the folder for that library. Restart OneDrive by right-clicking the cloud icon and selecting Exit, then launching OneDrive from the Start menu. Click the OneDrive icon in the notification area and select Add account. Sign in if prompted. When the shared library appears, click the gear icon and choose only the subfolders you need. This reduces the item count that OneDrive must index on restart. - Increase the registry value for maximum download size per batch
Press Windows key + R, type regedit, and press Enter. Navigate to HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts\Business1. Right-click in the right pane, select New > DWORD (32-bit) Value. Name it MaxDownloadSizeInMB. Double-click the new value, set Base to Decimal, and enter 2048. Click OK. Close Registry Editor. Restart OneDrive. This setting allows OneDrive to process larger batches of files during the initial scan without timing out. - Reset OneDrive sync completely
Press Windows key + R, type %localappdata%\Microsoft\OneDrive\onedrive.exe /reset, and press Enter. Wait 60 seconds. Launch OneDrive from the Start menu. Sign in again. Re-add the shared library using selective folder sync as described in step 3. A full reset clears the local sync database, which often eliminates corruption that contributes to the loop.
If OneDrive Still Loops After Applying the Main Fixes
OneDrive shows “Processing changes” for more than 10 minutes after every restart
If the loop persists after disabling Files On-Demand and increasing the registry batch size, the shared library itself may have structural issues. Ask the SharePoint site collection administrator to check the library for items that exceed the 250-character file path limit, files with invalid characters, or folders with more than 5,000 items in a single folder. These conditions force OneDrive to perform additional processing on restart. The administrator can use the SharePoint Online Management Shell to run Get-PnPFolder -List
OneDrive stops syncing a shared library and displays error code 0x8007016a
Error 0x8007016a indicates that the local file path for the synced library has exceeded the maximum path length of 260 characters. This error commonly appears in large libraries where deep folder nesting pushes file paths over the limit. To fix this, stop syncing the library, move your OneDrive root folder to a shorter path such as C:\OD, and re-add the library. To change the OneDrive root folder, go to OneDrive settings > Sync and backup > Advanced settings > Manage backup, stop all syncing, then in the same Advanced settings section click Move folder under OneDrive folder location.
OneDrive sync loop occurs only on a specific shared library but not on others
This points to a library-specific configuration. The library may have versioning enabled with a large number of versions per file. OneDrive must enumerate all versions during the restart scan. Ask the site administrator to reduce the version count limit in the library settings to 100 versions per file. Go to the library > gear icon > Library settings > Versioning settings > set Keep the following number of major versions to 100. After the change, stop and re-add the library in OneDrive.
Files On-Demand vs Full Local Sync for Large Shared Libraries
| Item | Files On-Demand Enabled | Full Local Sync (Files On-Demand Disabled) |
|---|---|---|
| Local disk space used | Minimal — only placeholders and cached files | Full library size — all files downloaded |
| Sync restart time after reboot | Long — re-downloads placeholder metadata for every item | Short — local files already exist so metadata comparisons are faster |
| Risk of sync loop after restart | High for libraries with more than 5,000 items | Low — timeout is less likely because no metadata download is needed |
| Offline file availability | Only files marked as Always keep on this device | All files available offline immediately |
| Bandwidth usage on restart | Low — only metadata is downloaded | High — initial full download uses significant bandwidth |
For shared libraries with more than 10,000 files, disabling Files On-Demand is the most reliable way to prevent the restart loop. The trade-off is higher local disk usage and longer initial download time. After the initial download completes, incremental sync uses minimal bandwidth.
You can now stop the OneDrive sync loop after restart by disabling Files On-Demand, re-adding the library with selective folders, or increasing the registry batch size. Next, check the library for oversized folders or excessive version history to prevent the loop from recurring. For ongoing management of large libraries, consider using the OneDrive admin center to set a maximum file count per library or enable sync health reporting to detect loops early.