Greg Freemyer <greg.freemyer@xxxxxxxxx> wrote:
On 9/1/05, Satinder <jeet_sat12@xxxxxxxxxxx> wrote:HI all ,
I am checking the total throughput obtained from local SCSI disk when performing the I/O on it using 'dd' command.
My system configuration is as below
Hardware -> Intel(R) Xeon(TM) CPU 2.80GHz
OS -> Linux 2.6.9-5.18AXsmp
SCSI controller & disk -> AIC7902 Ultra320 SCSI adapter SEAGATE Model: ST336607LC
sdb disk is of size 34 GB.
I am checking the throughput using 'iostat' utility.
But for write case with low input/output block sizes (512B , 1KB )
Using
# dd if=/dev/zero of=/dev/sdb bs=BLOCK
Where BLOCK = 512, 1024
I am getting both readbyte/sec and writebyte/sec in output of iostat(though it is write case readbyte/sec should be 0)
obtained using
# iostat ?d sdb 5 100
for all data block sizes(e.g. 2K , 4K , 8K 16K) the results are normal.
When I partitioned the sdb disk as sdb1 and sdb2
and run the above test on partition sdb1 the results obtained from iostat are normal (readbyte/sec are 0)
but when run on partition sdb2 the results for low block size(512 byte,1 KByte ,2 KByte) are abnormal, getting both readbyte/sec and writebyte/sec output from iostat. and for all other write case (e.g 4k 8K ....) output of iostat is normal
If anyone could please clarify the cause of this abnormal behaviour.
Thanks in advance.
Regards,
Satinder
I've seen the same behavior with IDE disks and 2.6.8 kernels. (I don't think 2.4.x behaved this way, but I don't remember.)
I "assume" that at some level the block device drivers perform 4K writes to disk. If you are updating a smaller chunk than 4k, then the 4k block is read in, modified and read out.
To me it sounds like a bug, but I have just modified my scripts to use a 4k blocksize. I have not tried the smaller blocks with newer kernels since the workaround is sufficient for me.
OTOH, I like to know how many sectors I have written to a disk. This allows me to verify I have filled the entire disk with zeros (my typical goal).
Therefore, I use "dd if=/dev/zero of=/dev/hde ibs=512 obs=4k" most of the time.
dd then reports both number of input blocks and the number of output blocks. All I really look at is the number of input blocks.
HTHGreg
--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century---------------------------------------------------------------------------------------------------
Hi Gregthis is working fine by specifying the output block size obs=4k in ddbut why this odd behaviour (read and write IO from dd even when writing to device with block size 512,1k,2k) did not obtain with partition sdb1 case but with partition sdb2 ?and when I am using whole raw disk 'sdb' then this behaviour is seen only with 512,1k write , not with 2k write.Satinder
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com