public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Harmstone <mark@harmstone.com>
To: linux-btrfs@vger.kernel.org, framstag@rus.uni-stuttgart.de
Subject: Re: using snapshot for backup: best practise?
Date: Mon, 30 Jun 2025 11:09:14 +0100	[thread overview]
Message-ID: <b7d55f63-5827-4bbf-b0ff-dea46b00f7dd@harmstone.com> (raw)
In-Reply-To: <20250626114345.GA615977@tik.uni-stuttgart.de>

On 26/06/2025 12.43 pm, Ulli Horlacher wrote:
> 
> I am using fsfreeze when running a backup to ensure a consistent filesystem.
> 
> While the backup is running writes to the filesystem are suspended and the
> whole system is unresponsive, e.g. logins are not possible.
> On certain errors the unfreeze will not happen and the system is locked
> forever.
> 
> Using snapshots seems a better idea for backups :-)
> 
> But snapshots do not include subvolumes.

Omar Sandoval had patches to add recursive snapshotting to btrfs-progs, but
they never made it in, for reasons I can't remember.

> For example the / filesystem has the subvolumes:
> /home
> /home/tux/test
> /var/spool
> 
> When I run the command:
> 
> btrfs subvolume snapshot / /.snapshot/_
> 
> the snapshot will contain only the root subvolume.
> 
> I have to manually add:
> 
> rmdir /.snapshot/_/home
> btrfs subvolume snapshot /home /.snapshot/_/home
> rmdir /.snapshot/_/home/tux/test
> btrfs subvolume snapshot /home/tux/test /.snapshot/_/home/tux/test
> rmdir /.snapshot/_/var/spool
> btrfs subvolume snapshot /var/spool /.snapshot/_/var/spool
> 
> Then run the backup on /.snapshot/_ und afterwards:
> 
> btrfs subvolume del /.snapshot/_/var/spool
> btrfs subvolume del /.snapshot/_/home/tux/test
> btrfs subvolume del /.snapshot/_/home
> btrfs subvolume del /.snapshot/_
> 
> But this will work only for this special example!
> And I have hundreds of systems to backup with different filesystem layout!
> 
> Is there a best practise "Using snapshots for making backup"?
> I need automatic detecting, creating and removing of nested snapshots.
> 


      parent reply	other threads:[~2025-06-30 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 11:43 using snapshot for backup: best practise? Ulli Horlacher
2025-06-26 12:41 ` Graham Cobb
2025-06-26 19:35   ` Ulli Horlacher
2025-06-29 22:50 ` Ulli Horlacher
2025-06-30 10:09 ` Mark Harmstone [this message]

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=b7d55f63-5827-4bbf-b0ff-dea46b00f7dd@harmstone.com \
    --to=mark@harmstone.com \
    --cc=framstag@rus.uni-stuttgart.de \
    --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