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.

  • Ephera@lemmy.ml
    ·
    28 days ago

    BTRFS snapshots are 'incremental'. So, the very first snapshot is a clone of your system at the time that snapshot was created.
    The second snapshot only contains what changes there were from the first.
    The third snapshot only contains what changes there were from the first+second.
    And so on.

    So, yes, you can delete the fifth snapshot, but for the most part, it will mean that the sixth snapshot just incorporates the changes that the fifth snapshot contained.

    If you're looking to free up space, deleting the fifth snapshot will only do that, if files had been added before the fifth snapshot got created, which then had been removed again before the sixth snapshot got created.
    Because then removing the fifth snapshot means those files are completely removed from any snapshots, they don't need to be remembered anymore.
    If between the fourth and the sixth snapshot, you had only ever added files, then deleting the fifth snapshot will free up effectively no space at all.