Storage and SCSI tools

  1. Storage and SCSI tools
    1. Introduction
    2. User space tools
      1. blktool
      2. btest
      3. ddpt
      4. ddrescue
      5. devlabel
      6. dt
      7. fio
      8. hdparm
      9. libiscsi
      10. lsscsi
      11. mapscsi
      12. mhvtl
      13. plscsi
      14. safte-monitor
      15. scsiadd
      16. scsidev
      17. scsi_id
      18. scsiinfo
      19. scsirastools
      20. scu
      21. sdparm
      22. SeaTools
      23. sg3_utils
      24. sg_utils
      25. smartmontools
      26. smartsuite
      27. smp_utils
      28. spew
      29. testdisk
      30. udev
      31. vdbench
    3. Linux kernel drivers
      1. mhvtl
      2. null_blk
      3. scsi_debug
    4. Conclusion

Introduction

The page is a resource for those looking for software tools for storage devices with an emphasis on SCSI devices and Linux. These tools are typically user space programs and most are listed under that heading. There are also some Linux kernel drivers that may be regarded as test tools, they are listed under a separate heading.

Here is another reference site that catalogs various manufacturer's disk diagnostic utilities .

User space tools

The entries below are brief abstracts with links to pages that have more information. The entries are in alphabetical order.

blktool

This is a utility for fetching and changing parameters in the Linux block subsystem. It supports ATA and SCSI disks with some support for cd/dvd drives. Now maintained by Debian, see this site. For finer grain control of SCSI devices (and SATA(PI) devices connected via a SCSI to ATA Translation Layer (SATL)) see the sdparm utility below.

btest

This is a disk exerciser that can do verification.  It has an emphasis on dedup and compression aware pattern generation. See this site.

ddpt

This utility is a variant of the standard Unix command dd which copies files. The ddpt utility specializes in files that are block devices. For block devices that understand the SCSI command set, finer grain control over the copy may be available via a SCSI pass-through interface. Can also issue SCSI XCOPY commands (both the older form from SPC-2 (now known as "LID1") and a newer subset of LID4 known as ODX). It has been developed for Linux and ported to FreeBSD, Solaris and Windows. See ddpt  .

ddrescue

This is a utility from  Kurt Garloff <garloff@suse.de> for rescuing data from damaged media. It is a variant of dd that will continue past errors on the input file. It is applicable to any device that can be read by dd (e.g. IDE and SCSI disks, cd/dvds and tapes). For more information see: www.garloff.de/kurt/linux/ddrescue

There is also a GNU program of the same name that has a similar function. See http://ftp.gnu.org/gnu/ddrescue/ . John Gilmour has some information on disk recovery utilities at  http://www.toad.com/gnu/sysadmin/ .

devlabel

Devlabel is "a small user space app which maps symlinks to underlying disk names. It uses [INQUIRY VPD] Page83/Page80 data to track the true locations of disks even if their hd/sd name changes and simply updates the symlink to point to the right place." Sysfs support for the lk 2.6 series and support for multi-path configurations is on the author's "to do" list. See http://www.lerhaupt.com/linux.html . Probably better to use scsi_id/udev in the lk 2.6 series kernels

dt

The Data Test (DT) program is modelled on dd's syntax but dt can do a lot more than sequential copies. It is a comprehensive data test program for SCSI devices such as disks, tapes and cdrom/dvds. It is available on several Unix platforms (and NT), and its source is available (unlike its stable mate scu discussed earlier). See www.scsifaq.org/RMiller_Tools/index.html for more details. dt is written by Robin T. Miller <Robin.Miller at netapp dot com>

fio

This utility tests the performance of Linux/Unix block devices or file systems. fio is a tool that will spawn a number of threads doing a particular type of IO action as specified by the user in a defined job file. fio supports various types of IO backends, such as regular sync IO, linux aio, posix aio, and sg v3 IO (SG_IO and queued read/write). fio can be used for both performance testing, data/media verification, etc.

hdparm

This utility gets and sets ATA drive parameters under Linux. Can also get transport parameters for ATAPI devices. There is also limited support for SCSI devices. See this site . Overlaps in functionality with blktool (see above ). From hdparm version 7.0 onward, it can detect a SCSI to ATA Translation Layer (SATL) allowing it to tunnel ATA commands.

