Rsync Always Copy from Scratch with Mounted NAS: Fixing the Issue

Abstract: Fix rsync always copying from scratch on mounted NAS by correcting CIFS mount options and timestamp synchronization.

Created: 2026-09-07 by

Rsync copies from scratch on mounted NAS drives because the filesystem lacks reliable timestamp or inode metadata, forcing rsync to compare file sizes and modification times which may appear mismatched. This typically occurs with CIFS/SMB mounts where attribute support is limited or misconfigured. The fix involves verifying mount options, ensuring consistent client-server time synchronization, and using the --size-only flag as a diagnostic step to isolate timestamp issues.

Understanding Why Rsync Skips Incremental Updates

Rsync relies on two primary pieces of metadata to determine if a file has changed: the modification time (mtime) and the file size. When you run rsync against a local directory, it can quickly check these attributes. However, when dealing with network-mounted storage like a Network Attached Storage (NAS) device, the underlying protocol often fails to provide accurate or consistent metadata. The most common culprit is the Common Internet File System (CIFS), also known as SMB. By default, many Linux distributions mount CIFS shares with options that do not preserve Unix-style timestamps accurately. If the server reports a timestamp in seconds but the client expects nanoseconds, or if the timezone settings differ between the client machine and the NAS, rsync sees every file as "new" or "modified." Additionally, some NAS implementations do not support the full set of POSIX file attributes required for efficient incremental transfers. This leads to the frustrating behavior where rsync appears to ignore existing files and re-transfers everything from scratch, consuming bandwidth and time unnecessarily. Another factor is the difference between NFSv3 and NFSv4. While NFS generally handles metadata better than CIFS, version differences can still cause inconsistencies. If your NAS exports an older NFS version, timestamp resolution might be lower, leading to false positives in change detection. It is crucial to understand that this is rarely a bug in rsync itself, but rather a limitation in how the remote filesystem exposes data to the local system.

Verifying Timestamp Accuracy

Before changing rsync commands, you must confirm that the timestamps on the mounted drive are actually incorrect. You can do this by creating a test file locally and copying it to the mount point, then checking its properties. Use the stat command on both the source and destination files. Look specifically at the Modify field. If the times differ by more than one second, or if the timezone offset is wrong, rsync will always see a discrepancy. You can also use the ls -l command to view the modification times. Compare the output before and after a copy operation. If the time updates correctly upon write, the issue lies in how rsync reads them during comparison. If the time does not update or shows garbage values, the mount configuration needs adjustment. This diagnostic step helps distinguish between a rsync configuration error and a fundamental filesystem metadata failure.

Configuring Mount Options for Metadata Support

The first line of defense is to ensure your mount options allow for proper timestamp handling. For CIFS mounts, the vers=2.1 or vers=3.0 parameter is critical. Older versions like vers=1.0 have poor support for modern timestamp features. Furthermore, adding nobrl can sometimes improve performance, but it does not directly fix timestamp issues. Instead, focus on dir_mode and file_mode to ensure permissions are handled consistently, though this is secondary to time sync. For NFS mounts, ensure you are using NFSv4 if supported by your NAS. NFSv4 provides better atomicity and timestamp consistency compared to NFSv3. Check your /etc/fstab or mount command. If you are using automounts, verify that the daemon is passing the correct version flags. Incorrect version negotiation is a frequent source of silent failures where rsync falls back to less efficient protocols. If you cannot change the NAS export settings, you might try adding actimeo=0 to your CIFS mount options. This forces the kernel to fetch fresh attributes from the server for every access, which can help if stale cache data is causing mismatches. However, this comes with a performance penalty. It is a trade-off between speed and accuracy. In many cases, simply upgrading the CIFS version resolves the core timestamp drift without needing aggressive caching policies.

Adjusting Rsync Commands for Network Instability

