logo elektroda
logo elektroda
X
logo elektroda

Windows 10 and rsync, the efficient and fast way to back up our data

p.kaczmarek2  11 7539 Cool? (+7)
📢 Listen (AI):

TL;DR

  • Uses WSL to run Linux rsync on Windows 10/11 for automated backups to a NAS or external drive.
  • Maps the NAS as a Windows network drive, mounts it in WSL with drvfs, then syncs files with rsync instead of blind copying.
  • Requires Windows 10 version 2004 or higher (Build 19041 or higher), or Windows 11, and the example command is rsync -av --delete --dry-run /mnt/w /mnt/x/b/w.
  • Rsync transfers only changed files, can be paused and resumed, and the dry-run mode shows deletions before any real synchronization.
Generated by the language model.
Screenshot showing Ubuntu installation via WSL in the Windows PowerShell window. .
I will show here how to easily set up Linux rsync on Windows via WSL and then use it to make a copy of our files to a local NAS server via SMB, although analogously copies can also be made to a regular external hard drive. In a way, this method will automate what we often do quite unnecessarily manually, so it will ultimately save us time in keeping our files safe. In addition, the whole thing will work more efficiently, thanks to the fact that rsync only sends changed files and does not blindly copy everything.

Today's electronics are inextricably linked to IT. It's really hard to imagine sifting through tonnes of catalogue notes in the form of physical binders taking up half our cupboard, and even harder to imagine designing a circuit fully on paper - from schematic to PCB design, which is also increasingly at least two layers. For this reason, I thought it worthwhile here to present a method for automatically creating copies via the tool rsync . Rsync is a console tool, normally available on Linux systems, but with a little effort it can be run on Windows too. I'll outline the whole process here step by step and perhaps save someone from losing files.

Step 1 - Install WSL <span>
These Windows steps are skipped if we are on Linux! .
For some time now, Microsoft has offered us the possibility to install WSL, the so-called Windows Subsystem for Linux. WSL allows us to install a Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc.) on Windows without having to resort to less efficient and inconvenient solutions such as dual boot or there virtual machine. This allows us to run Linux programs from within our ten (or eleven...).
Before installation, we need to check that we meet the requirements.
You need Windows 10 version2004 or higher (Build 19041 or higher) or Windows 11. If we don't meet this, we do an upgrade.
Then we open PowerShell - as administrator:
PowerShell context menu with Run as Administrator option highlighted in Windows. .
We type wsl --install :
PowerShell window running as administrator with the command wsl --install typed. .
The laborious installation process will then begin:
Windows PowerShell window with the WSL installation command active and a message about installing Virtual Machine Platform. .
Waiting:
Screenshot of Windows PowerShell window running wsl --install command, installation progress at 74.1%. .
In my case it continued to install Ubuntu by default, but the installation was stuck at 0.6%:
Screenshot of WSL and Ubuntu installation in a Windows PowerShell window. .
I aborted the process and performed the necessary reboot of the machine. Reboot can be done with the command wsl --install -d Ubuntu :
Windows PowerShell window running the command to install Ubuntu via WSL, showing download progress at 16.8%..
After a while, our Linux system will install and our Ubuntu prompt will start.

Step 2 - we are finalizing Ubuntu on Windows .
It's time to configure our Windows Ubuntu. We provide a username and password:
Computer screen with PowerShell running Ubuntu installation via WSL and Ubuntu window asking to create a UNIX user. .
Ubuntu is picky, I had to enter the name in lower case:
PowerShell window installing WSL and Ubuntu, with Ubuntu terminal prompting for a UNIX username during initial setup. .
We also set a password, I myself chose a fairly short four-letter one:
Ubuntu installation screen in PowerShell on Windows with user setup in WSL. .


Step 3 - getting familiar with Ubuntu .
From now on, we can type "WSL" on the Windows bar and run the Linux command line this way:
Screenshot of the Windows search showing the WSL app with a penguin icon in the results. .
In my case it looks like this:
Ubuntu 20.04 terminal launched in WSL showing the welcome message and system summary. .
The obvious implication of this is that you need to know the Linux commands. That is, we operate via cd (change folder), mkdir (create), chmod (set permissions), etc, etc. Our disks can be found in the mnt folder:
Screenshot of Ubuntu terminal running in WSL on Windows, showing filesystem navigation commands and directory listing. .
For example, below I have looked at my W drive - lower case there. All files are visible:
WSL terminal window on Windows displaying directory structure and filenames on mounted W drive with visible commands and text files. .