libiscsi

This client side iSCSI library and associated tools has a SCSI compliance checker called iscsi-test-cu. This checker has an experimental mode which bypasses iSCSI and can check directly attached SCSI devices (typically disks). See libiscsi .

lsscsi

This utility lists SCSI devices (or hosts) that have been detected in a machine running a linux 2.6 series kernel. It is a passive tools in the sense that it "data mines" the linux sysfs file system rather than attempting to query devices. See lsscsi  .

mapscsi

Michael Clark <michael@metaparadigm.com> describes his utility thus: "mapscsi is a small utility that creates a consistent mapping to Linux scsi devices. mapscsi achieves this by creating symbolic links to linux scsi disk devices after scanning all scsi disk devices, finding out their host, channel, id, lun, pci location (if available), Fibre Channel world wide node and port names, loop and port ids (with qla2x00 v4.46.5 driver) vendor, product and serial number details and using this information plus a mapping rules file containing device templates to dynamically create link names". For more information see: http://gort.metaparadigm.com/mapscsi . In the linux 2.6 series the scsi_id/udev pair is probably appropriate.

mhvtl

Mark Harvey's Virtual Tape Library. See the mhvtl site.

plscsi

This utility allows arbitrary SCSI commands to be sent to a device. See http://members.aol.com/plscsi . It is similar to FreeBSD's camcontrol command. Recent versions of the sg3_utils package include the sg_raw utility which can also send arbitrary commands.

safte-monitor

