From: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
To: linux-btrfs@vger.kernel.org
Subject: using snapshot for backup: best practise?
Date: Thu, 26 Jun 2025 13:43:45 +0200 [thread overview]
Message-ID: <20250626114345.GA615977@tik.uni-stuttgart.de> (raw)
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.
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.
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: https://www.tik.uni-stuttgart.de/
REF:<20250626114345.GA615977@tik.uni-stuttgart.de>
next reply other threads:[~2025-06-26 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 11:43 Ulli Horlacher [this message]
2025-06-26 12:41 ` using snapshot for backup: best practise? Graham Cobb
2025-06-26 19:35 ` Ulli Horlacher
2025-06-29 22:50 ` Ulli Horlacher
2025-06-30 10:09 ` Mark Harmstone
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=20250626114345.GA615977@tik.uni-stuttgart.de \
--to=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