On 17-09-07 at 17:46, Helmut Jarausch wrote:
> Hi,
Hello,

> sorry, this question is not Gentoo specific - but I know there are many  
> very knowledgeable people on this list.
> 
> I'd like to "hard-link" a file X to Y - i.e. there is no additional  
> space on disk for Y.
> 
> But, contrary to the "standard" hard-link (ln), file Y should be stored  
> in a different place (inode) IF it gets modified.
> With the standard hard-link, file X is the same as Y, so any changes to  
> Y are seen in X by definition.

> Is this possible
> - with an ext4 FS
> - or only with a different (which) FS
You can use GNU coreutil's `cp --reflink=always'.  This will, however,
only work on filesystems which support the operation (afaik so far only
btrfs). Though other CoW filesystems (such as ZFS) have similar
capabilities with snapshotting.

The only other possibility I know of would be creating an lvm partition
for that file and using lvm snapshots.

You should also be able to implement the functionality via fuse on top
of an ext4 base if the other solutions aren't to your taste.

-- 
Simon Thelen

Reply via email to