Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: BP25 <bp25@posteo.net>
Cc: Andrei Borzenkov <arvidjaar@gmail.com>,
	Linux btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Snapshots of individual files
Date: Tue, 23 Dec 2025 17:27:24 +0500	[thread overview]
Message-ID: <20251223172724.1b1176d5@nvm> (raw)
In-Reply-To: <282168f52d13e55e466c2fd079a246de@posteo.net>

On Tue, 23 Dec 2025 12:08:04 +0000
BP25 <bp25@posteo.net> wrote:

> Is there a standard way to 'follow' the same file along its snapshotted
> versions? Say, ask btrfs to return the list of snapshotted versions by
> giving input this or that file in the current version of the filesystem?
> Note that if such file was deleted and another with the same name created I
> don't want that new file also to show up. And related question, is there any
> command that would list the snapshotted files which have no corresponding in
> the current version of the file system (for example because I deleted such
> file after having snapshotted it)?

There is none of that :)

I put "snapshotted" files in quotes for a reason, it is not a snapshot and
there is no snapshot tree or inheritance.

It is a lightweight instant copy, which lets you to very quickly and
efficiently hold on to states of that file as it was at various points in the
past, if you want to. Where you put it, or which scenarios you envision, is up
to you.

I use this to backup running file-backed VMs, first reflink the image to a
file, then can safely start to gzip that file or copy it to a remote host. The
running VM otherwise would ruin the consistency, with ongoing writes to
its image halfway in that process.

Cool part is that like the snapshots, this is done instantly and consumes no
extra disk space, only the changed bits in the "current" file will. Or you can
go ahead and start changing both files at the same time, that too, will only
increase overall space usage by the amount of changed portions.

-- 
With respect,
Roman

  reply	other threads:[~2025-12-23 12:27 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
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 [this message]
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=20251223172724.1b1176d5@nvm \
    --to=rm@romanrm.net \
    --cc=arvidjaar@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox