Skip to contentSkip to conversation

File size and block size

DISCUSSION Anthony Chee 1 participant 1 message Apr 17, 2002 VFS

lore
Share & tools
lore
#0 lore raw

Dear all,

The block size of my disk partition is 1024. I did the following
test,

1. Copy a file with 3312 bytes to the target disk, it should occupy
3312/1024 = 3.2 = 4 blocks by calculation. And I use "df" to check that it also occupy 4 blocks

2. Copy a file with 34024 bytes to the target disk, it should occupy
34024/1024 = 33.2 = 34 blocks. But I found that it occupied 35 blocks

3. Copy a file with 5693440 bytes to the target disk, it should
occupy 5693440/1024 = 5560 blocks. But it is shown that it occupied 5573 blocks by using "df"

Why there is a difference by calculation and using "df"? How to
check that what is the actual number of blocks that a file will occupy before copying?

Thanks,
Regards,
Anthony