Step 4 - plug the backup media into the WSL .
Now we still need to access our media from the backup in WSL. Initially I wanted to use the normal Linux way of SMB, i.e. mapping the Samba resource to mnt via mount, but that didn't want to work here.
Eventually I decided that I would map my server on Windows as a network drive .
This is performed in This Computer, here:
A screenshot from Windows Explorer highlighting the Map network drive option in the top toolbar. .
We click through the wizard:
Network location wizard window in Windows, with Next and Cancel buttons visible. .
We enter the address of the share in the format <span>share:
Network drive mapping window in Windows with options for selecting drive letter and network folder. .
Below you have an example of what this looked like for me:
Windows network drive mapping window with selected drive letter and network folder address. .
It's worth ticking the box from automatically connecting after a reboot.
Then in my case the disk did not appear at first, but after the reboot everything was ok:
Windows “This PC” window with a mapped network drive “Backup (\NAS19)” as drive X: highlighted. .
If you want to copy to a regular drive connected via USB it is even simpler - you don't need to map the network drive.

Step 5 - rsync command .
The name rsync comes from Remote Sync - meaning remote synchronisation. It is not a simple command cp , but much more. Rsync offers a lot of switches and possibilities, which you can read about in the documentation:
https://linux.die.net/man/1/rsync
Rsync is a much more efficient solution than blindly copying data. Rsync analyses the files and only transfers what has changed. Rsync can be easily resumed and paused. Rsync also compresses data on transfer.
I didn't even have to install rsync itself. I only had to mount the newly added network share to WSL by first creating a folder for it in mnt (as root) with the mkdir command:
WSL terminal window showing permission denied error for mkdir, then successful directory creation with sudo. .
And then by executing mount:

sudo mount -t drvfs X: /mnt/x
.
WSL terminal window showing the command to mount drive X: to /mnt/x using sudo mount -t drvfs. .
As a result, WSL also started to see files from my mapped network drive.
Then all I had to do was use the rsync command.
I recommend this for a trial:

rsync -av --delete --dry-run /mnt/w /mnt/x/b/w
.
The basic syntax is:

rsync [przełączniki] [źródło] [cel]
.
This will make a copy of the files from the source on the specified target.
Let's decipher the arguments one by one:
- a is the archive mode (recursive synchronisation with the option to preserve attributes)
- v - verbose mode (displaying progress and processing information)
- delete - deletes files on the target location that do not exist on the source location
- dry-run - enables simulation mode, where rsync displays what would happen, but does not perform the actual synchronisation, so you can experiment to your heart's content
This is what it looked like for me:
WSL terminal showing example use of the rsync command to simulate copying files between directories. .
rsync will also give information about deleted files. And of course - the process can be interrupted and resumed, the whole thing works "smart" and does not copy blindly, it is an efficient solution.


Summary
Installing WSL on Windows really opens up a lot of possibilities and allows you to run a lot of convenient, previously rather inaccessible applications comfortably on "windows". Rsync is one of them and does quite well, especially as it synchronises everything locally. There are no clouds, Boxes, Drives or thereabouts commercial intermediaries, additionally constantly trying to persuade us to buy additional storage space. For this reason, I believe that the solution presented here is attractive to those who value privacy and want to have everything under their control.
Finally, let me remind you of the important 3-2-1 rule:
- 3 means that all our data should be kept in at least 3 copies (3 x backup)
- 2 means that the copies should be on at least two different media
- 1 means that at least one copy should be in a different location (physically, so-called "offsite").. off-site backup)
In my case there are a bit more of these copies, as I also regularly burn DVDs with progress shots, but these 3 (or is it 4?) copies are the bare minimum when something is important.
That's about it from my side. If something is not clear, please ask in the forum, I will help. .
I hope to save at least one person from data loss this way....
Do any readers use rsync? Or do you have any other methods to protect against data loss? .
PS: With these at least three copies it's not a joke - just recently on our forum I read a story of a user who supposedly made a copy, but when the main media broke down (one with SMR - but that's another matter...) this copy failed him.... so three copies is the minimum.
PS2: Just for the record - nothing replaces a version control system, but if it's about e.g. photos etc, then rather rsync will suffice

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14386 posts with rating 12305 , helped 650 times. Been with us since 2014 year.

Comments

GGK 05 Aug 2023 08:00

Such a copy does not protect against ransomware unfortunately. You can play around and set the mapping of the remote share before and after synchronisation. Possibly introduce rotation. We use the free... [Read more]

p.kaczmarek2 05 Aug 2023 08:56

It depends. In my case, the remote server is only switched on occasionally, so there's a period of time where I can figure out if something is wrong. I also have extra copies. A version control system... [Read more]

acctr 05 Aug 2023 13:02

I have set up a backup and data management system for my own use. I use rsync, but this tool alone is not enough. There are problems such as duplicate files and strategies for managing them, synchronising... [Read more]

simw 05 Aug 2023 13:54

There is a windows version of rsync and you do not need such special combinations to use it https://itefix.net/cwrsync-client I just use it for backup. [Read more]

p.kaczmarek2 05 Aug 2023 14:32

@simw good point. @acctr yes, I play like that too, I have at least a multithreaded, just based on hash tables (but the first level of hashes is... file length in bytes), deduplication program: ... [Read more]

ex-or 05 Aug 2023 16:49

