How can the block count in an inode differ from the (file size / block size) rounded up to
the nearest integer. Can the block count be greater, smaller, or both
Answer:
-Block count frequently differs from file size. File size is the offset of the highest byte written, and is what you commonly notice in files that you deal with everyday. Block count is a count of the number of physical disk blocks that are used by the file. In the example of a sparsely populated file, such as a BitTorrent download of a 700 MB Linux ISO – it uses up '700 MB' on your system at the beginning, long
before the actual 700 MB of the file's contents are actually written to your disk blocks. However, most files are non sparse and disk block usage should be equal to file size. In reality, disk block usage is actually a little higher, as there are additional blocks (metadata, etc) not considered in the file size.
Therefore disk block count can differ in any way from the file size, or even be equal with the right tradeoff between sparsity and additional block usage.