3

Since switching to APFS I noticed that df delivers strange results.

For example:

$ df -h /
Filesystem     Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1  466Gi  401Gi   62Gi    87% 3165852 9223372036851609955    0%   /

It seems that I have only 62GB free (disk at 87%)

"About this Mac" gives a completely different picture

enter image description here

With 177 GB free.

Which is more reliable? Is df still working on AFPS?

1

I don't think this is a question of "reliability", it is simply that the two programs display different things. "Free space" sounds simple, but in reality it is quite complex - different people, different systems, etc. all consider "free space" to be different things.

For example "free space" could mean "how much of the disk space is not currently used for any meaningful data", or it could mean "how much more data can I store here" or something completely different.

The "About this Mac" tries to take the latter approach. If I add more things to this disk, how much can I really add. Technically it involves the calculation taking into account things that are temporary in nature. Often the largest differences here comes from local TimeMachine snapshots (they're created on the source volume, not the backup disk). These are temporary and will be removed automatically.

In contrast, df takes a very "technical" approach and shows the "raw" file system information according to how much of the disk space isn't used for anything meaningful. I.e. even for example temporary TimeMachine snapshots are included in "used" as they're actually storing useful data.

  • But this was not the case with HPS, and about my mac is also showing the space for backups (if the case). – Matteo Mar 1 at 17:05
  • HFS+ does not have snapshots, therefore there's a big difference. Time Machine simply works in a different way altogether when the underlying filesystem is APFS. On HFS+ Time Machine works in a very complex way using event listeners, etc. to store files in a hidden .MobileBackup folder that constitutes differences between the latest backup stored on the backup drive, and what has happened since on the local computer. With APFS this is much simpler and faster, as Time Machine simply creates snapshots of the file system every hour. – jksoegaard Mar 1 at 21:15
  • These snapshots are not visible (i.e. you cannot browse the files without mounting) contrary to the .MobileBackup folder. Nor do they have a constant size like the .MobileBackup folder - initially they will take up almost space, but if files are changed on the source drive (i.e. not by Time Machine), then it will take up more or more space as time passes. – jksoegaard Mar 1 at 21:17
  • Apple specifically documents that : "Your Mac counts the space used by snapshots as available storage. Even so, Time Machine stores snapshots only on disks that have plenty of free space, and it automatically deletes snapshots as they age or as space is needed for other things." – jksoegaard Mar 1 at 21:17
  • So About My Mac is not showing the space for these backups. That's part of the reason why you see a difference. – jksoegaard Mar 1 at 21:18

You must log in to answer this question.

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