Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Time machine & Hard Link

I'm curious how time machine works with hard links. What I mean: I have several hard links to a specific file. What is in a backup image? Only an one copy of the file or many copies and I waste spaces in my Time Capsule?

Time Capsule-OTHER, OS X Mavericks (10.9)

Posted on Dec 10, 2013 12:43 AM

Reply
12 replies

Dec 10, 2013 11:12 PM in response to potapov

potapov wrote:

It means I have several copies of each file with hard link on time capsule. doesn't?

You should only have one copy of each unique version of a file on your TC.


IOW, if you have saved "My document" on January 1st & it is copied to the TC backup set, it will appear in each time stamped backup folder from that date forward, but there is only one copy of that file on the TC, hard linked to each of those time stamped backup folders.


If on March 1st you modify "My Document", one copy of that modified version will be saved to the TC, & it will be hard linked to each time stamped backup folder on & after that date.


If the TC fills up, Time Machine will begin removing the oldest files to make room for the new ones. But removing a file from just one backup folder won't do anything because that just removes the link to the copy of the file. Only when the last link is removed is the file itself removed from the TC. Thus, it will remove the oldest version of a file first, & it will be removed from all time stamped backup folders from the first up to whenever a newer version replaced it.


Again, please study the Pondini page for a better explanation of how this works. Time Machine stores the minimum number of file versions possible to save space. There is no way to improve on this besides removing (through the Time Machine interface) all copies of files you no longer wish to have backed up, or excluding them from all backups (in the Privacy tab of TM's system preference) to begin with.


Above all, do not try to remove anything from a time stamped backup folder via the Finder because this will cause problems. Use only the TM interface to remove files.

Dec 10, 2013 11:17 PM in response to potapov

potapov wrote:

I have my own hard link.

From what to what? How did you create it? Time Machine hard links are unique in that they are hard links to folders, not files. This is dangerous (because of the possibility of recursive references to files within the folder) when done outside the TM framework.

Dec 10, 2013 11:34 PM in response to R C-R

We have misunderstanding.

I know how TM works with file in backup image.


I'll try to explain with more detail.


1. I have a file in folder ~/foo/file-01

2. I crate a hard link via terminal

~/foo$ ln ~/foo/file-01 /Users/Shared/boo/file-01


3. Now I have physicaly one file in my hard drive and share it with others by hard link. It useful for us.


4. What happens with Time Machine? Cases


Case 01

It backups ~/foo/file-01 and /Users/Shared/boo/file-01 as two different file


Case 02

It backups ~/foo/file-01 as the original and creates hard link inside backup image /Users/Shared/boo/file-01 to ~/foo/file-


Case 03

It does something else



Why it is important for me? I have ~1TB of files which are going to be hard linked. If Time Machine needs double space to backup original file and hard link to it I'll try to find other way to share and backup. If Time Machine works correct with hard link in my system I'll be happy.


I hope my explanation is clear.


Thanks for you attention

Dec 11, 2013 4:10 AM in response to potapov

It is case 01 (from your last post). From the man page for ln, note that hard links cannot span file systems so there is no way for a hard link on the file system of the Time Machine volume to link to one on the file system of the startup (or any other) volume.


I don't know if it would suit your purposes but since symbolic links can span files systems, maybe they would work for you.

Time machine & Hard Link

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.