this post was submitted on 05 Oct 2024
15 points (100.0% liked)

Arch Linux

7763 readers
8 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

Let's say i made 10 snapshots on top of the base.

Now can i delete snap no. 5? Will the snaps after 5 will be affected?

Solved

Yes, one can delete consecutive snapshots. The data won't be deleted unless all snaps ( reference points ) get deleted.

Note: If you delete the original file and delete all the snapshots made when the file is still there, the file will get deleted permanently.

you are viewing a single comment's thread
view the rest of the comments
[–] Ephera@lemmy.ml 1 points 1 month ago (1 children)

Well, the official btrfs docs call it "incremental", maybe you want to argue with those guys. :P
For example, here it says:

efficient incremental filesystem mirroring and backup

But yeah, I guess, I wasn't quite accurate there, because I was conflating it with incremental backups.
Semantically, it's like you have a full copy in the first snapshot, but because of copy-on-write magic, it doesn't actually need to duplicate the bytes until the data gets changed for the first time.

Still means, though, that deleting an intermediate snapshot will only free up data, if something's contained in it, which is reverted in later snapshots.

[–] nous@programming.dev 1 points 1 month ago (1 children)

You missed an important part of that quote:

Send/receive of subvolume changes, efficient incremental filesystem mirroring and backup

This is explicitly talking about a different feature that can incrementally sending changes to the filesystem to another filesystem as a backup. Not at all about how snapshots work.

[–] Ephera@lemmy.ml 2 points 1 month ago

Hmm, yeah, I guess I'm wrong there.

My interpretation was that since send/receive foots on snapshots, those would be related, but I guess, the incremental backup is actually a separate thing.
Some articles online call them "incremental snapshots" as well, which is where I might've gotten that initially, but I agree that on a logical level, they're not that, even if they're similarly space-saving.