Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Polgs

macrumors newbie
Original poster
Dec 2, 2014
15
1
Australia
I have an external 4 TB HDD that I have formatted APFS encrypted. The password is on my keychain so it is easy to mount but if someone else tries to mount it on their system they will need to enter the password. That volume runs as expected, no issues.

On that HDD, I have created a sparsebundle formatted as HFS+ encrypted with 4 TB max size. This time the password is not on my keychain so the password needs to be entered every time it is mounted. (The reason for me choosing HFS+ instead of APFS is a long one and I can go into that if needed)

My problem is that after I mount the sparsebundle as a disk image volume, the free space on it is being reported incorrectly as being far smaller than actual, so I cannot use it.

  • ‘Finder’ -> ‘Get Info’ on the sparsebundle itself shows Size: 376 GB — correct
  • ‘Finder’ -> ‘Get Info’ on the disk image, after mounting it from the sparsebundle, shows Capacity: 4 TB and Used: 3.98 TB — incorrect

Terminal command, ‘diskutil info’ on the mounted disk image volume shows
Volume Total Space: 4.0 TB (3999656042496 Bytes) (exactly 7811828208 512-Byte-Units)
Volume Used Space: 4.0 TB (3985103577088 Bytes) (exactly 7783405424 512-Byte-Units) (99.6%)
Volume Free Space: 14.6 GB (14552465408 Bytes) (exactly 28422784 512-Byte-Units) (0.4%)

Terminal command ‘du’ on the volume says that the drive is 346G.
  • I have run Disk Utility First Aid on the volume and it runs without error.
  • I have stopped and started SpotLight on the volume to clear out any indexing errors that may have been there but no change to the free space reported.
  • I have run ‘hdiutil compact’ on the sparsebundle but only a very small amount of free space was recovered.
I’ve run out of ideas. Is there anything else that I could try?

Thanks…
 
I have an external 4 TB HDD that I have formatted APFS encrypted. The password is on my keychain so it is easy to mount but if someone else tries to mount it on their system they will need to enter the password. That volume runs as expected, no issues.

On that HDD, I have created a sparsebundle formatted as HFS+ encrypted with 4 TB max size. This time the password is not on my keychain so the password needs to be entered every time it is mounted. (The reason for me choosing HFS+ instead of APFS is a long one and I can go into that if needed)

My problem is that after I mount the sparsebundle as a disk image volume, the free space on it is being reported incorrectly as being far smaller than actual, so I cannot use it.

  • ‘Finder’ -> ‘Get Info’ on the sparsebundle itself shows Size: 376 GB — correct
  • ‘Finder’ -> ‘Get Info’ on the disk image, after mounting it from the sparsebundle, shows Capacity: 4 TB and Used: 3.98 TB — incorrect

Terminal command, ‘diskutil info’ on the mounted disk image volume shows
Volume Total Space: 4.0 TB (3999656042496 Bytes) (exactly 7811828208 512-Byte-Units)
Volume Used Space: 4.0 TB (3985103577088 Bytes) (exactly 7783405424 512-Byte-Units) (99.6%)
Volume Free Space: 14.6 GB (14552465408 Bytes) (exactly 28422784 512-Byte-Units) (0.4%)

Terminal command ‘du’ on the volume says that the drive is 346G.
  • I have run Disk Utility First Aid on the volume and it runs without error.
  • I have stopped and started SpotLight on the volume to clear out any indexing errors that may have been there but no change to the free space reported.
  • I have run ‘hdiutil compact’ on the sparsebundle but only a very small amount of free space was recovered.
I’ve run out of ideas. Is there anything else that I could try?

Thanks…
No help, but I just noticed the same thing when working with sparse images. Erasing the image did not restore the ‘free’ space. I haven’t checked other operating systems but I’ve never noticed the issue before starting to work with sparse images in Mojave. Are you able to boot to another OS and check the size there? My solution was to delete the sparse image and create a new one, but that may not work for you! My images were JHFS+, not encrypted
 
I remember similar issues when using Docker for Mac. https://docs.docker.com/docker-for-mac/faqs/#disk-usage

They had complaints that their raw APFS format was using massive amounts of disk space.

Docker.raw consumes an insane amount of disk space!
This is an illusion. Docker uses the raw format on Macs running the Apple Filesystem (APFS). APFS supports sparse files, which compress long runs of zeroes representing unused space. The output of ls is misleading, because it lists the logical size of the file rather than its physical size.

That link above shows you different ways to get disk usage stats that take sparse files into account and that DON'T take sparse files into account.

Perhaps that may help you?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.