78

I had approximately 50Gb of Windows VMs on my MacBook Pro internal SSD (128Gb) (OS X 10.7.3).

I copied them to an external drive, then deleted them from the internal drive, then emptied the Trash.

When I look at disk usage in Activity Monitor it shows the same level of usage as it did prior to deleting 50Gb of files.

Any ideas why the space hasn't been freed up?

3
  • How long have you waited until you rechecked the available space?
    – gentmatt
    Mar 18, 2012 at 6:34
  • 1
    Do you use Time Machine? Mar 18, 2012 at 11:41
  • 2
    Be extremely careful with the rm -rf command, as typing sudo rm -f will delete EVERY file on your system and all connected volumes! Speaking from experience with making a typo with a similar line
    – Ryan
    Nov 12, 2017 at 22:20

15 Answers 15

56

The answer relates to changes to Time Machine backups in Lion.

My understanding is that when a TM back up is attempted when the back up disk is not connected, a back up is made in /Volumes/MobileBackups.

These back ups do not go away the next time TM runs with the back up disk connected. I am not sure if the OS will eventually reclaim this space.

You can disable the local back ups by running one of the following commands (depending on your version of Mac OS):

sudo tmutil disable localsnapshot

# for older versions:
sudo tmutil disablelocal

After you run this command /Volumes/MobileBackups is deleted.

I'm sure there is a good reason for the local backups and I don't necessarily recommend disabling them, but they were - in combination with some large deleted folders - the cause of disk space appearing to be still in use.

You can re-enable mobile backups by running:

sudo tmutil enablelocal

More info here - http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars/18

6
  • When mobile backups are on, does the disk space taken ever get freed (e.g. when it can be written on an external drive)? Or does it stay permanently?
    – Szabolcs
    Aug 8, 2013 at 15:07
  • 2
    I think it's worth noting that (at least in certain cases, it worked for me), just disabling Time Machine by flipping the big switch in TM preferences will free up that space. I started a backup that didn't finish, and only when I disabled TM entirely did I get my 50+ GB back. Nov 26, 2015 at 5:20
  • 2
    THis doesn't go the point of why deleting 50GB of files unrelated to TM backups is not freeing up Drive space. I have same problem as OP. Apr 23, 2017 at 18:08
  • 4
    $ sudo tmutil disablelocal disablelocal: Unrecognized verb.
    – gies0r
    Nov 12, 2019 at 12:58
  • "I am not sure if the OS will eventually reclaim this space." It did for me. When I ran into this issue most recently, I attached my Time Machine drive and left it there for a day or two. The space was eventually reclaimed.
    – twm
    Oct 28, 2021 at 16:45
46

On Mojave 10.14.4 I was able to reclaim 50GB of space with:

sh-3.2# tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-04-03-103122
sh-3.2# tmutil deletelocalsnapshots 2019-04-03-103122
Deleted local snapshot '2019-04-03-103122'

Local snapshots are typically created during Time Machine automatic backups. It is not clear why this local snapshot was created, because automatic backups are disabled on my Mac Book. One possibility is that Mojave upgrade automatically made that snapshot.

4
  • I've got a list of about 25 of these, so thanks for this insight! Now... is there an easier way to delete them all than typing out the date in the file name individually for every one? Jul 28, 2020 at 0:41
  • 5
    @GreatBlakes, this should remove all local snapshots for you.. for SNAPSHOT in $(tmutil listlocalsnapshots / | egrep '[0-9]{4}\-[0-9]{2}\-[0-9]{2}\-[0-9]{6}' -o | tail -r); do tmutil deletelocalsnapshots $SNAPSHOT; done
    – Molomby
    Aug 15, 2020 at 8:01
  • Just regained about 120GB of storage... was showing up as "Purgeable space" on Disk Utility. Nov 29, 2021 at 14:05
  • This worked great for me, whereas the top suggestion did not delete any snapshots. Thanks!
    – Joe B
    May 2 at 18:49
17

On High Sierra the command will be: sudo tmutil disable localsnapshot.

1
  • Will this affect future backups to my TimeMachine disk? Nov 29, 2021 at 14:05
8

Launch the app System Information.

Then select Window > Storage Management.

This will launch a utility designed for managing and observing storage.

Critically, this screen seems to refresh the system disk space calculations. The free space shown in Disk Utility immediately went down.

https://support.apple.com/en-us/HT206996

Storage Management

2
  • 4
    As of Catalina, the easiest way to launch this util is Apple > About this Mac > Storage > Manage. Opening it didn't help me reclaim my missing space, however Sep 24, 2020 at 7:24
  • 1
    Although this does correctly calculate free space, for me this approach did not refresh Finder with the correct amount of space available, so I could still not perform an action I was trying to complete as it claimed I did not have enough space despite freeing a few hundred GB more space than it needed... Nov 6, 2020 at 23:48
4

Just switching off Time Machine in Time Machine Preferences (and switching it back on) fixed the problem for me.

3

Sometimes the deleted content gets held in the .Trashes folder in the root directory. From the Terminal you can cd /.Trashes and see if any of your deleted files are still in the Trash. You can then remove them via sudo rm -rf someFolderName.

Caution: this is a rather advanced user operation so be careful what you type and what exactly you remove since rm is permanent and can't be undone.

2

If you look the free disk space from finder it will not include the backups on space used. That is because backups will be deleted if more space is needed by other apps. What I do to keep the mobile backups working without taking much space, is disabling and enabling the time machine once per week (from TM prefs). When you disable it the local backups are deleted.

