Question

How to reduce snapshot size

I am doing snapshots recently to backup my data. But their size is growing. Even when i do the cleanup, the snapshot size remains the same as it was before. Few days ago because of my fault, my script filled all avaliable 20 gb space, i deleted al those files, so i have 7 gb free now but myand so snapshots are now 20 gb sized (and their creation time is 20 minutes!).

I think the snapshot size may be growing because of ‘rm -rf’ may only mark data as ‘deleted’ but do not ‘annulate’ disk space and DO snapshot burner copies that as well. IDK how linux file deletion happens, correct me if i’m wrong.

I think the easiest way to fix it is to create new droplet and copy everything to it. But please help if you encounted that problem and know a better way to fixed.

My snapshots

Subscribe
Share

Using snapshots captures the whole shebang (including the OS), so using a secondary droplet to store that is an inefficient way of handling backups. Here are a few options:

  1. Pay for backup, which is less than a new droplet and doesn’t need shutdown of your droplet
  2. Use rsnapshot to a remote site (like a Linux box at home)
  3. Infrequent snapshots complemented with rsync of your most critical areas to a remote site

There are many more options, but it all depends on your requirements for disaster recovery.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Ok, so I spoke to the support team and found out that although you’re not using the “empty” space on the droplet it gets snapshotted as well. The file size is not compressed. So if you’re running a 20 gb droplet, the unused space gets added to the snapshot. I think it’s better to switch to alternative backup methods. You don’t want to end up with more than a dozen snapshots weighting at 19 gb’s each in the end.

I’m having the same issue. My latest snapshot is huge compared to the one just created a couple of days ago. 18.14 GB vs 2.65 GB. I’m running a basic LEMP setup with WordPress. Looking at my “/” directory as root with du -sh / it’s only showing 2.1G. Where are all these huge files?

Are you sure you’re not just using that space even though you deleted the files? Files that are still being used by programs will stick around when deleted until those programs stop using them. They contribute to filesystem size that way.