Delete old Timeshift snapshots and keep the recent one(Rsync)?

according to this thread it’s fine
https://forums.linuxmint.com/viewtopic.php?p=1474848
i didn’t try to fully grasp what they’re saying there,but what’s weird for me is that the first snapshot i create is really big(15-20 GB)and the following ones are 5-10~ GB.(so i assume they rely on the first one).
so how can Timeshift have enough data to do a restore only with the second/most recent smaller snapshot,when at at first it needed around 20GB?

The first snapshot is a literal copy of all your data. The second snapshot checks your data for whether it has been modified since the previous bakcup. The modified files are again copied over verbatim, but for the files that have not been modified since the last backup, timeshift ─ or actually, rsync, which is what it uses in the background ─ creates a so-called hard link to the most recent copy of the file already in the backup.

Unlike soft-linking ─ also known as symbolic linking ─ hard-linking is only possible within a single filesystem, because a hard link is in essence only a new name for an already existing file, and filenames are themselves only entries in a directory; the files themselves are identified by their inode, not by their name.

Ergo, and to summarize, timeshift makes a full copy of new or modified files, and if these files have not been modified when timeshift is run again, then instead of copying the file a second time, it will create a hard link against the copy of the file in the initial backup. Given that hard links are only additional names for a file, they do not consume any disk space.

2 Likes

With other words, deleting older timeshift snapshots is totally harmless.

2 Likes

Well, yes and no ─ it depends. If your older snapshots contain earlier versions of certain files ─ or maybe you’ve deleted the file from your system in the meantime ─ then it is wise to keep the old snapshots, so that you have both the old and the new versions of the file, or so that you can recover a file that you’ve accidentally deleted. :wink:

2 Likes

Thank you @Aragorn for the detailed explanation.

it’s nice to be able to save some disk space and not delete and recreate the first snapshot every time,like i used to do,to avoid having to many snapshots, and keep only the smaller recent one.

1 Like

That’s the great thing about timeshift and similar backup strategies like rsnapshot. Your data is always there, and if you know how to navigate the tree of backups, then you can even restore individual files or directories without needing to restore the full snapshot. :wink:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.