0

I was cleaning up old directories on my 256GB MBPro SSD mounted on /dev/disk1.

At first

 df -k

was showing the expected increased in available disk space on that Filesystem. However for the last half dozen invocations of "rm -rf 0.1%) change. In fact the entire available disk space slightly decreased.

There is no other substantial work happening on the system - and the Virtual Memory size has not changed.

Now double digit GB of data is quite sizeable. I can not understand how "df -k" could miss / neglect these changes.

Note: I did confirm that the directories being removed by rm -rf are in fact gone. In any case it took minutes to perform those deletions - so it was obvious things were happening.

Here is output before all the "rm-rf"'s:

20:17:50/shared $df -k
Filesystem                        1024-blocks      Used Available Capacity  iused   ifree %iused  Mounted on
/dev/disk1                          243915264 217388008  26271256    90% 54411000 6567814   89%   /
devfs                                     200       200         0   100%      694       0  100%   /dev
map -hosts                                  0         0         0   100%        0       0  100%   /net
map auto_home                               0         0         0   100%        0       0  100%   /home
localhost:/5Lcoijnnqm-dLj_GeL3j-A   243915264 243915264         0   100%        0       0  100%   /Volumes/MobileBackups

Here is the output after all the "rm -rf"'s

20:27:28/shared $df -k
Filesystem                        1024-blocks      Used Available Capacity  iused   ifree %iused  Mounted on
/dev/disk1                          243915264 217450876  26208388    90% 54426717 6552097   89%   /
devfs                                     200       200         0   100%      694       0  100%   /dev
map -hosts                                  0         0         0   100%        0       0  100%   /net
map auto_home                               0         0         0   100%        0       0  100%   /home
localhost:/5Lcoijnnqm-dLj_GeL3j-A   243915264 243915264         0   100%        0       0  100%   /Volumes/MobileBackups

Here is the du of the parent directory of the ones being deleted before the rm's.

du -d 2 -k > out

Last line of out: 58446128  .

So we had 58GB under that parent dir

Here is the du on the parent dir after the rm's:

du -d 2 -k > out

Last line of out2: 36830744 .

So: du is working - showing 20GB less. But df is broken

But what does Finder say? Finder agrees with df !

enter image description here

BTW here is "Trash": shows it has been emptied so that is not the issue.

enter image description here

So then - why are the directories removed by rm -rf not being made available back to the O/S?

UPdate I have removed another 20GB for a total of 50GB yet still the same amount of disk space is reflected in both finder and df -k.

** Another update ** It appears that

sudo tmutil disablelocal

may have resolved this. Apparently time machine does local backups: and the deleted files do not really get removed until/unless it (lazily) decides to allow it. Notice it is now 62GB free.

enter image description here

  • Local snapshots are a useful feature, and you shouldn't disable them unless they're causing an actual problem. The fact that deleting files doesn't immediately free up disk space may be confusing, but as long as you understand what's going on (and realize that the space will automatically be released if/when it's needed for new files), this shouldn't be considered a problem. – Gordon Davisson Jul 5 '15 at 4:40
  • @GordonDavisson I have been running into disk space issues - so whatever algorithm being used it is not serving the purpose sufficiently - i.e. the space from the deleted files is not being made available in the "just in time" manner advertised.. I do need to disable the local backups. I will consider re-enabling in the future. – javadba Jul 5 '15 at 5:02

You must log in to answer this question.

Browse other questions tagged .