format a SSD to exFAT with 4K allocation unit size

I am trying to format a SSD with to GPT exFAT with 4K allocation unit size. I used both diskutil and newfs_exfat. The diskutil is used to partition the disk to GPT exFAT but with the default 0.5K allocation unit size, and the newfs_exfat is used to reformat the partition with 4K allocation unit size. The following is a list of the commands I used:

diskutil partitionDisk disk4 GPT exfat MyPartitionName R
diskutil unmount disk4s2
newfs_exfat -R -v MyPartitionName -b 4096 /dev/disk4s2
diskutil mount MyPartitionName


Then, I checked the allocation unit size by using diskutil and newfs_exfat

diskutil info disk4s2 | grep "Block Size"

which gives

Device Block Size: 512 Bytes
Allocation Block Size: 512 Bytes


However, when I check the allocation unit size by

newfs_exfat -N disk4s2 | grep "Bytes"

which gives:

Bytes per sector : 512
Bytes per cluster : 4096



Can any one advise me which one ("Allocation Block Size" or "Bytes per cluster") represents the true allocation unit size?

Did I successfully format my SSD with 4K allocation unit size?

What's the difference between the "Allocation Block Size" and "Bytes per cluster"?

If I didn't format my SSD with 4K allocation unit size, can any one guide me to do it successfully?

MacBook Pro 14″, macOS 14.1

Posted on Dec 1, 2023 7:27 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 4, 2023 7:31 PM

tli_MTone wrote:

Hello HWTech,

Thanks for your answer.

I checked the allocation unit size to be 4K for my SSD formatted by the above-listed commands by saving a file of 1K which shows 4K on disk. I think I made what I wanted, but I am still curious why the value for "Allocation block size" and "Bytes per cluster" is different. Are they essentially different or maybe just the diskutil cannot show the correct "Allocation block size" correctly for the exFAT format?

When I did various tests creating exFAT file systems, the "Bytes per cluster" is what Apple shows in the report when creating the exFAT file system using the command you provided (or even with the "-c" option) or with the Disk Utility GUI.


When viewing the information for the mounted exFAT file system, macOS doesn't show "Bytes per cluster", but instead "Allocation Block Size" and it always has the same value as "Bytes per cluster" when creating the file system. I believe they are just two different ways Apple is displaying the same information. Keep in mind two different utilities are being used here.....newfs_exfat and diskutil. I'm sure different developers work on them and did not communicate with one another to standardize on proper labels.


Apple isn't known for being consistent in the information they provide, nor are they good about documentation.


I don't have any special reason for making the "Bytes per cluster" = 4K, just feel the default "Bytes per cluster" = 0.5K is a little bit small and may decrease the speed of the SSD. But I am not sure if that is a correct assumption. Welcome to correct me if you know I am wrong about it.

Any adjustments to any of these values when creating the file system will have an impact both positive & negative on performance. It all depends on the size of the files you are dealing with on the drive. Most times people are dealing with all sorts of file sizes which is why operating systems usually decide on a good compromise. Plus the overall size of the drive being used can affect which options should be used as well. Unless you know for sure that you are only dealing with very specific file sizes, then it is best to stay with the defaults.


Unfortunately Apple is not showing all of the associated values to us and even the values they show us are called different things depending on the utility being used. You may need to find a better utility to view those values, or a different OS. While I am curious, unfortunately I don't have the time to do a proper experiment on understanding these relationships as it would require me to experiment on Linux and even Windows to get a feel for how other systems provide for the different configurations and to confirm the names of various values and find their macOS equivalents. My quick macOS experiment only told me Apple is not consistent with their various utilities.

7 replies
Question marked as Top-ranking reply

Dec 4, 2023 7:31 PM in response to tli_MTone

tli_MTone wrote:

Hello HWTech,

Thanks for your answer.

I checked the allocation unit size to be 4K for my SSD formatted by the above-listed commands by saving a file of 1K which shows 4K on disk. I think I made what I wanted, but I am still curious why the value for "Allocation block size" and "Bytes per cluster" is different. Are they essentially different or maybe just the diskutil cannot show the correct "Allocation block size" correctly for the exFAT format?

When I did various tests creating exFAT file systems, the "Bytes per cluster" is what Apple shows in the report when creating the exFAT file system using the command you provided (or even with the "-c" option) or with the Disk Utility GUI.


When viewing the information for the mounted exFAT file system, macOS doesn't show "Bytes per cluster", but instead "Allocation Block Size" and it always has the same value as "Bytes per cluster" when creating the file system. I believe they are just two different ways Apple is displaying the same information. Keep in mind two different utilities are being used here.....newfs_exfat and diskutil. I'm sure different developers work on them and did not communicate with one another to standardize on proper labels.


Apple isn't known for being consistent in the information they provide, nor are they good about documentation.


I don't have any special reason for making the "Bytes per cluster" = 4K, just feel the default "Bytes per cluster" = 0.5K is a little bit small and may decrease the speed of the SSD. But I am not sure if that is a correct assumption. Welcome to correct me if you know I am wrong about it.

Any adjustments to any of these values when creating the file system will have an impact both positive & negative on performance. It all depends on the size of the files you are dealing with on the drive. Most times people are dealing with all sorts of file sizes which is why operating systems usually decide on a good compromise. Plus the overall size of the drive being used can affect which options should be used as well. Unless you know for sure that you are only dealing with very specific file sizes, then it is best to stay with the defaults.


Unfortunately Apple is not showing all of the associated values to us and even the values they show us are called different things depending on the utility being used. You may need to find a better utility to view those values, or a different OS. While I am curious, unfortunately I don't have the time to do a proper experiment on understanding these relationships as it would require me to experiment on Linux and even Windows to get a feel for how other systems provide for the different configurations and to confirm the names of various values and find their macOS equivalents. My quick macOS experiment only told me Apple is not consistent with their various utilities.

Dec 3, 2023 8:05 PM in response to tli_MTone

From some quick experimentation it appears both "Allocation Block Size" and "Bytes per cluster" are the same thing. If you look at the information displayed when creating the exFAT volume, you will see it references "Bytes per Cluster" while viewing the information using the "diskutil info" command results in the value identified as "Allocation Block Size".


From my very quick & short experimentation, I believe the command you used is what you want for 4K file allocation size. Using the " -c 8 " option also appears to give the same end results. I don't know if it matters which one is used or if there may be some other slight difference which is not shown in any of the macOS utilities.


I haven't worked with file systems like this for years (probably only did so back in WinXP days) and I rarely had any reason to deviate from system defaults.

Dec 5, 2023 9:44 PM in response to HWTech

Thanks for your reply, HWTech.

HWTech wrote:

When viewing the information for the mounted exFAT file system, macOS doesn't show "Bytes per cluster", but instead "Allocation Block Size" and it always has the same value as "Bytes per cluster" when creating the file system. I believe they are just two different ways Apple is displaying the same information. Keep in mind two different utilities are being used here.....newfs_exfat and diskutil. I'm sure different developers work on them and did not communicate with one another to standardize on proper labels.

If you refer back to my original post, you can see the different values for "Allocation Block Size" and "Bytes per cluster". These two values are for the same formatted SSD and printed within 10s.


I am satisfied with the way to format the SSD since I can make it as I expected, but I still feel there may be some difference between the two terminology "Allocation Block Size" and "Bytes per cluster" or maybe the diskutil cannot show the allocation unit size of exFAT correctly.

Dec 4, 2023 6:55 PM in response to HWTech

Hello HWTech,


Thanks for your answer.


I checked the allocation unit size to be 4K for my SSD formatted by the above-listed commands by saving a file of 1K which shows 4K on disk. I think I made what I wanted, but I am still curious why the value for "Allocation block size" and "Bytes per cluster" is different. Are they essentially different or maybe just the diskutil cannot show the correct "Allocation block size" correctly for the exFAT format?


I don't have any special reason for making the "Bytes per cluster" = 4K, just feel the default "Bytes per cluster" = 0.5K is a little bit small and may decrease the speed of the SSD. But I am not sure if that is a correct assumption. Welcome to correct me if you know I am wrong about it.

Dec 5, 2023 12:23 AM in response to tli_MTone

So you had no trouble using that 4K allocation unit size exFAT volume on the Mac, right?


I am asking because I have heard that at least older macOS was picky about this, and 128 kB allocation unit size should be used if exFAT is used on a Mac.


Windows seems to set the default depending on the volume size with 4-32-128 kB steps:


https://support.microsoft.com/en-us/topic/default-cluster-size-for-ntfs-fat-and-exfat-9772e6f1-e31a-00d7-e18f-73169155af95

Dec 5, 2023 9:47 PM in response to Matti Haveri

Yes, Matti. I have tested formatting my SSD with 4 kB allocation unit size and transferred files to it. I didn't encounter any problems for now. Although the default allocation unit size for exFAT, if you format your SSD on Mac, will be 0.5 kB.


I know windows has very different default values on allocation unit size. Typically, the default values of allocation unit size in Windows system are larger than them in MacOS if you format your disk using the default utilities.

Dec 7, 2023 4:27 PM in response to tli_MTone

tli_MTone wrote:

I am satisfied with the way to format the SSD since I can make it as I expected, but I still feel there may be some difference between the two terminology "Allocation Block Size" and "Bytes per cluster" or maybe the diskutil cannot show the allocation unit size of exFAT correctly.

Certainly possible. I personally would rather view the file system information from a third party utility which is known to properly report that information.


As @Matti Haveri mentioned, you do need to be careful that the values chosen will be stable & reliable with macOS and especially if you want to share the drive with another OS (perhaps an even older version of macOS). I have seen multiple reports where macOS refuses to mount some exFAT drives which have been formatted on Windows. In fact, from my research it seems best to create an exFAT volume using macOS to maximize the chances of compatibility between systems although there are also some reports of Windows not likely a macOS exFAT formatted drive as well.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

format a SSD to exFAT with 4K allocation unit size

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.