MacOS Sonoma is returning different values for the statfs() structure members compared to Ventura for the same HDD.

We would like to get the cluster/block size and the same is different in Sonoma and Ventura for same HDD.
Volume info(statfs) retrieved through statfs() API and f_bsize=524288 in case of Ventura and 512 in case of Sonoma.

HDD is formatted using newfs_exfat -b 524288 diskname. The below mentioned details after formatting are same in case of both Sonoma and Ventura.

Volume name : UTR Partition offset : 411648 sectors (210763776 bytes) Volume size : 976361472 sectors (499897073664 bytes) Bytes per sector : 512 Bytes per cluster : 524288 FAT offset : 2048 sectors (1048576 bytes)

FAT sectors : 8192

Number of FATs : 1 Cluster offset : 10240 sectors (5242880 bytes)

Clusters : 953468

Volume Serial # : 65bb3bc0 Bitmap start : 2 Bitmap file size : 119184 Upcase start : 3 Upcase file size : 5836 Root start : 4

But statfs structure members in both the OS are different. Please find more details of statfs structure below in both Sonoma and Ventura.

In Ventura - -------f_bsize=-------------524288 -------f_iosize=-------------524288 -------f_blocks=-----------------953468 -------f_bfree=-----------------953380 -------f_bavail=-----------------953380 -------f_files=-----------------953468 -------f_ffree=-----------------953380 Here f_bsize is returning the expected value for the cluster size.

In Sonoma - -------f_bsize=-------------512 -------f_iosize=-------------1048576 -------f_blocks=-----------------976352256 -------f_bfree=-----------------976267264 -------f_bavail=-----------------976267264 -------f_files=-----------------1 -------f_ffree=-----------------0 The same f_bsize is returning a different value for cluster size in case of Sonoma.

We would like to get cluster size properly in all Mac OS. If anyone has faced a similar issue please share your suggestions.

MacOS Sonoma is returning different values for the statfs() structure members compared to Ventura for the same HDD.
 
 
Q