If mount options alone do not solve the problem, you can adjust the rsync command to bypass strict timestamp checking. The --size-only flag tells rsync to only compare file sizes, ignoring modification times entirely. This is useful if you trust that any size change indicates a real update. However, be cautious: if you edit a file without changing its size (rare but possible with some editors), rsync will skip it. Use this only for diagnostic purposes or if you know your workflow changes file sizes reliably. A more robust approach is to use the --checksum option (-c). This forces rsync to calculate a hash of the entire file content rather than relying on metadata. While this guarantees correctness, it is significantly slower because it requires reading the entire file. For large datasets, this can negate the benefits of incremental backups. Use -c only for small files or critical data where integrity is paramount over speed. Another powerful tool is the --ignore-times flag, though it is rarely used in production. It effectively disables all timestamp checks, treating every file as new unless combined with other filters. A better alternative is to use --modify-window. By default, rsync considers two files identical if their timestamps are within one second of each other. On slow networks or with imprecise clocks, increasing this window to 5 or 10 seconds can prevent unnecessary transfers. For example, --modify-window=10 allows for minor clock drift.

Synchronizing System Clocks

Regardless of the flags you use, clock synchronization is non-negotiable for reliable rsync operations. Ensure that both your client machine and the NAS device are synchronized to the same NTP server. Even a few minutes of drift can cause massive false-positive detections. Use chronyd or systemd-timesyncd on your Linux client to maintain accurate time. Check the NAS documentation for its own time synchronization settings. Many enterprise NAS devices allow you to configure an NTP server directly in the admin panel. Aligning these clocks eliminates the most common cause of "copy from scratch" behavior.

Troubleshooting Specific Scenarios

Sometimes the issue is not timestamps but inode numbers. Some older or poorly implemented filesystems do not support stable inodes across reboots or remounts. If rsync is configured to use inodes (which it does by default for hard links), this can cause confusion. While rsync primarily uses mtime/size, certain link-related options can trigger inode checks. Disabling hard link creation with --no-links can help isolate this issue. If you are moving data between different operating systems, such as Windows to Linux, be aware that Windows uses a different timestamp resolution (100-nanosecond intervals) compared to Linux (seconds or nanoseconds). This mismatch can lead to rounding errors. Using the --modify-window flag becomes even more important in cross-platform scenarios. Always test with a small subset of files first to validate your configuration before running full backups. For those experiencing hangs or extreme slowness alongside the copy-from-scratch issue, refer to our guide on fixing FFmpeg transcode issues on CIFS mounts, as similar network stack problems can affect various tools. Additionally, if you are dealing with sparse files that grow unexpectedly after transfer, check out our article on shrinking sparse files in Linux to manage disk space efficiently.

Frequently Asked Questions

Why does rsync copy files even if they haven't changed?

This usually happens because the modification times reported by the network share do not match the local cache or the source exactly. Network protocols like CIFS often have lower precision or different timezone interpretations than local ext4 or xfs filesystems. Verifying the timestamps with stat confirms if this is the root cause.

Is the --size-only flag safe to use for backups?

--size-only is safe only if you are confident that no files are modified without changing their size. It ignores timestamps completely, so if you overwrite a file with identical content and size, rsync will skip it. It is best used for diagnostics to isolate timestamp issues rather than as a permanent backup strategy.

How do I fix timestamp drift on a CIFS mount?

You can mitigate drift by ensuring both client and server use NTP synchronization. Additionally, adding actimeo=0 to your mount options forces fresh attribute retrieval, reducing stale cache effects. Upgrading the CIFS version to 2.1 or higher in your mount command also improves timestamp handling capabilities.

What is the difference between rsync on NFS vs CIFS?

NFS generally offers better metadata consistency and faster attribute checks than CIFS, especially with NFSv4. CIFS can suffer from latency in attribute retrieval and stricter permission mappings that interfere with rsync's delta algorithm. If possible, prefer NFS for rsync targets to minimize overhead and metadata discrepancies.

Can I force rsync to use checksums instead of timestamps?

Yes, using the --checksum or -c flag forces rsync to compute a hash of the file contents. This ensures accuracy regardless of metadata errors but is much slower as it requires reading the entire file. Use this sparingly for critical data or small files where speed is less important than absolute integrity.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More