SG_MODES

Section: SG3_UTILS (8)
Updated: December 2003
 

NAME

sg_modes - reads SCSI MODE SENSE pages  

SYNOPSIS

sg_modes [-a] [-c=<page_control>] [-d] [-h] [-l] [-p=<page_code>] [-subp=<sub_page_code>] [-V] [-6] [-?] [<sg_device>]  

DESCRIPTION

This utility sends a MODE SENSE SCSI command (the 10 byte variant by default) to the given device and then outputs the response. There is no facility to change the page or descriptor data with this utility. If no page is given (and '-l' is not selected) then '-a' is assumed.

-a
lists all the mode pages supported by the device.
-c=page_control
up to four different versions os each page are held by the device: the current values [0] are the default (i.e. when this parameter is not given), the changeable values [1] (bit mask showing which parts could be changed with a MODE SELECT), default value [2] (from the manufacturer?) and saved values [4] (when this device was last power cycled?).
-d
disable block descriptors. By default MODE SENSE returns in its response block descriptors and this parameter can be used to suppress them.
-h
currently only suppresses the printing out of known page code descriptions
-l
lists all known page codes. These are mainly for direct access devices (disks) and those that apply to all devices. Ignores the given device and most other parameters.
-p=<page_code>
page code to fetch. Should be a hexadecimal number between 0 and 0x3f inclusive. The default value is 0.
-subp=<sub_page_code>
sub page code to fetch. Should be a hexadecimal number between 0 and 0xff inclusive. The default value is 0.
-V
print out version string
-6
by default this utility sends out a 10 byte MODE SENSE command. However some SCSI devices only support 6 byte MODE SENSE commands (e.g. SCSI-2 tape drives). This parameter forces the use of 6 byte MODE SENSE commands.
-?
output usage message. Ignore all other parameters.

If the normal sg_modes utility fails with "illegal command operation code" then try the "-6" parameter. To alter page settings see the program listed in the "See Also" section below.

This utility performs a SCSI INQUIRY command to determine the peripheral type of the device (e.g. 0 -> Direct Access Device (disk)) prior to sending a MODE SENSE command. This helps in decoding the block descriptor and mode pages.

In the 2.4 series of Linux kernels the given device must be a SCSI generic (sg) device. In the 2.6 series block devices (e.g. disks and SCSI DVDs) can also be specified. For example "sg_modes -a /dev/sda" will work in the 2.6 series kernels.  

AUTHOR

Written by Doug Gilbert  

REPORTING BUGS

Report bugs to <dgilbert@interlog.com>.  

COPYRIGHT

Copyright © 2000-2003 Douglas Gilbert
This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

SEE ALSO

sginfo(this package), sgmode(scsirastools), scsiinfo(see net), scu(see net) seatools(see seagate)

All these utilities offer some facility to change mode page (or block descriptor) parameters.


 

Index

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
REPORTING BUGS
COPYRIGHT
SEE ALSO
blog comments powered by Disqus