Disk Analysis Test Suite (dats)
The Disk Analysis Test Suite or dats is a small suite of applications designed to help isolate, diagnose and resolve disk device and file system bugs. The suite originated as dsms but has been modified for this project alongside the testing of general block devices. This suite contains the following tools:
- datadump - View data contents from a file/device.
- diskanalysis - Test a disk device or file system for data consistency. Options to run stress tests and benchmark the device/file system.
It was originally written for the following Linux operating systems:
- Red Hat Advanced Server (x86 & AMD64/Intel64)
- Canonical Ubuntu Linux (x86 & AMD64/Intel64)
But should install and work on most modern Linux distributions. The source code is provided with the latest released RapidDisk source code package.
Build and Installation
NOTE – Verify that all compiler tools are set to your local path. Tools used are
libgtk2.0-dev (provided in
binutils). On Ubuntu Linux verify that
build-essentials is installed.
Change into the directory and run the Makefile:
$ cd test/diskanalysis $ make $ sudo make install
With the exception of man pages, all package contents are installed in the
/opt/da/ path and according to its application name. It will be beneficial for testing purposes of the user profile included the installed directory path into the local
PATH = $PATH:/opt/da/bin
You can also define this variable in the user's
.bash_profile file located in their home directory. This way you do not need run this step every time a new shell is opened.
Command Line Interface (CLI)
The advantages to using DataDump focus more on data validation and generating small read I/O operations in a controlled environment. DataDump is mainly intended to work with the data integrity utility belonging to the same
Invoking the on-line help menu:
$ datadump datadump 10.05 Copyright 2009-2012 Petros Koutoupis datadump is a multi-platform supported data reading utility which allows the user to read the contents of the specified data blocks. Usage: datadump <device> <-f flags> <-s starting block> <-e ending block> <-l log file> device the device/file to read data from flags enable supported flags: -d enable direct i/o starting block the starting block to read ending block the ending block to read log file the name for the log file ex) datadump /dev/rdsk/c3t4d2s6 -s=0 -e=65535 -l=dmpfle.log datadump /mnt/mnt1/mnt1_1.dat -f=d -s=128 -e=1023 -l=dmpmnt1_1.log
Example extract from log output:
datadump 10.05 Copyright 2009-2012 Petros Koutoupis Opened file for read: ../src/datadump.c Start Block = 0 End Block = 1 ----------------------------------------------- Block Number = 0 Block Size = 512 ----------------------------------------------- 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a / * * * * * * * * * * * * * * * 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a * * * * * * * * * * * * * * * * 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a * * * * * * * * * * * * * * * * 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a * * * * * * * * * * * * * * * * 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a * * * * * * * * * * * * * * * * 2a 2a 0a 20 2a 2a 20 43 6f 70 79 72 69 67 68 74 * * . * * C o p y r i g h t 20 28 63 29 20 32 30 30 39 20 55 6e 6f 76 79 78 ( c ) 2 0 0 9 U n o v y x 2c 20 4c 4c 43 0a 20 2a 2a 20 41 6c 6c 20 72 69 , L L C . * * A l l r i 67 68 74 73 20 72 65 73 65 72 76 65 64 2e 0a 20 g h t s r e s e r v e d . . . 2a 2a 0a 20 2a 2a 20 50 72 6f 67 72 61 6d 20 4e * * . * * P r o g r a m N [ ... ]
When viewing the log file: the header displayed consists of a summary on the utility, version and the execution of the
datadump command (i.e. device/file, starting block and ending block). Following the header is the output of the read command over all desired block addresses. They are divided into 512 byte blocks where each row consists of 16 hexadecimal values of the data read followed by 16 ASCII values corresponding to the hexadecimal values.
For additional information reference the manual page for
man 1 datadump).
The DiskAnalysis test, as the name implies, tests for data corruption and or validation. It can also perform stress tests and benchmark performance of the specified volume/file system. The utility can be executed in one of multiple modes (i.e. Write-only, Read-only, Write/Read, and Read-Verification), synchronously and sequentially, staggered-sequentially or randomly seeking across the storage device. Note - Two different random algorithms exist. Once is repeatable and the other is not.
$ diskanalysis diskanalysis 10.05 Copyright 2009-2012 Petros Koutoupis diskanalysis is a multi-platform supported I/O data integrity utility that is capable of running a variety of forms of I/O to the specified disk device/file. This tool is used for tests in data integrity, stress and performance benchmarking. Usage: diskanalysis <file(s)> <mode> <parameters ... > file(s) name of disk device(s) or file path (for .dat files) mode of execution r read-only w write-only wr write-read input parameters -b transfer size in KBs (default: 512 bytes) -d file name -f modes of operation flags d direct I/O (default: buffered I/O) f fsync after every transfer (default: disabled) h stamp PID and iteration values into data buffer; offset by 0x04 bytes from the beginning of every 512 bytes. (default: disabled) i ignore errors (default: exit on error) r repeatable random I/O (default: sequential) s staggered-sequential I/O (default: sequential) v verification disabled (default: enabled) x non-repeatable random I/O (default: sequential) -e ending block number -i no. of iterations (default = 1; 0 = infinite) -l log name -m file size in MBs (default: entire device) -s starting block number -t delay time in seconds (default: 0) -v verbose debug output (default: disabled) ex) ./diskanalysis /dev/sda w -s=0 -e=65535 -i=8 -l=sda.log ./diskanalysis /mnt/mnt1/ wr -d=mnt1_1.dat -f=d -b=128 -m=2048
For additional information reference the manual page for diskanalysis (man 1 diskanalysis).
Graphical User Interface (GUI)
Only select application(s) will obtain a front-end GUI. Note that the GUI version of the applications may not provide identical functionality to their CLI counterpart.
The graphical version of the utility differs slightly from its command line counterpart DataDump. Labeled as the Data Dump Viewer, it provides an interactive method to access the file or storage device and navigate it a single block (i.e. sector) at a time via the Forward and Back buttons. The sector (data block) is read in real time.
This is just a small collection of very quick tests to run on a RapidDisk attached RAM disk raw block device. The
rxio program tests a few basic block device functionalities which include getting the volume size, reading, writing, to even seeking, the
rxioctl program tests the kernel module's
ioctl and the
rxflush program sends the BLKFLSBUF
ioctl command to flush the block device's buffer cache.
Building and Executing the Test Tools
gcc rxio.c -o rxio gcc rxioctl.c -o rxioctl gcc rxflush.c -o rxflush
To execute in place:
./rxio ./rxioctl ./rxflush
Note that they will only test the node named
/dev/rxd0. You can change this in the code if necessary and recompile.