User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

A lot of time people ask how rsync backup type works and how hardlinks are used. Following article describes when files are created and deleted on the file system Dateien and when hardlinks are used.


Hardlinks is a filsystem feature of Linux etx3 and ext4 filesystem. They are pointer which connect a filename with a file contents. That way hardlinks can be used to point to the same file contents with different filenames from different locations in the file tree. Linux command  ln can be used to create hardlinks.

Furing the first rsync backup run all files are copied and create on the backup space. All following backup runs will copy only changed an new files. Therefore most of the time these backup runs are relatively short compared to the first full backup. for all other files hardlinks are created in the backup filesystem which point to the previously saved file version.When files were deleted there will be no hardlinks created and thus the file is deleted in the backup. This allows to have full access to all files and files are copied and saved only once. This saves backup time and -space. The following picture show when F2 will be deleted on the filesystem. Keep in mind this only will happen if all backups which include F2 were deleted, which is BD1 - BD5. 


Following picture shows again how files and hardlinks are created and deleted. There exists also a Youtube video where hardlinks are explained in detail including a demo on the system.

raspiBackup rsync

In raspiBackup FAQ17 you find a description how to check how much diskspace is used when hardlinks are used.



Everything you ever wanted to know about inodes on Linux - How-To Geek

Add comment

*** Note ***

Comments are welcome. But in order to reject spam posts please consider following rules:
  1. Comments with string http are rejected with message You have no rights to use this tag
  2. All comments are reviewed by hand and thus it usually takes one day until a comment will be published.