# HelpSystems,LLC has written disk_trace.sh script using information in this email.

Good morning Randy,

https://www.linkedin.com/in/farnaz-toussi-10787279/

Below is the instructions for collecting Linux I/O traces. We are primarily interested in I/O traffic directed to devices under the same host SCSI. The trace file size of 5 to 10 GB will generate long enough traces for our studies, but if this is too big we'll be happy to get smaller trace files. 

Please let me know if you have any questions.
----------------------------------------------------------------------------------------

If blktrace is not installed run the following command to install it 

yum install blktrace

before running blktrace  run the following command

mount -t debugfs debugfs /sys/kernel/debug

get a list of devices under the same host SCSI

lsscsi -dl

Start I/O read and write trace collection for instance, on 2 SCSI devices (/dev/sda and /dev/sdb under host scsi0) for X seconds with a 8KB buffer size. Where X depends on the workload throughput and the storage available for trace files. The spreadsheet below can be used to calculate X (the collection period).

blktrace -d /dev/sda /dev/sdb -w X -a write -a read -b 8192& 

(See attached file: LinuxTrace.xls)

run iostat while collecting traces

iostat X > stat.txt

Please send a tarball containing the trace files sd*.blktrace.*, iostat data, and lscsci output. A compressed tarball (files.tar.bz2)  may be created using

tar -cvjf files.tar.bz2 file1 file2 file3 

Notes on tracing:
blktrace reports number of dropped events. If this is > 0 then the buffer size should be increased. 
DO NOT TRACE PARTITIONS. For instance, "blktrace -d /dev/sda1
/dev/sda2 -w 10" fails on x86 (RHE5.8) with the following error message.
BLKTRACESETUP: Device or resource busy
Failed to start trace on /dev/sda2
and trace collection after this failure won't be possible unless x86 system is rebooted. Power Linux on the other hand, allows 
tracing after the failure.

Regards,

Farnaz Toussi
Hardware performance IBM
(507) 253-4778, (tieline 553-4778)

