From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 25FEA1396D0 for ; Fri, 8 Sep 2017 19:09:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5F551FC0B6; Fri, 8 Sep 2017 19:09:42 +0000 (UTC) Received: from synchrony.c-14.de (sthelen.eu [IPv6:2a01:4f8:c17:6b43::b:17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5579A1FC099 for ; Fri, 8 Sep 2017 19:09:42 +0000 (UTC) Received: from sardaukar.c-14.de (HSI-KBW-134-3-145-106.hsi14.kabel-badenwuerttemberg.de [134.3.145.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by synchrony.c-14.de (Postfix) with ESMTPSA id 3F7BE644E6 for ; Fri, 8 Sep 2017 19:09:40 +0000 (UTC) Date: Fri, 8 Sep 2017 21:09:24 +0200 From: Simon Thelen To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [offtopic] Copy-On-Write ? Message-ID: <20170908190924.GB4764@anonymous> Mail-Followup-To: gentoo-user@lists.gentoo.org References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Archives-Salt: 1fa78e58-ef31-4be2-a320-5656369a5fc3 X-Archives-Hash: d272191a23096678389c99e2fc8bc690 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