public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* using snapshot for backup: best practise?
@ 2025-06-26 11:43 Ulli Horlacher
  2025-06-26 12:41 ` Graham Cobb
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ulli Horlacher @ 2025-06-26 11:43 UTC (permalink / raw)
  To: linux-btrfs


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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-30 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox