From: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: using snapshot for backup: best practise?
Date: Mon, 30 Jun 2025 00:50:41 +0200 [thread overview]
Message-ID: <20250629225041.GA967706@tik.uni-stuttgart.de> (raw)
In-Reply-To: <20250626114345.GA615977@tik.uni-stuttgart.de>
On Thu 2025-06-26 (13:43), Ulli Horlacher wrote:
> Using snapshots seems a better idea for backups :-)
>
> But snapshots do not include subvolumes.
>
> When I run the command:
>
> btrfs subvolume snapshot / /.snapshot/_
>
> the snapshot will contain only the root subvolume.
Mewanwhile I have written some (more) tools to handle nested subvolumes
and snapshots.
Example:
root@fex:~# btrfs_list /local/test
ACCESS-MODE SUBVOLUME <- SNAPSHOT-PARENT
rw /local/test
rw /local/test/sv1
rw /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_1/ss <- /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_2
rw /local/test/sv2
root@fex:~# btrfs_rsnapshot /local/test
Create a snapshot of '/local/test' in '/local/test/.snapshot/test'
Create a snapshot of '/local/test/sv1' in '/local/test/.snapshot/test/sv1'
Create a snapshot of '/local/test/sv1/sv1_1' in '/local/test/.snapshot/test/sv1/sv1_1'
Create a snapshot of '/local/test/sv1/sv1_1/ss' in '/local/test/.snapshot/test/sv1/sv1_1/ss'
Create a snapshot of '/local/test/sv1/sv1_2' in '/local/test/.snapshot/test/sv1/sv1_2'
Create a snapshot of '/local/test/sv2' in '/local/test/.snapshot/test/sv2'
root@fex:~# btrfs_list /local/test
ACCESS-MODE SUBVOLUME <- SNAPSHOT-PARENT
rw /local/test
ro /local/test/.snapshot/test <- /local/test
ro /local/test/.snapshot/test/sv1 <- /local/test/sv1
ro /local/test/.snapshot/test/sv1/sv1_1 <- /local/test/sv1/sv1_1
ro /local/test/.snapshot/test/sv1/sv1_1/ss <- /local/test/sv1/sv1_1/ss
ro /local/test/.snapshot/test/sv1/sv1_2 <- /local/test/sv1/sv1_2
ro /local/test/.snapshot/test/sv2 <- /local/test/sv2
rw /local/test/sv1
rw /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_1/ss <- /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_2
rw /local/test/sv2
root@fex:~# btrfs_rsnapshot -d /local/test
Delete subvolume (no-commit): '/local/test/.snapshot/test/sv2'
Delete subvolume (no-commit): '/local/test/.snapshot/test/sv1/sv1_2'
Delete subvolume (no-commit): '/local/test/.snapshot/test/sv1/sv1_1/ss'
Delete subvolume (no-commit): '/local/test/.snapshot/test/sv1/sv1_1'
Delete subvolume (no-commit): '/local/test/.snapshot/test/sv1'
Delete subvolume (no-commit): '/local/test/.snapshot/test'
root@fex:~# btrfs_list /local/test
ACCESS-MODE SUBVOLUME <- SNAPSHOT-PARENT
rw /local/test
rw /local/test/sv1
rw /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_1/ss <- /local/test/sv1/sv1_1
rw /local/test/sv1/sv1_2
rw /local/test/sv2
--
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 prev parent reply other threads:[~2025-06-29 22:50 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 [this message]
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=20250629225041.GA967706@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