Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been reading up on how OS X Time Machine works. Appearantly it creates hard links for directories as well. I'd imagine directories could just be created and only files could be hard linked.

Is there a good reason to create directory hardlinks? Better space efficiency? Time efficiency?

share|improve this question
up vote 4 down vote accepted

Time Machine uses the File System Events Database if possible to determine what files were changed since the latest backup. So it already has a list of what was changed.

In the default configuration, Time Machine backs up your files several times a day. In regular computer usage patterns, very few directories' contents are changed during this time. Being able to just add a single hard link for an unmodified directory tree saves quite some time and space otherwise used for creating directories and hard-linking files.

Regarding time: You can view the number of files and folders on your disk in Disk Utility. On my 240GB SSD, I have about 356,000 folders and 1.9 million files. Without directory hard links, Time Machine would need to traverse all of these either on the internal disk or in the folder of the previous backup to create all hard links, which would probably increase the time it took to create what is effectively a tiny backup.

Regarding space: Directories need to be stored on disk as well. Without directory hard links, every backup generation would need to consistent of the same ~350k directories. This can easily amount to a few gigabytes in size for the structures alone.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .