Edit: doesn't seem tied to large drives, but an APFS-specific problem. See bottom.
----
So, I'm trying to create backup of folder on a server volume to an external 14TB APFS-formatted hard drive.
The folder reports on the server as being 12TB in size. However, when copying to the 14TB drive, it doesn't fit.
I compared the folders that where already copied, to the source folders on the server. The folders reported as being the same size, but the 'on disk' part for some folders was larger than on the server (for example, a folder on the server reported as '512.846.824 bytes (512,9 MB on disk)' but on the 14TB drive as 512.846.824 bytes (551,6 MB on disk))
I checked the files in this folder, and indeed, some files took way more disk space than their actual size. One psd file was 68.253.265 bytes (68,3 MB on disk) on the server, but its copy on the 14TB drive was 68.253.265 bytes (84,9 MB on disk). A difference of over 16MB!
I thought: maybe the block size on the 14TB drive is too large, so when a file is just a bit larger than an exact number of blocks, it takes a whole extra block for just a bit of data. Although this would mean something like a 16MB block size, which didn't seem plausible.
But just for testing, I created a single 1MB file with 'dd if=/dev/random of=testfile.bin bs=1m count=1'. If block size was the problem, it would report as 16MB instead of 1MB.
Inspected the file, and it reported as 1.048.576 bytes (1 MB on disk). So this seemed okay.
Next I tried increasing the size of the testfile by changing the count in the dd command.
Up until 65 this was ok. This file reported as 68.157.440 bytes (68,2 MB in disk).
At 66 it changed. Now the file suddenly was 69.206.016 bytes (84,9 MB on disk)
To check if it was an OS or APFS thing, I copied this file to the internal drive of this mac (alsof APFS formatted). There it correctly reported as being 69.206.016 bytes (69,2 MB on disk)
So...any idea what is happening here? Is there something wrong with APFS on large drives? Or is this 'by design'?
This is on a late 2014 Mac Mini running Catalina 10.15.7.
----
Edit: This just got weirder. I did some more tests on my own macbook (M1 Air running 12.6):
If I create a clean, new 66MB file with 'dd if=/dev/random of=testfile.bin bs=1m count=66' on my internal ssd, it shows correctly in Finder info as '69.206.016 bytes (69,2 MB on disk)'.
If I overwrite this file with the same command ''dd if=/dev/random of=testfile.bin bs=1m count=66', it incorrectly shows as '69.206.016 bytes (84,9 MB on disk)'.
So it seems that for new, clean files everything is ok, but I you overwrite or append to a file, it's not.
Even weirder: when I duplicate this file, the duplicate shows correctly using 69,2MB on disk.
Does anyone here have an explanation for this behaviour? Or is able to confirm this?
----
So, I'm trying to create backup of folder on a server volume to an external 14TB APFS-formatted hard drive.
The folder reports on the server as being 12TB in size. However, when copying to the 14TB drive, it doesn't fit.
I compared the folders that where already copied, to the source folders on the server. The folders reported as being the same size, but the 'on disk' part for some folders was larger than on the server (for example, a folder on the server reported as '512.846.824 bytes (512,9 MB on disk)' but on the 14TB drive as 512.846.824 bytes (551,6 MB on disk))
I checked the files in this folder, and indeed, some files took way more disk space than their actual size. One psd file was 68.253.265 bytes (68,3 MB on disk) on the server, but its copy on the 14TB drive was 68.253.265 bytes (84,9 MB on disk). A difference of over 16MB!
I thought: maybe the block size on the 14TB drive is too large, so when a file is just a bit larger than an exact number of blocks, it takes a whole extra block for just a bit of data. Although this would mean something like a 16MB block size, which didn't seem plausible.
But just for testing, I created a single 1MB file with 'dd if=/dev/random of=testfile.bin bs=1m count=1'. If block size was the problem, it would report as 16MB instead of 1MB.
Inspected the file, and it reported as 1.048.576 bytes (1 MB on disk). So this seemed okay.
Next I tried increasing the size of the testfile by changing the count in the dd command.
Up until 65 this was ok. This file reported as 68.157.440 bytes (68,2 MB in disk).
At 66 it changed. Now the file suddenly was 69.206.016 bytes (84,9 MB on disk)
To check if it was an OS or APFS thing, I copied this file to the internal drive of this mac (alsof APFS formatted). There it correctly reported as being 69.206.016 bytes (69,2 MB on disk)
So...any idea what is happening here? Is there something wrong with APFS on large drives? Or is this 'by design'?
This is on a late 2014 Mac Mini running Catalina 10.15.7.
----
Edit: This just got weirder. I did some more tests on my own macbook (M1 Air running 12.6):
If I create a clean, new 66MB file with 'dd if=/dev/random of=testfile.bin bs=1m count=66' on my internal ssd, it shows correctly in Finder info as '69.206.016 bytes (69,2 MB on disk)'.
If I overwrite this file with the same command ''dd if=/dev/random of=testfile.bin bs=1m count=66', it incorrectly shows as '69.206.016 bytes (84,9 MB on disk)'.
So it seems that for new, clean files everything is ok, but I you overwrite or append to a file, it's not.
Even weirder: when I duplicate this file, the duplicate shows correctly using 69,2MB on disk.
Does anyone here have an explanation for this behaviour? Or is able to confirm this?
Last edited: