-   Linux - General (
-   -   Storage unit and IO unit (

salmanucit 06-16-2008 03:59 AM

Storage unit and IO unit
I have two questions if some one could help me find out for my red had advance server 4.
1. How could i find out the storage unit of my Linux. I mean operating system block size.
2. How could i find out that what is the unit of I/O on my Linux system. I mean, when data is requested from the disk for read, how much data is read in one I/O. How do we set it at OS level?


stefan_nicolau 06-17-2008 07:05 PM

1. If you mean filesystem block size, you can get that on a per-filesystem basis. For ext2/3, use tune2fs -l /dev/XXX|grep "Block size"

2. I suspect the answer depends on what exactly you mean by "one I/O" and on the hardware you are using. A good place to start looking would be in the source code for your hard drive controller. Note that the size of one transfer isn't fixed. It may be anywhere between 0 and a max limit imposed by your hardware.

I would be interested in hearing from someone more knowledgeable on this aspect.

syg00 06-17-2008 11:11 PM

Unless you are doing direct I/O the concept of "blocksize" is a bit nebulous.
Regardless of what you (as handled by the fs driver) request, the I/O schedulers are designed to consolidate (and sort) the physical I/Os to optimize hard disk usage.
To all intents and purposes I/O is handled as a convenient (to the VFS) multiple of sector size - generally 512 Bytes.
Then the physical bits (the card and device itself) may well get in on the act - especially for large (on-board) caches or any sort of RAID. Who knows what they do to the actual (physical) I/Os.

All times are GMT -5. The time now is 06:49 AM.