Tools for storage
and SCSI
-
Tools for storage
and SCSI
- Introduction
- blktool
- ddrescue
- devlabel
- dt
- fio
- hdparm
- lsscsi
- mapscsi
- plscsi
- safte-monitor
- scsiadd
- scsidev
- scsi_id
- scsiinfo
- scsimap
- scsirastools
- scu
- sdparm
- SeaTools
- sg3_utils
- sg_utils
- smartmontools
- smartsuite
- smp_utils
- spew
- udev
- Conclusion
Introduction
The page is a resource for those looking for tools for storage devices
with an emphasis on SCSI devices. These tools are user space prorams
rather than kernel drivers. The entries 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 susbsystem. It supports ATA and SCSI disks with some support for
cd/dvd drives. See this site . For finer
grain control of SCSI devices (and SATA(PI) devices connected via a
SCSI
transport) see the sdparm utility below.
ddrescue
This is another utility from Kurt Garloff <garloff@suse.de>
for rescuing damaged media. It is a variant of dd that will continue
passed errors on the input file. It is applicable to any device that
can be read by dd (e.g. IDE and SCSI disks, cds 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 userspace 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 ).
lsscsi
This utility lists SCSI devices (or hosts) that are present in the
linux kernel 2.6 series. 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.
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.
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.
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. sdparm can do most of
the things that scsiinfo and sginfo can.
scsimap
Steve Cameron <smcameron@yahoo.com> has the following description
at his site:
This is a utility to create and maintain symbolic links mapping a
predictable set of names to the rather unpredictable names used by
linux for disk devices. For example, you might map:
/dev/mydisk1 -> /dev/sda1
/dev/mydisk2 -> /dev/sdb1
/dev/mydisk3 -> /dev/sdc1
If you removed the disk corresponding to /dev/sdb1, then on reboot,
/dev/sdc1 will become /dev/sdb1, and /dev/sdc1 will be gone. and your
fstab will be wrong, etc. (Especially problematic on a SAN). scsimap
will maintain the mapping so that after the reboot, /dev/mydisk3 ->
will point to /dev/sdb1 and /dev/mydisk2 will be gone. scsimap also
handles later generation Compaq array controllers (those which use
the cciss driver.)
See: www.geocities.com/smcameron
.
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. It was written for the Linux 2.4 and 2.6
series and has been ported to FreeBSD and Tru64.
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.
sg3_utils
This is a package of utilities that send SCSI commands and decodes the
response. It also includes slightly higher level utilities such as
sg_dd which permits a finer level of control over SCSI devices involved
in copies compared to the standard Unix dd command. sg3_utils is written for the Linux 2.4 and
2.6
series and a large subset of its utilities have been ported to FreeBSD
and Tru64 .
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 project has taken over from the aforementioned
smartsuite which is currently not actively maintained. See http://smartmontools.sourceforge.net
. The author is a maintainer of the SCSI component of this project.
[The lead maintainer is Bruce Allen.]
smartsuite
This is a package that supports S.M.A.R.T. capabilities built into
modern IDE and SCSI-3 disks. Self-Monitoring, Analysis and Reporting
Technology (S.M.A.R.T.) is described at www.pc.ibm.com/us/infobrf/ibsmart.html.
For smartsuite see sourceforge.net/projects/smartsuite
.
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. See spew.berlios.de
.
udev
udev
provides a dynamic device directory containing only the files for
actually present devices in linux 2.6 series kernels. It creates or
removes device node files usually located in the /dev directory,
or it renames network interfaces.
Conclusion
If readers have corrections or suggested additions to this list of
tools, please contact the author.
Return to main page.
Douglas
Gilbert can
be emailed at this address (also at dougg at torque dot net).
Last updated: 11th June 2006