
| long option format |
short option format |
description |
| --all |
-a |
list all known (generic or
transport) parameters for given DEVICE. When this utility is invoked with
no options then only common generic mode parameters are
output. |
| --clear=STR |
-c STR |
clear (zero) parameter(s) in
STR. The default
action to clear can be overridden, see below. |
| --command=CMD |
-C CMD |
perform CMD which is one of:
capacity, eject, load, ready, sense, start, stop, sync or
unlock |
| --dbd |
-B |
set the DBD (disable block
descriptors) bit in each MODE SENSE cdb |
| --defaults |
-D |
fetch the default values for
the given mode page and use them to overwrite the current
values. Note that the saved values are not overwritten
unless the '--save' option is also given. |
| --dummy |
-d |
when used with '--set' or '--clear' does all
the preparation and sanity checks but bypasses the final
stage of sending the changes to the device. [That is, it
skips the MODE SELECT command.] |
| --enumerate |
-e |
fetch information from the
sdparm's internal tables. If a DEVICE name is given then it will be
ignored. May be used in conjunction with '--all', '--inquiry', '--long', '--page=', '--transport='
and/or '--vendor='. |
| --flexible |
-f |
check mode sense responses
for sanity and if broken, try to fix them if possible. Also
allows mode pages whose peripheral type mismatches the given
DEVICE to be
processed. |
| --get=STR |
-g STR |
fetch parameter(s) in STR |
| --help |
-h |
output a usage message then
exits |
| --hex |
-H |
rather than decode a (mode or
VPD) page, it is output in ASCII hex. If used with the '--get' option then
the parameter is output in hexadecimal. May be invoked
multiple times. |
| --inhex=FN |
-I FN |
read ASCII hex from file FN (and
ignore DEVICE) and
decode as mode or VPD page(s). Reads from stdin if FN
is '-'. Treats the contents of FN as binary if '--raw'
is also given. |
| --inquiry |
-i |
fetch a VPD page, decode and
output it. If no '--page='
is given then the device identification VPD page is
fetched. Add '-ll'
to get standard INQUIRY response data decoded in more
detail. |
| --long |
-l |
Add extra information to the
output. For example a line showing the setting of the WCE
parameter will have "Write cache enable" appended to it.
Using '-ll'
adds information about selected mode parameter values (e.g.
MRIE). |
| --num-desc |
-n |
for a mode page that can have
descriptors, the number of descriptors in the given page on
DEVICE is output. Otherwise 0 is output. |
| --page=PG[,SPG] |
-p PG[,SPG] |
page (and optionally subpage)
to output or change. Argument may be either an abbreviation,
a number or two numbers separated by a comma. If a number is
prefixed by "0x" or has a trailing "h" then it is decoded as
hexadecimal. When a numeric argument is given, it is assumed
to be for a mode page unless the '--inquiry' option is also given. An
abbreviation is two or three lower case letters (e.g. "ca"
for the caching mode page). An abbreviation may be for a
mode page (e.g. "ca") or a VPD page (e.g. "sp"). |
| --pdt=DT |
-P DT |
where DT is the "peripheral device
type" value (e.g. 0 for a disk, 1 for a tape drive, etc).
Only active when '--inhex=FN' is
also used. |
| --quiet |
-q |
suppress
vendor/product/revision strings that are usually the first
line of the output. Also abridges the output of the device
identification VPD page. |
| --raw |
-R |
used together with '--inhex=FN'. It causes the file FN to be interpreted as binary. |
| --readonly |
-r |
override other logic and open
DEVICE in read-only mode. This can help with ATA disks
especially with commands like '-C stop'. Also works with '--set='
and '--clear='. |
| --save |
-S |
also write changes to
corresponding "saved" values mode page. Active when used
with '--set=',
'--clear=' or '--defaults'. The
default action is to only make changes to the current values
mode page. |
| --set=STR |
-s STR |
set parameter(s) in STR. To set a parameter is to make all its bits one. The default action to set can be overridden, see below. |
| --six |
-6 |
use 6 byte cdbs for MODE
SENSE and MODE SELECT commands for getting and setting mode
pages. The default action is to use the 10 byte cdb
variants. |
| --transport=TN |
-t TN |
transport protocol
identifier; either a number or an abbreviation (e.g. "fcp",
"spi" or "sas") can be given. See transports
section. In the absence of an explicit transport and if a
page or field name does not match a generic name then the
SAS transport is assumed. |
| --vendor=VN |
-M VN |
vendor (manufacturer)
identifier; either a number or an abbreviation (e.g. "sea"
or "hit") can be given. See vendors
section. |
| --verbose |
-v |
increase verbosity of output.
May be used multiple times to further increase verbosity. |
| --version |
-V |
print out the version and the
date of last code change then exits |
| --wscan |
-w |
[Windows only] scan for device names, show one device per line. Each device can have multiple device names. If a DEVICE name is given (on the command line) then it will be ignored. |
| hdparm option |
related sdparm option |
Comments |
| -A0 |
--set DRA=1 |
disable read look ahead. SAT
shows this mapping and libata may support it soon. |
| -A1 |
--set DRA=0 |
enable read look ahead
(double negative in sdparm). Check current state with '--get
DRA'. |
| -C |
--command=ready or --command=sense |
fetch the current device
power state. Use of "sense" (i.e. REQUEST SENSE SCSI
command) to check the power state is relatively new for SCSI
devices. Not many devices will support it yet. |
| -D0 |
--set AWRE=0,ARRE=0 |
disable defect management
[SCSI: Automatic Write/Read Reallocation Enabled fields] |
| -D1 | --set AWRE=1,ARRE=1 | enable defect management
[SCSI: Automatic Write/Read Reallocation Enabled fields].
This is usually enabled by default but is sometimes disabled
on disks found in RAIDs. |
| -f |
--command=sync |
sdparm sends a SYNCHRONIZE
CACHE SCSI command; it does not touch the block layer. |
| -i |
--inquiry |
hdparm's '-i' is a reduced
(and older form) of what is available with '-I' |
| -I |
--inquiry or --inquiry -ll or --inquiry --page=ai |
The closest match here is when the "ai" VPD page is available (i.e. the third related sdparm option). Logically much of the information from '-I' corresponds to information in a standard INQUIRY response plus the "device identification" VPD page (i.e. the first related sdparm option). The second related sdparm option expands the decoding of the standard INQUIRY response. |
| -K1 |
--save |
keep_features_over_reset is a
global flag in ATA but per field in SCSI. Hence not an exact
match. |
| -L0 |
--command=unlock |
unlock door of removable
media |
| -S <n> |
--set SCT=<m> |
Standby condition timer,
<n> has 5 second units (roughly) while <m> has
100 ms units |
| -W0 |
--set WCE=0 |
disable write cache |
| -W1 |
--set WCE=1 |
enable write cache |
| -y |
--command=stop |
places an ATA disk, or a
CD/DVD drive, in standby mode |
Return to main page.
Last updated: 22nd February 2016