Immutable hard links on ext3/4

ext3ext4filesystemsrsyncsnapshot

In my research on file versioning at the fs level, snapshotting, and related ideas, I took a look at hard-links and exactly what they are and how they behave. Using rsync you can get a pretty slick poor man's snapshotting system up and running on file systems that don't natively support it.

But, can you get immutable hard links on ext3/4 or any other file systems for that matter?

My definition for immutable hard link is: A hard link which, when changed on one location, becomes a regular copy and no longer a hard link.

I would like this because it would enable snapshotting use of the source data to link against instead of a copy of the data (in the case of the rsync snapshotting technique).

I have gigabytes of data that can't be duplicated due to space restrictions but I have enough room if I can intelligently snapshot individual changed files with the rest linked to the source not a copy.

Given all that, is there some other technique, feature or technology I'm really looking for?

Best Answer

There has been a proposal to add a new system call, reflink(), which would do exactly what you want. So far, it has not been accepted; however, ocfs2 (since 2.6.32) already has it as a ioctl ([1][2]).

A couple of articles from May 2009 on the subject:

An older variant of the idea was called COW Links.

Related Topic