I am trying to understand how snapshots on NAS work. Let's say that I have a 10GB share on NAS. I create a 1GB file. A daily snapshot is taken. After that I delete the file, but the snapshot remains. How much available space will I have? I assume that it will not let me overwrite the space where the snapshot points so, will I have 9GB of available space remaining?
-
1it depends on the NAS and the software used. Maybe giving us the make and model and vendor for a start? – Zapto Sep 15 '16 at 14:31
1 Answers
Most NAS snapshots implement copy-on-write, so the snapshot itself initially takes up no space (or next-to-none, there is some overhead). But any block that is changed whilst the file it's part of is snapshotted must be copied. If an entire file is deleted whilst it's still in a snapshot, all those blocks must still be kept.
So in your case above, as long as that file is still in a snapshot, you only have 9GB left. Worse still, if the file is not deleted but completely altered, so that every block is changed, you will only have 8GB left, as 1GB is used up by the file in its current incarnation, and 1GB is used by the original file. If the file is completely changed every day, and every daily snapshot is kept, you'll run out of space completely before the end of day ten.

- 79,770
- 20
- 184
- 232
-
Thank you! Just want to double check. If I create a file and delete it before snapshot is taken, it will not consume any space? – Alex Sep 14 '16 at 16:36
-
If creation *and* deletion happen without any intervening snapshots, the file is simply gone, and takes no space. – MadHatter Sep 14 '16 at 16:37