Four snapshot folders, each one 96 or 97 megabytes when measured alone, and 98 megabytes on disk for all four together. That is the output du printed on a test container after four days of simulated backups with rsync --link-dest. Every folder is a complete, browsable copy of the source. Almost none of it is stored twice.
The trick is the hard link, a second name for the same data on disk, and it is old enough that the rsnapshot project built a whole tool around it, saying its code “makes extensive use of hard links whenever possible, to greatly reduce the disk space required.” Everything below was run on an Ubuntu 24.04 test container with rsync 3.2.7, against 500 files of random data totaling 100 MB. Timestamps are trimmed from the output.
What –link-dest does, in one sentence from the manual
Unchanged files become pointers to yesterday’s copy; changed files get copied in full
The rsync manual describes the option briefly: “hardlink to files in DIR when unchanged.” In the longer entry, it says unchanged files “are hard linked from DIR to the destination directory,” and that a file only qualifies when it matches in all the preserved attributes, such as permissions and possibly ownership. Rsync accepts up to 20 --link-dest directories in one run.
A hard link is not a shortcut file. Two directory entries point at the same inode, the same blocks on the disk, and the data stays alive until the last name is deleted. Deleting the oldest snapshot never damages a newer one, which is what makes the rotation safe. It also means nothing protects an old snapshot from an edit made through a newer name, and that comes back later.

The script and the four test days
A dozen lines of bash, one symlink, and a directory per day
The test script, with the snapshot name passed in as an argument (a nightly job would use the date):
#!/bin/bash
set -euo pipefail
SRC=/tmp/rsynclab/src/
DEST=/tmp/rsynclab/snap
NAME="$1" # normally $(date +%F)
LATEST="$DEST/latest"
if [ -d "$LATEST" ]; then
rsync -a --delete --link-dest="$LATEST" "$SRC" "$DEST/$NAME"
else
rsync -a --delete "$SRC" "$DEST/$NAME"
fi
ln -sfn "$NAME" "$LATEST"set -euo pipefail stops the script on the first error, a habit explained in the x9m8 post on bash strict mode. The latest symlink is moved only after rsync succeeds, so a failed night does not become tomorrow’s reference.
The source started as 10 directories of 50 files, each 200,000 bytes of random data. Then four days:
- Day 1: first full copy.
- Day 2: five files rewritten, two new 300,000-byte files added, one file deleted.
- Day 3: nothing changed.
- Day 4: 1,000 bytes appended to one file.
Reading du correctly
Measured one at a time, every snapshot looks full; measured together, the truth comes out
du counts a hard-linked file only once per invocation. Run it on one folder at a time and each snapshot claims the whole data set:
$ for d in day1 day2 day3 day4; do du -sh snap/$d; done
96M snap/day1
97M snap/day2
97M snap/day3
97M snap/day4
Run it on all four in one command and each folder is charged only for blocks no earlier folder in the list already claimed:
$ du -sh snap/day1 snap/day2 snap/day3 snap/day4
96M snap/day1
1.6M snap/day2
48K snap/day3
248K snap/day4
$ du -sb snap/day1 snap/day2 snap/day3 snap/day4
100000000 snap/day1
1600000 snap/day2
0 snap/day3
201000 snap/day4
$ du -sh snap
98M snap
The byte counts line up exactly with the changes. Day 2 cost 1,600,000 bytes: five rewritten 200,000-byte files plus two new 300,000-byte files. Day 3 cost nothing but directory entries, the 48K reported by plain du. Day 4 cost 201,000 bytes, which is the whole appended file, not the 1,000 new bytes.
That last number matters. Hard-link snapshots work at file granularity, so a one-byte change to a 4 GB virtual machine image costs 4 GB in the next snapshot. Tools that deduplicate in chunks, like restic, handle that case very differently.
The link counts and inode numbers confirm what happened underneath:
$ stat -c '%h %n' snap/day4/docs/d5/f5.bin snap/day4/docs/d0/f1.bin snap/day4/docs/d1/f0.bin
4 snap/day4/docs/d5/f5.bin
3 snap/day4/docs/d0/f1.bin
1 snap/day4/docs/d1/f0.bin
$ ls -i snap/day1/docs/d5/f5.bin snap/day4/docs/d5/f5.bin
1157189 snap/day1/docs/d5/f5.bin
1157189 snap/day4/docs/d5/f5.bin
An untouched file has four names, one per day. A file rewritten on day 2 has three. The file appended on day 4 has one. And the file deleted on day 2 is still in day 1 and gone from day 2 onward, because --delete keeps each snapshot an honest picture of its own night.

