How to reduce snapshot size

Posted June 3, 2016 7.1k views

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

1 comment
  • 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.

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.

Submit an Answer
3 answers

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 also spoke to the support (after yesterday’s snapshot billing announcement). They answered that the snapshot size will be adjusted before billing occurs.

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.

  • Before doing snapshots, droplet should be powered off so all programs are down

    • You’re right, all of yours are named “Backup” so I was thinking of the other feature.

      Maybe try using du to find your files. It can do recursive searches, summaries, etc.

      • [root@spiralarms ~]# du -sh /
        du: cannot access `/proc/2662/task/2662/fd/4': No such file or directory
        du: cannot access `/proc/2662/task/2662/fdinfo/4': No such file or directory
        du: cannot access `/proc/2662/fd/4': No such file or directory
        du: cannot access `/proc/2662/fdinfo/4': No such file or directory
        6,1G    /

        du says it’s only 6 gb filled

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?