I use rsync to back up my Linux machines. The root branch is dumped in its entirety (without /tmp and the like) - disaster recovery is easy and fast, which I have tested several times. The filesystems... [Read more]

acctr 05 Aug 2023 17:47

. I use the dedicated Timeshift tool for this. [Read more]

jvoytech 06 Aug 2023 12:40

If by chance someone has msys2 installed on windows, rsync is installed with the command "pacman -S rsync" [Read more]

acctr 06 Aug 2023 12:44

. And this is not the package manager in Arch linux? In ubuntu/mint we have apt. [Read more]

p.kaczmarek2 06 Aug 2023 12:48

Looks like @jvoytech is right. On my msys2 this command works. Thanks, I learned something new. https://obrazki.elektroda.pl/8016651800_1691318892_thumb.jpg . [Read more]

simw 06 Aug 2023 13:23

. It seems to be similar with Cygwin64. It too is in packages and can be installed. All in all no surprise, after all it's a linux toolkit for windows. https://obrazki.elektroda.pl/1830110300_1691320952_thumb.jpg... [Read more]

FAQ

TL;DR: In 3 steps WSL + rsync can cut repeat-backup traffic by up to 70 % [Tridgell, 1996]; “rsync only sends changed files” [Elektroda, p.kaczmarek2, post #20681049] Follow the 3-2-1 rule and optionally air-gap shares to curb ransomware.

Why it matters: Fast, scriptable backups give hobbyists enterprise-grade data safety.

Quick Facts

• Windows 10 2004 (build 19041)+ or Windows 11 required for WSL [Elektroda, p.kaczmarek2, post #20681049] • One-line install: wsl --install (PowerShell, Admin) [Elektroda, p.kaczmarek2, post #20681049] • cwRsync portable client download ≈ 5 MB ["cwRsync Client Download"]. • --compress switch boosts rsync over slow links by 20-30 % [Tridgell, 1996]. • Snapshot + rsync disaster-recovery proven in minutes [Elektroda, ex-or, post #20682157]

What is rsync and why prefer it over simple copy commands?

Rsync compares file blocks and transfers only differences, saving bandwidth and time. Incremental runs can skip 90 % of unchanged data [Tridgell, 1996]. It preserves permissions, timestamps, and resumes after interruption. "It is an efficient solution" [Elektroda, p.kaczmarek2, post #20681049]

How do I install Ubuntu under WSL the quick way?

  1. Open PowerShell as Administrator.
  2. Run wsl --install -d Ubuntu. The script downloads kernel and image [Elektroda, p.kaczmarek2, post #20681049]
  3. Reboot when prompted, then create a Unix username/password at first launch. Total time: ≈ 5–10 min on 50 Mbps internet [Microsoft Docs, 2023].

How do I mount a Windows network share inside WSL?

Use the drvfs driver.

sudo mkdir -p /mnt/x
sudo mount -t drvfs X: /mnt/x
Replace X: with your mapped drive letter [Elektroda, p.kaczmarek2, post #20681049] This makes SMB files visible to Linux tools.

What is a safe starter rsync command for testing?


rsync -av --delete --dry-run /mnt/w/ /mnt/x/backup
• -a archives, -v verbose.
• --delete removes target files missing on source.
• --dry-run lists actions without changing data [Elektroda, p.kaczmarek2, post #20681049] Remove --dry-run once satisfied.

Could rsync backups still fall to ransomware?

Yes. If the share stays mounted, malware may encrypt both copies [Elektroda, GGK, post #20681510] Mitigate by:
  1. Mounting share only during backup window.
  2. Using rotation or immutable snapshots.
  3. Keeping at least one offline copy (air-gapped).

What is the 3-2-1 backup rule mentioned?

Keep 3 copies of data, on 2 different media, with 1 copy off-site [Elektroda, p.kaczmarek2, post #20681049] This limits single-point failure risk and speeds recovery.

How can I schedule automatic backups from Windows?

Create a .bat calling wsl rsync … and add it to Task Scheduler (daily or on-logoff). Or place a shell script in /etc/cron.daily inside WSL. Both trigger unattended runs.

What edge cases should I watch when mixing Windows and Linux paths?

  1. NTFS doesn’t store all Unix permission bits; rsync will warn.*
  2. Paths over 260 characters break older Windows APIs. Use git config --system core.longpaths true or shorten hierarchy.
  3. FAT/exFAT strips case sensitivity; expect spurious replacements.

What performance should I expect over Gigabit LAN?

Rsync with compression disabled averages 90–110 MB/s when source and target disks sustain that rate. SSH encryption cuts 10-15 % throughput [Elektroda, ex-or, post #20682157]

How do I restore a Linux system backed up with rsync?

Boot a live USB, create an LVM volume, then run:

rsync -aHv /backup/root/ /mnt/newroot/
Install GRUB, update fstab, reboot. Users reported full recovery in under 15 minutes for 10 GB roots [Elektroda, ex-or, post #20682157]
Generated by the language model.
%}