Deleting the oldest snapshot
Removing a day frees only the blocks no other day still points to
Retention is where hard links pay for themselves a second time. Deleting a snapshot is an ordinary rm -rf, and the filesystem frees a file’s blocks only when its link count reaches zero. On the test box, after day 1 was removed:
$ du -sh snap # before
98M snap
$ stat -c '%h' snap/day4/docs/d5/f4.bin
4
$ rm -rf snap/day1
$ du -sh snap # after
97M snap
$ stat -c '%h' snap/day4/docs/d5/f4.bin
3
$ ls snap
day2 day3 day4 latest
About 1.2 megabytes came back (a follow-up du -sb snap dropped by exactly 1,200,000 bytes), and they are the right bytes. Day 1 held the only copies of two kinds of data: the file deleted from the source on day 2, and the original versions of the five files rewritten that day, six files of 200,000 bytes in all. Everything else in day 1 still had names in days 2 through 4, so its link count simply dropped by one and its blocks stayed put. Days 2, 3 and 4 are untouched and still complete.
That is why the rotation can be blunt. A nightly job can delete anything older than 30 days without working out which files are shared, because the filesystem is already keeping that ledger. The flip side follows from the same rule: the file deleted from the source on day 2 now exists nowhere. Retention length is the window for noticing that something is gone.
Where people get burned
All but the last of these were reproduced on the test container
A relative –link-dest path. The manual says that if DIR “is a relative path, it is relative to the destination directory.” Run from the backup root with --link-dest=snap/latest, rsync looked for snap/day5-wrong/snap/latest, found nothing, and copied everything:
$ rsync -a --delete --link-dest=snap/latest src/ snap/day5-wrong
--link-dest arg does not exist: snap/latest
$ du -sh snap/day1 snap/day5-wrong | tail -1
97M snap/day5-wrong
One warning line and a full extra copy. A nightly job that does this fills the disk in a week while every run reports success. An absolute path, or --link-dest=../latest, both worked and produced a snapshot that cost 1.8M when measured after day 1 (the changes made on days 2 and 4, which day 1 never had).
Editing a file inside an old snapshot. Every snapshot shares the same inode for an unchanged file, so editing one name edits them all. On the test box, appending a line to snap/day3/docs/d5/f5.bin changed day 1’s copy too:
before: day1 f5.bin md5 eb5f00401133...
after appending to day3's copy:
day1 f5.bin md5 53ccb681d3cd...
src f5.bin md5 eb5f00401133...
Day 1 no longer matches the source it was taken from. The next dry run also wanted to re-send that file, because the latest snapshot had been altered through the same inode. Treat snapshots as read-only; restore by copying out, never by working inside them. The manual makes a related warning that attribute changes on linked files “can affect alternate destination files via hard-links.”
The trailing slash. The manual says a trailing slash on the source avoids “creating an additional directory level at the destination.” Tested: rsync -a src snap/x produced snap/x/src/docs, while rsync -a src/ snap/y produced snap/y/docs. Mixing the two between runs breaks linking, because the paths no longer match yesterday’s.
Hard links in the source. The manual says -a is equivalent to -rlptgoD and does not include -H, -A or -X. Source files that are themselves hard-linked get copied as separate files unless -H is added, and ACLs and extended attributes are dropped without -A and -X.
A destination drive that cannot hold hard links. Hard links need a filesystem that supports them. This was not tested here, since the container’s disk is ext4. The safe check is to run two snapshots onto the actual backup drive and compare ls -i on the same file.

The case against rsync snapshots
Same disk, same machine, same failure: snapshots are not automatically a backup
The strongest objection to this setup is that it is often built in the wrong place. A snapshot folder on the same drive as the data dies with that drive. On the same machine, it dies with ransomware that can write to both. Hard links also make it easy to believe there are many copies when there is physically one, an illusion the x9m8 posts on RAID and the 3-2-1 rule take apart from two directions. Thirty days of snapshots of a file that was silently corrupted on day one is thirty linked names for the same bad blocks, since an unchanged file is never re-copied.
Rsync is also file-level. A live database copied mid-write can be torn, which is why a running database needs its own dump or backup step before rsync ever sees it. And there is no encryption, no integrity check of the stored copies, and no built-in pruning. Retention is a find snap -maxdepth 1 -name '20*' -mtime +30 with a delete on the end, and everyone writes that line slightly differently.
What rsync snapshots give back is plainness. Every snapshot is an ordinary directory tree. Restoring a file is cp. Any machine with a shell can read the backup ten years from now, with no repository format, no password and no tool version to match. For a second copy on a separate drive or a separate box, that is a strong trade.
The test disk ended holding 98 megabytes for four complete days. On a real system the folders keep accumulating quietly, each one looking full, until someone runs du one folder at a time and panics, or runs it on all of them at once and realizes how little has ever been copied. When was the last time anyone restored a single file from their own snapshots, just to see it come back?
Sources
- rsync(1) manual: https://download.samba.org/pub/rsync/rsync.1
- rsnapshot project page: https://rsnapshot.org/
- Test output: Ubuntu 24.04 container, rsync 3.2.7 protocol 31, 100 MB random-data test set (run for this post)
