Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to validate 'cleanup' is working as intended? #10

Open
TheLinuxGuy opened this issue Nov 21, 2022 · 1 comment
Open

How to validate 'cleanup' is working as intended? #10

TheLinuxGuy opened this issue Nov 21, 2022 · 1 comment

Comments

@TheLinuxGuy
Copy link

Hi, I am using your script for my project https://github.com/TheLinuxGuy/free-unraid and I am looking to validate that the cleanup function is working as intended.

My understanding is that if cleanup = true upon successful execution of the script that there should be no btrfs snapshot volumes on disk.

This doesn't seem to be what I am seeing, aren't these left over from previous runs?

root@nas:/mnt# btrfs subvolume list /mnt/disk1/
ID 256 gen 5076 top level 5 path data
ID 258 gen 5078 top level 5 path content
ID 7617 gen 5077 top level 256 path .snapshots
ID 7620 gen 4291 top level 7617 path .snapshots/3/snapshot
ID 7621 gen 4296 top level 7617 path .snapshots/4/snapshot
ID 8842 gen 5072 top level 7617 path .snapshots/1/snapshot
ID 8843 gen 5073 top level 7617 path .snapshots/2/snapshot
ID 8844 gen 5074 top level 7617 path .snapshots/5/snapshot
ID 8845 gen 5076 top level 7617 path .snapshots/6/snapshot
root@nas:/mnt# btrfs subvolume list /mnt/disk2/
ID 257 gen 5485 top level 5 path data
ID 258 gen 5487 top level 5 path content
ID 15158 gen 5486 top level 257 path .snapshots
ID 15161 gen 4127 top level 15158 path .snapshots/3/snapshot
ID 15162 gen 4167 top level 15158 path .snapshots/4/snapshot
ID 19034 gen 5481 top level 15158 path .snapshots/5/snapshot
ID 19035 gen 5482 top level 15158 path .snapshots/6/snapshot
ID 19036 gen 5483 top level 15158 path .snapshots/7/snapshot
ID 19037 gen 5485 top level 15158 path .snapshots/8/snapshot

I think I would expect there to be no .snapshots/XXX/snapshot in the above output if the script was working as intended, since only a single (or none) .snapshots should exist?

@FlexibleToast
Copy link

That's not necessarily the case. It will cleanup all snapraid-btrfs created snapshots before the latest successful sync. This means if you have snapshots created by snapper itself those will still exist. Also if there were no changes to the disks discovered during the snapraid-btrfs diff it won't run a sync and therefore the snapshots created by the diff will be after the last successful snapraid-btrfs sync and will not be cleaned up. You can always use snapper ls -a to list all of your snapshots and look at the descriptions of what they are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants