The f_getfree gets number of the free clusters.
FRESULT f_getfree ( DWORD* Clusters // Pointer to the variable to store number of free clusters. );
The f_getfree gets number of free clusters on the drive. The FatFs.sects_clust is indicating number of sectors per cluster, so that the free space in unit of byte can be calcurated with this. This function is not supported in read-only configuration and minimization level of >= 1.
DWORD clust;
// Get free clusters
res = f_getfree(&clust);
if (res) die(res);
// Get free bytes
printf("%lu bytes available on the disk.\n", clust * FatFs->sects_clust * 512);