$linuxjunkies
>

sdparm(8)

Access and modify SCSI device parameters and VPD pages.

UbuntuDebianFedoraArch

Synopsis

sdparm [OPTION]... DEVICE [PAGE [SUBPAGE]]

Description

sdparm reads and writes SCSI device parameters, allowing users to query and modify device mode pages, VPD (Vital Product Data) pages, and other device settings. It works with SCSI disk drives, tape drives, CD/DVD drives, and other SCSI devices.

Mode pages control device behavior such as caching, disconnect/reconnect policy, and error recovery. VPD pages contain manufacturer information and device capabilities. sdparm can save and restore configurations, making it useful for performance tuning and device diagnostics.

Common options

FlagWhat it does
-lList all known mode pages and VPD pages for the device
-p PAGESpecify mode page number (decimal or hex) to access
-qQuiet mode; suppress informational output
-s ATTR=VALSet attribute to value (e.g., -s WCE=1 to enable write cache)
-aList all attributes with their current values
-6Use 6-byte SCSI commands instead of 10-byte
-tShow detailed target data and device capabilities
-HOutput in hex format
-vVerbose mode; display detailed information
--saveSave mode page settings to device non-volatile memory

Examples

Display default device information and mode page summary for /dev/sda

sdparm /dev/sda

List all available mode pages and VPD pages on the device

sdparm -l /dev/sda

Display all readable attributes and their current values for the device

sdparm -a /dev/sda

Enable write cache (WCE=1) and save the setting permanently to the device

sdparm -s WCE=1 /dev/sda --save

Read and display mode page 8 (caching page) from the device

sdparm -p 8 /dev/sda

Show detailed target information including capacity and supported features

sdparm -t /dev/sdb

Disable read cache and write cache on the device

sdparm -s RCD=1 -s WCE=0 /dev/sda

Related commands