I guess it wouldn't make much difference to just let the drive get full and then automatically delete backups as needed (maybe slightly slower performance?).

2

If you delete a file, as long as some application has a hold on it the file will not be freed from the filesystem. That's why you can play a movie and delete it while playing and still watch it until the end, presuming you don't pause it (which may even work too).

This is also perhaps why Time Machine related answers are popping up. If Time Machine is in the process of backing up your jumbo file that will take a good long while, and until it finishes the file will not be deleted from the system. You can "Skip backup" to resolve the problem immediately.

2
  • I manually deleted a mysql ibdata1 and restarting the mysql server solved the issue. Thanks.
    – maxm
    Jun 3, 2016 at 20:54
  • 1
    nah. I'm deleting DMG files 5 GB and not mounted and no freed disk space at all. and a bunch of other files. OS X is doing something weird here I'm sure of it. Apr 23, 2017 at 18:11
2

This happened to me on Mojave, specifically with an APFS-formatted 512GB SSD with an extra volume besides the main one. After deleting many GB of files, almost no space would be freed. I don’t use Time Machine, and the handful of local snapshots I somehow had weren’t very large. Several other solutions also didn’t work.

What worked for me was repeatedly adding and deleting a volume reserving nearly all the “available” space, which appeared to trigger updates to the APFS free space calculations. Note that this method only applies to APFS-formatted drives which use volumes rather than true partitions (and I suspect the problem is caused by some bug in APFS).

Disclaimer: while this seemed to work for me without issues, it’s messing with fundamental parts of the system in a non-reversible way, and should be a last resort (also might not recommend for less technical users). Please do a full backup to an external drive before trying this.

  1. Open Disk Utility
  2. Select your main hard drive volume and take a note of the claimed available space
  3. Click the + Volume button in the toolbar
  4. Set the new volume’s reserved space to slightly under the supposed “available” amount of space (the max space and name don’t matter) and save
  5. Select the new volume (double checking you’ve selected the right one!) and click - Volume in the toolbar to delete it.
  6. Select your main volume again and you will probably see the “available” space has increased. Repeat the whole process several times until you no longer see space increases.

Not sure if this was necessary but after completing this process, I ran disk first aid on the APFS container itself and the individual volumes.

1
  • It worked for me on Catalina with an APFS (encrypted) volume.
    – Max Oriola
    Jun 25, 2021 at 18:14
2

I not only had to remove TimeMachine local snapshots, but also thin local backups:

I found a date in /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MacbookPro

Then I did:

tmutil thinlocalsnapshots / 2021-10-27-121106 4

The command returns

Thinned local snapshots:
com_haystacksoftware_arqagent_12A...

I got 5 GB back after this.

I found the following explanation[1]:

If you are using macOS 10.13+ and the APFS file system, then the files you deleted may still exist within an APFS snapshot. These APFS snapshots are used by macOS and various backup utilities like Time Machine. Many of these APFS snapshots will be automatically deleted after about a week or after TM sends the backup to the external TM drive.

You can examine the current APFS snapshots and try to thin or even delete them using this article as a guide https://derflounder.wordpress.com/2018/04/07/reclaiming-drive-space-by-thinning-apple-file-system-snapshot-backups/

References:

  1. https://discussions.apple.com/thread/252030187
1

First try to restart your mac, then run the Disk Utility app. It will re-calculate your HD available space and show the correct numbers on Finder immediately

1
  • None of the other recommendations worked. Restarting seems to have triggered a background process that took a few minutes to run and eventually the actual free space was listed. Jun 7, 2020 at 23:04
1

This happened to me on Mac OS Catalina. I copied ~100GB from internal HD to external HD, deleted the 100GB on the internal HD. I allowed Time Machine to back up everything (internal and external). Still, the Finder shows no change in available disk space.

What worked:

  • I went to Apple Menu -> About This Mac.
  • I selected the "Storage" tab.
  • It calculated for a while, and kept increasing the available disk space until the numbers were correct.

Unfortunately, the Finder was a bit "more right", but still off by quite a bit, even after several hours. After a while I rebooted (for an unrelated event), and when it came back the Finder was correct.

1

I had a problem with similar symptoms. I deleted many GB and df -h showed no increase.

It turned up that this was due to Purgeable storage/Optimized storage feature in macOS (files that macOS deems suitable for removal). One can check it's size in Disk Utility by clicking on Info (it shows both Purgeable space and Free space). Both of these can be used for new files - system does delete those purgeable when needed.

1
  • It may a coincidence, but when I opened up Disk Utility and clicked on the "- Data" volume", it showed the disk spaced used by "Other volumes" dropping, then the df started showing the 88GB removed. A reboot hadn't cleared it after emptying trash. There was no /.Trashes or /Volumes/MobileBackups in my case. MacOS 10.15.6. It may be what @Abhi Beckert mentioned in a comment on another answer that it was a background process kicked off after rebooot. Jan 19, 2021 at 1:55
0

Had the same problem on MacBook Pro mid 2014. Did backups - nothing. FirstAid reported problems, repaired via Recovery, still space not claimed. Reinstalled MacOS via Recovery - free space increased from 24 to 120 GB. TaDa. Happy.

0

If you have discovered that the issue is caused by snapshots as mentinoned in the other answers, and you use Carbon Copy Cloner, you can click on your volume in the sidebar on the left, then right-click on the snapshot and choose Delete from the contextual menu.

Carbon Copy Cloner v5.1.28 window

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .