%S fundamental block size (for block counts)
tells you how big each block is on the file system. On most file systems, this is the smallest amount of space any file can take up. Each file uses a multiple of this.
$ echo > a # create a file containing a single byte
$ du -h a # see how much disk space it's using
$ stat -f -c '%S' . # see what stat thinks the block size is
$ tune2fs -l /dev/mydrive | grep '^Block size'
I'm not 100% sure it always works like this. For example, I expect it could also decide to print
1024, even if the underlying block size is different, provided
stat -c %b FILE *
stat -f -c %S FILE =
du --block-size=1 FILE. The exact implementation would depend on the file system.
%s block size (for faster transfers)
suggests how many bytes you should read at a time if you're copying large files, for example what you should use as the
bs (blocksize) parameter when using
dd. But on the systems I checked, it always prints
4096, even where larger values might be faster. See Is there a way to determine the optimal value for the bs parameter to dd? for more discussion of that.
Technically, this information (and all the information from
stat -f) comes from the
statvfs system call.
%s corresponds to the
f_bsize field, and
So you could look into their precise meanings starting with the statvfs man page
unsigned long f_bsize; /* Filesystem block size */
unsigned long f_frsize; /* Fragment size */