Help! Deleted files, but the hard drive still full
The answer relates to changes to Time Machine backups started in Lion version. Time Machine is the built-in backup feature for Mac and, to use it, you need an external storage solution that could be an external hard disk or part of a NAS system. One thing to keep in mind is that when your time machine backup disk is not available, local snapshots are created to help Time Machine restore data (more about local snapshots here).
One thing to keep in mind is that when your time machine backup disk is not available, local snapshots are created to help Time Machine restore data (more about local snapshots here).
While this may sound like a great feature, there are times when a huge part of your SSD is utilized by those local snapshots, and the only way to clean this up is through the command line utility tmutil
.
Save disk space by deleting your local snapshots
These snapshots can fill up a drive, even though macOS should manage them.
Step 1. List available local snapshots
First of all, you need to find out how many local snapshots exist in your local SSD.
Launch the Terminal (from Applications > Utilities), and then copy and paste this command and press Return:
1 | sudo tmutil listlocalsnapshots /Volumes/ |
This command will result in listing all available local snapshots in your disk. Altogether, using the example snapshot above, that results looks like:
com.apple.TimeMachine.2017-08-06-135235 com.apple.TimeMachine.2017-08-06-144934 com.apple.TimeMachine.2017-08-06-155536 com.apple.TimeMachine.2017-08-06-165258 com.apple.TimeMachine.2017-08-06-174932 com.apple.TimeMachine.2017-08-06-185716 com.apple.TimeMachine.2017-08-06-204931 com.apple.TimeMachine.2017-08-06-215316 com.apple.TimeMachine.2017-08-06-225146 com.apple.TimeMachine.2017-08-06-235231 com.apple.TimeMachine.2017-08-07-005046 com.apple.TimeMachine.2017-08-07-015616 com.apple.TimeMachine.2017-08-07-034929 com.apple.TimeMachine.2017-08-07-045816 com.apple.TimeMachine.2017-08-07-063105 |
Step 2. Delete local snapshots
Next, you need to manually delete each local snapshot based in there <snapshot_date>
.
123 | $ sudo tmutil deletelocalsnapshots 2017-08-06-185716$ sudo tmutil deletelocalsnapshots 2017-08-06-204931$ sudo tmutil deletelocalsnapshots 2017-08-06-215316 |
Delete All
123 | $ for d in $(tmutil listlocalsnapshotdates | grep "-"); do sudo tmutil deletelocalsnapshots $d; done |
Believe it or not, deleting local snapshots resulted in saving me around 140GB of data…
Note:
It requests for your Administrator password.