Langue: en

Version: 51999 (openSuse - 09/10/07)

Section: 8 (Commandes administrateur)


sgmode - SCSI Mode Page utility


sgmode [-aenrx -f modefile -m diskmodel]


Sgmode is a program that uses the SCSI Generic interface to send specific SCSI commands to read the device mode page configuration and also write mode pages. The SCSI Generic interface requires that the kernel .config file have CONFIG_CHR_DEV_SG set.

A log file, named sgmode.log is created in the /var/log directory which logs the status of the functions and any errors.

Below is the sequence of events for this utility:

List each device on the system with firmware versions.
User selects a device for mode page (automatic if using -m or -a).
Attempt to read the mode page file for the selected disk (see option -f).
Verify that the disk is present and ready.
Write the mode pages via mode select (unless read-only is specified).
If the '-m' or '-a' option was used, repeat writing the pages for each specified disk.


Command line options are described below.
This option displays a summary of the commands accepted by sgmode
Causes the functions to be performed automatically on all connected SCSI devices.
Causes any file writes to be avoided, such as the log file. Usually a log file is created and written to.
Specify this filename for the mode pages. Normally, this option is not used and the filename is formed using the first 8 characters of the model, with the ".mdf" extension. For example: "st39173w.mdf". This utility will look for the mdf file first in the current directory, then in the default directory (/usr/share/scsirastools).
Automatically download all drives that match this model string.
Naming. By default, the device names are displayed as numeric sequences (/dev/sg0). This option shows the device names as alphabetic sequences (/dev/sga).
Allow it to overwrite the disk capacity, if different.
Read-only. Do not try to write any mode pages. By default, if -a or -m is specified, the utility will attempt to open an .mdf file for each drive, and write modepages if a matching file exists.
Causes extra debug messages to be displayed.


sgdefects(8) sgdiag(8) sgdskfl(8)


See for a bug list and any later versions of this utility. Copyright (C) 2001-2002 Intel Corp.

sgmod is open source software. You can redistribute it and/or modify it under the terms of the BSD License. See the COPYING file included with this software package for more details regarding distribution.

sgmode is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.


Andy Cress <>