SAF-TE (SCSI Attached Fault-Tolerant Enclosure) is a SCSI command set for monitoring and controlling enclosures and RAIDs. SAF-TE devices report "processor" peripheral device type (0x3) in their INQUIRY responses. More recent products tend to use SES (drafts at http://www.t10.org ) which covers similar functionality. For a SAF-TE monitoring tool for linux see: http://oss.metaparadigm.com/safte-monitor .

scsiadd

This utility permits a user to add and remove scsi devices from the Linux scsi subsystem on the fly. See scsiadd on this page .

scsidev

Kurt Garloff <garloff@suse.de> describes this utility thus: "This program scans the SCSI bus and creates device nodes in /dev/scsi/, which have a naming corresponding to their SCSI IDs and LUNs, just like with devfs. (The devfs has no notion of host adapter IDs, scsidev is better here.) Furthermore, the devices are inquired to tell their names and serial numbers. Those can be compared with the entries in a database /etc/scsi.alias and device nodes corresponding to these entries are being built. So,this will even work if you change the SCSI IDs of a device, where the devfs approach would fail". For more information see: www.garloff.de/kurt/linux/scsidev . He also has the useful rescan-scsi-bus.sh script at the same location.

scsi_id

This utility is used by various linux 2.6 series distributions together udev to dynamically add and remove scsi device nodes. See udev 's page. It also has a "man" page.

scsiinfo

Older package that includes the scsiinfo and scsiformat utilities plus tcl/tk GUI interfaces for those utilities. The last update of the scsiinfo package was in 1997. The function and syntax of the scsiinfo utility have inspired sginfo which now can be considered as a "drop in" replacement for scsiinfo . Recent changes to SCSI standards (e.g. extra and extended mode pages) are reflected in sginfo . In a similar way the sg_format utility can be thought of as a modern replacement for the scsiformat utility. Both sginfo and sg_format can be found in the sg3_utils package. sdparm can do most of the things that scsiinfo and sginfo can.

scsirastools

"This project includes changes that enhance the Reliability, Availability and Serviceability (RAS) of the drivers that are commonly used in a Linux software RAID-1 configuration. Other efforts have been made to enable various common hardware RAID adapters and their drivers on Linux." See http://scsirastools.sourceforge.net . The package contains some low level scsi utilities including sgdskfl to load disk firmware, sgmode to get and set mode pages, sgdefects to read primary and grown defect lists and sgdiag to perform format and other test functions.

scu

The SCSI Command Utility (SCU) implements various SCSI commands necessary for normal maintenance and diagnostics of SCSI peripherals. Some of its features include: formatting, scanning for (and reassigning) bad blocks, downloading new firmware, executing diagnostics and obtaining performance information. It is available on several Unix platforms (and NT), however it is only currently available in binary form. See  www.scsifaq.org/RMiller_Tools/index.html for more details. scu is written by Robin T. Miller <Robin.Miller at netapp dot com>

sdparm

This utility allows information from SCSI mode pages to be fetched and potentially modified. sdparm also decodes Vital Product Data pages and can send simple SCSI command. It was written for the Linux 2.4 and 2.6 series and has been ported to FreeBSD, Solaris, Tru64 and Windows.

SeaTools

SeaTools is a freely available (binary, not source) utility for disk diagnostics from Seagate which is a disk manufacturer. It can be found at http://www.seagate.com under the support tab. They have both a command line and a graphical utility.  Some of the facilities will work on any SCSI disks while others are Seagate specific. Self tests, mode page settings and formats (to different block sizes) are amongst the facilities available. Other disk vendors have similar tools, see the reference in the introduction section.

sg3_utils

This is a package of utilities most of which send SCSI commands and decode the response. This coverage file contains a mapping of SCSI commands to utilities which send those SCSI commands. The package also includes slightly higher level utilities such as sg_dd which permit a finer level of control over SCSI devices involved in copying compared to the standard Unix dd command. sg3_utils is written for the Linux 2.6 and 3 series and a large subset of its utilities have been ported to FreeBSD, Solaris, Tru64 and Windows.

sg_utils

This package is the precursor of sg3_utils. sg_utils was written for the Linux 2.2 series with some support for the linux 2.0 series.

smartmontools

This package includes a command line utility, smartctl, and a daemon, smartd, to check the SMART status and associated attributes of disks (both ATA and SCSI) and tape drives. SMART is an acronym for Self-Monitoring, Analysis and Reporting Technology. This project has taken over from smartsuite . See http://smartmontools.sourceforge.net for more information. Recent versions have the ability to probe (S)ATA disks behind SCSI transport infrastructure, specifically behind a SCSI to ATA Translation Layer (SATL).

When things go wrong and smartmontools report problems then the Bad Block Howto may be of use.

smartsuite

This is a package that supports S.M.A.R.T. capabilities built into modern IDE and SCSI-3 disks. SMART is an acronym for Self-Monitoring, Analysis and Reporting Technology. See sourceforge.net/projects/smartsuite . This package is currently not actively maintained.

smp_utils

This is a package of utilities that sends Serial Attached SCSI (SAS) Management Protocol (SMP) requests to a device (typically a SAS expander) and decodes the response. See the smp_utils page.

spew

This utility is used to measure I/O performance of character devices, block devices, and regular files. It can also be used to generate high I/O loads to stress systems while verifying data integrity. It is easy to use and is flexible. No configuration files or complicated client/server configurations are needed. Spew also generates its own data patterns that are designed to make it easy to find and debug data integrity problems. Mirrored on this location.

testdisk

For those occasions when the master boot record is overwritten, testdisk can find many different types of partitions and help with data recovery.

udev

udev provides a dynamic device directory containing only the files for actually present devices in linux 2.6 and 3 series kernels. It creates or removes device node files usually located in the /dev directory, or it renames network interfaces. For SCSI (and some ATA) devices it has a helper called scsi_id which is described above.

vdbench

This is a disk exerciser that can do verification. See this site.

Linux kernel drivers

The driver list below are often used when real SCSI or storage devices are not available. Another use it to measure the Linux kernel block and/or SCSI subsystem overhead.

mhvtl

A component of Mark Harvey's Virtual Tape Library is a Linux kernel driver typically built as a module. It is derived from the scsi_debug driver. See the mhvtl site.

null_blk

null_blk is a Linux kernel driver typically built as a module. It is a dummy block device with device names of the form /dev/nullb<n> where <n> is a number starting at 0. Its overhead should be much less than any real storage device and can be used for measuring the block system overhead. Found in the Linux kernel series 3. Use 'modinfo null_blk' for information about its parameters.

scsi_debug

scsi_debug is a Linux kernel driver typically built as a module. It creates one or more dummy SCSI devices and also includes a dummy SCSI host (HBA) which has a sysfs bus name of 'pseudo'. See the scsi_debug page.

Conclusion

Please contact the author with corrections or suggested additions to this page.


Return to main page.

Douglas Gilbert can be emailed at this address.

Last updated: 25th September 2014