Physical disk IO size smaller than fragment block filesystem size ?

Hello,
in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a disk with sector=512B), all "physical disk IO" it will allways, like "Filesystem IO", greater than 1K.

But with dtrace script from DTrace Toolkit (bitesize.d) I can see IOs with 512B size.

�What is wrong in my assumptions or what is the explanation?

Thank you very much in advance!!

Suppose you open a file and write one byte to the file. You close the file. close() is required to update filesystem metadata, and sync the data in the file.

open() already allocated the minimum number of blocks specified as a filesystem parameter for minimum blocks per file/inode.

Those i/o's are very likely metadata (inode and directory) updates. What else is there left to do?

Hi Jim! Thanks for your time.

I'm not sure to understand you well. When you say "blocks" in your post, are you speaking about physical (disk) blocks (sectors)?

If the answer to the above question is yes then, reading your answer, everything I have said in the first post is correct but I have not taken account FS metadata, access to which is not governed by the blocksize/fragmentsize. Right?

Than you very much!

A block is still (on most FS) refers to 4K of data only.

On most system the page-cache is still of this fix sizes. Hence on all block I/O is of 4K or less. The file systems on such system utilizes the maximum size which is 4k.

However, if you see the disk architecture, they have been under trial by various vendors with various sector sizes; with 512bytes sector disk supported by most of the File system and storage product vendors (they however support various other size disks too -but 512b sector disk is in most common use probably because windows/DOS/UNIX FS supported them).

In order to support various disk architecture and FS supporting them use fragmentation which of course let you divide the 4k of page size into various fragments of 1, 2, ... 8 fragments per page.

8-fragments per page is the lowest value which translate into the size of a sector. You can of course not use a sector half of it. For I/O of 1 to full 512 byte of data a full sector gets used in one disk write.

Can you post here the steps you used to test this figures :
1) On UFS, how you saw the fragment size of 1 KB?
2) How did you looked at the 512kb I/O ?

Hello Praveen,
I'm not sure if you are mixing FS layer and phisical (disk driver) layer. I was speaking about FS layer (and block device driver layer) in my first post.

mcnamara answer was right.

1) fstype
2) dtrace script from DTrace Toolkit (bitesize.d)