Scroll to navigation

SGMODE(8) System Manager's Manual SGMODE(8)

NAME

sgmode - SCSI Mode Page utility

SYNOPSIS

sgmode [-aeinrxI -f modefile -m diskmodel]

DESCRIPTION

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. For information on how to create new .mdf files for specific disk models, see the /usr/share/scsirastools/UserGuide, section 3.1.

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.

OPTIONS

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).
Autorun for the device at Index N, as shown in the 'Num' column.
Automatically update 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.
Automatically turn off SMART on all disks. This reads in each disk mode page, and turns off SMART on page 0c, and writes the changes to each disk.
Automatically sets the WriteCacheEnable bit on or off on all disks. If N = 0, turn off WCE, or if N = 1, turn on WCE. This reads in each disk mode page, and sets WCE on page 08, and writes the changes to each disk.
Causes extra debug messages to be displayed.
Starts the utility in Interactive mode, requiring user input.

SEE ALSO

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

WARNINGS

See http://sourceforge.net/projects/scsirastools/ for a bug list and any later versions of this utility.

COPYRIGHT

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.

AUTHOR

Andy Cress <arcress@users.sourceforge.net>

Version 1.3: 08 May 2002