All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: BP25 <bp25@posteo.net>
Cc: Linux btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Snapshots of individual files
Date: Tue, 23 Dec 2025 12:56:47 +0500	[thread overview]
Message-ID: <20251223125647.6626b266@nvm> (raw)
In-Reply-To: <79ae6c26545c107010719ee389947c1c@posteo.net>

On Tue, 23 Dec 2025 00:43:25 +0000
BP25 <bp25@posteo.net> wrote:

> Hello,
> Can any of you guys help me understand why it hasn't been made possible 
> to snapshot individual files? Because technically it's trivial to 
> implement therefore I suspect there must be some abstract reason... The 
> only thing I can think of is the case where some file which was 
> snapshotted is then deleted hence there is no way to 'select such file' 
> and ask btrfs for the snapshotted versions... but even in this case I 
> see no problem: either the convention is that when you delete a file 
> then all snapshots of such individual file are also deleted, or better 
> there is a command that shows all files who have been deleted but have 
> have been snapshotted in the past.
> Any ideas?
> Please CC or BCC me cause I'm not subscribed.

You can make "snapshots" of a file with:

  cp -a --reflink filename filename.snap

from what I tested this appears to be atomic (entire file is reflinked at
once), someone might correct me if I'm wrong.

Works on modern XFS too.

-- 
With respect,
Roman

  reply	other threads:[~2025-12-23  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23  0:43 Snapshots of individual files BP25
2025-12-23  7:56 ` Roman Mamedov [this message]
2025-12-23 10:26   ` BP25
2025-12-23 11:19     ` Andrei Borzenkov
2025-12-23 12:08       ` BP25
2025-12-23 12:27         ` Roman Mamedov
2025-12-23 12:48         ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251223125647.6626b266@nvm \
    --to=rm@romanrm.net \
    --cc=bp25@posteo.net \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.