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
Remove specific file(s) from all snapshots #221
Comments
Either remove them by hand:
Or use "btrbk prune" with changed preserve flags (either change them in btrbk.conf, or override on command line): Example: delete all snapshots older than 10 days:
|
@digint I'm not interested in deleting the entire snapshot, just a specific file within all snapshots. |
Ah I see. Short answer: you can't remove files from snapshots, as these are read-only (by nature, as they share references to each other). Long answer: you can, but should not. If you are desperate, you can change the subvolumes to read-write using:
see the btrbk FAQ entry on this. In order to get some free space (and keep consistency), you must delete the file in all snapshots where referenced. As long as a single snapshot holds a reference to this file the space will not be freed. @knorrie has some nice tools that might help here: https://github.com/knorrie/python-btrfs Note that if you do this, you also confuse btrbk incremental feature: Your modified snapshots will still have the same UUID, but don't hold the deleted files anymore. |
@digint Thank you for that awesome answer, that's exactly what I was looking for! |
My primary drive recently reached 100% usage, and I spent a while clearing space by removing old snapshots and deleting as much unnecessary data as possible.
There were quite a few large (10G+) files which I deleted from my home directory, but these files are also in nearly every snapshot on my system (I have 119 of them).
How can I delete them from the snapshots so btrfs can finally reclaim the space?
(I do not care about removing them from backups)
The text was updated successfully, but these errors were encountered: