← 返回命令列表

Linux command

sginfo 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Display INQUIRY data

sudo sginfo [/dev/sda]

List all mode pages

sudo sginfo -u 63 [/dev/sda]

Display a specific mode page

sudo sginfo -t [0x08] [/dev/sda]

Display modifiable fields

sudo sginfo -m -t [0x08] [/dev/sda]

Display manufacturer's defaults

sudo sginfo -M -t [0x08] [/dev/sda]

Display saved defaults

sudo sginfo -S -t [0x08] [/dev/sda]

Output values in editable list format

sudo sginfo -X -t [0x08] [/dev/sda]

说明

sginfo accesses mode page information for SCSI and ATAPI devices. It can display and modify SCSI mode pages which control various device behaviors such as caching, error recovery, and power management. Each SCSI device maintains four sets of values for mode pages: current (active values), default (manufacturer's settings), saved (values retained across power cycles), and changeable (mask of modifiable fields). The primary use case is reading and modifying device configuration through mode pages. Mode pages can be displayed in raw hexadecimal or decoded format, and modified values can be written back to the device.

参数

-a
Display all mode pages reported by the device.
-A
Display all mode pages and subpages reported by the device.
-c
Display caching page information.
-C
Display control mode page.
-d
Display disconnect-reconnect page.
-D
Display defect lists (requires disk support).
-e
Display error recovery page.
-f
Display format page.
-g
Display geometry page.
-i
Display INQUIRY data and serial number.
-m
Display modifiable fields instead of current values.
-M
Display manufacturer's default values.
-S
Display saved values.
-t _PN_
Display mode page number PN.
-u _PN_
Display mode page PN in unprocessed hexadecimal format.
-X
Output values in a list format suitable for editing and restoring with -R.
-R
Replace mode page values from input file.
-v
Display version information.

FAQ

What is the sginfo command used for?

sginfo accesses mode page information for SCSI and ATAPI devices. It can display and modify SCSI mode pages which control various device behaviors such as caching, error recovery, and power management. Each SCSI device maintains four sets of values for mode pages: current (active values), default (manufacturer's settings), saved (values retained across power cycles), and changeable (mask of modifiable fields). The primary use case is reading and modifying device configuration through mode pages. Mode pages can be displayed in raw hexadecimal or decoded format, and modified values can be written back to the device.

How do I run a basic sginfo example?

Run `sudo sginfo [/dev/sda]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a do in sginfo?

Display all mode pages reported by the device.