scsi-config(8)

๐ŸŽ€ NAME ๐ŸŽ€

okay so bestie, welcome to scsi-config, from the Scsiinfo User's Guide, section 8 of the manual ๐Ÿ’– โ€” it queries information from a scsi device with a nice user interface. that's the whole vibe. periodt. โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

scsi-config [device]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

scsi-config queries info from an scsi target through a nice Tcl/Tk graphical user interface. iconic behavior honestly. ๐Ÿซถ If you don't hand it a device to query, it just goes ahead and calculates a list of available devices for you and prompts you with them โ€” no cap, it does the homework for you. ๐Ÿ’โ€โ™€๏ธ

Because it's a GUI, most things kinda explain themselves, which is lowkey the whole point. Basically scsi-config shows you a list of buttons for certain mode pages that you can press. The buttons you're actually able to press, plus the text windows with white backgrounds โ€” those are the ones you can modify, and your modifications get sent right back to the device. slay. โœจ

In the main window there's a button that tells the device to save its data into some non volatile memory (if it even supports that, key word if ๐Ÿ™ˆ). Heads up though: this instructs the device to save the Read-Write Error Recovery Page, the Disconnect-Reconnect Page, the Format Device Page, the Caching Page, and the Control Mode Page into its NVRAM. Usually saving even a single one of those should write them all to the NVRAMโ€ฆ but you never know. ๐Ÿ’€

You can query the current values, the factory default values, and the values sitting in the NVRAM (which may not be the current parameters, mind you) straight from the device. ๐Ÿ”ฅ

not all combinations of button toggles or values are valid, bestie. in general you just try to set them and see which values the drive actually accepts. scsi-config rereads the device configuration immediately, s.t. you see which values where accepted. main character energy: instant feedback. ๐Ÿ‘‘

Also โ€” and this is important โ€” some disk drives are notched, and those have an active notch (shown in the main window) to which all your settings apply (at least the ones from notched pages, which are also marked in slate gray). You can pick the active notch that your settings apply to (and that the values refer to) over in the Notch Page. ๐ŸŒธ

For those devices that don't have an NVRAM (generally removable media devices), and also just as a kind of backup, you can save the current settings to a file. The file will actually be a /bin/sh script that makes the necessary scsiinfo(8) calls to set the saved parameters whenever you execute it. obsessed. ๐ŸŽ€

There's also a lovely Overview button that queries a bunch of details about the disk geometry and draws them in a nice picture. This looks esp. nice for drives with many notches โ€” that is, different regions on the disk with different tracks per sector settings. It's also super useful for notched drives, because you can immediately select the mode pages for each notch. ๐ŸŒˆ


โœจ SOME USAGE GUIDELINES โœจ

1. General Warning โš ๏ธ

Generally, do not modify settings you don't understand. It's useful to know the SCSI-II specs mentioned below. Some settings may render the device unusable or even damage it. ๐Ÿ˜ญ Usually a power cycle resets the state (that is, if you do not save the weird settings in the NVRAM). Some settings affecting the assignment of logical sectors will render the disk unusable until the next low level format. yeah. no pressure. ๐Ÿ’€

2. On Write Caching ๐ŸงŠ

As an old warning, this also means you should not generally switch the write cache on. At least on those drives where you even have a choice at all. Reasons are twofold:

  • a) It is a priori unclear when the drive will actually perform the writes. This is a bad thing when you're thinking about shutting down your machine. On the other hand, it seems sensible to assume that the drive will immediately write its cache to disk when it is idle (after all file systems are unmounted), and due to the size of the on-disk cache this will usually only need a few seconds after the shutdown โ€” but the drive lamp will usually not glow, as it is mostly connected to the host adapter (if you have a lamp at all) and it is not participating. ๐Ÿ”Œ

There is a SCSI command to flush the caches. Linux could call it prior to shutting down, spinning a disk down. Due to my knowledge this is not yet done though. ๐Ÿ˜”

  • b) As the writes are performed asynchronously, errors are reported asynchronously too. The disk might return an error at some simple read instruction related to a write which was acknowledged OK several transactions ago. This generally confuses things and makes interpreting errors very difficult. Some devices are known/said to not report write errors in this mode of operation at all. ๐Ÿ™ˆ

Just imagine that at the point where a file system is unmounted, or a new removable media is detected, it could tell: Oops, BTW, there was some write error ago although I told you it was OK already. the audacity fr fr ๐Ÿ˜ญ

Thus, when you run a disk in write cache mode, keep it in mind when weird error messages occur and give the disk time to flush its buffers at shutdown. Generally it would be good if you knew more vendor specific details on how the disk operates in the write cache mode. ๐Ÿซถ

3. Reassigning Bad Blocks Automatically ๐ŸŒธ

One of the nice features of SCSI disks is that they allow you to remap bad blocks automatically as they are detected, with no user intervention. However โ€” plot twist โ€” you actually have to enable this feature! It turned out you can not generally assume a disk is in this mode. To enable this mode or check the settings, proceed as follows:

  • a) Go to the Read-Write Error Recovery Page. The AWRE (Automatic Write Reallocation Enable) and ARRE (Automatic Read Reallocation Enable) buttons enable the automatic reallocation. โœ…

In the same window, you can select the maximal retries performed. EER allows the disk to do some Early Error Recovery, which is fast (but might misdetect or miscorrect data). A selected DCR button (Disable CoRrection Codes) disallows the disk from using any error correction codes at all โ€” thus the drive will have to retry until it performs an error free read. ๐Ÿ˜ฎโ€๐Ÿ’จ

Usually a sector will be reallocated after even a single read retry, or the given number of failed write retries. When the sector cannot be recovered, it is reallocated, but the data is lost and an error is signalled. ๐Ÿ’€

The other buttons there apply to error reporting as well. TB Transmits the bad Block together with the error. RC Reads Continuous, that is, it does not pause a read operation while retrying or using error code calculations to recover a bad block (thus it may return bad data). PER lets the disk report even recovered errors (Post ERror). DTE (Disable Transfer on Error) even breaks a running data transmission when an error is detected. ๐Ÿ”ฅ

  • b) Even when the reallocation is enabled, the disk must actually have some reserved areas where it can remap the bad blocks. The Format Page controls this. Either a given number of Alternate Sectors Per LUN is set aside for the whole disk, or a given number of tracks is defined to be a zone and, for each zone, a number of sectors or tracks is put aside. These alternate data areas are where bad sectors get remapped. ๐Ÿฆ‹

Note that this page is very likely to apply only to the current notch on a notched disk device. ๐ŸŽ€

If there are no, or not many, alternate sectors reserved on your disk, you must change these settings. ๐Ÿ˜ค

I found that those disks which allow you to modify these settings are very often set to no reserved sectors at all by the vendors, as this increases the disk's capacity. For the sake of stability, you should really modify these settings. bestie please. ๐Ÿฅบ

If you decide to modify the number of alternate sectors, you must:

  1. Save the parameters to the NVRAM of the disk.
  2. Low-level format the disk drive (and not erase the NVRAM during this operation).

โ€ฆto make the changes be effective. โœจ

  • c) Esp. when you set the disk to not report recovered errors (or when it's in a write cache mode or something), and just as a general guideline, keep an eye on the grown defects list, where the disk will report all the remappings which took place as your disk ages. ๐Ÿ‘€

The old adventurers guide line applies: Save (Backup) Early, Save (Backup) Often. Find the right time to replace your disk, avoiding too much work recovering your data. ๐Ÿ’–


๐Ÿ’€ BUGS ๐Ÿ’€

scsi-config could be enhanced by making better use of Tcl/Tk. I learned much about it during my work on tk_scsiformat(8) and their would be much room for fixes and enhances. On the other hand, it fulfils its purpose as it is quite nicely already. ๐Ÿ™ˆ๐Ÿ’…

As scsi-config makes heavy use of scsiinfo(8), all its bugs (esp. on defect reading) apply. ๐Ÿ˜ญ


๐ŸŽ€ FILES ๐ŸŽ€

  • /usr/lib/scsi/cache
  • /usr/lib/scsi/control
  • /usr/lib/scsi/disconnect
  • /usr/lib/scsi/error
  • /usr/lib/scsi/format
  • /usr/lib/scsi/generic
  • /usr/lib/scsi/inquiry
  • /usr/lib/scsi/notch
  • /usr/lib/scsi/overview
  • /usr/lib/scsi/peripheral
  • /usr/lib/scsi/rigid
  • /usr/lib/scsi/save-changes
  • /usr/lib/scsi/save-file
  • /usr/lib/scsi/tworands
  • /usr/lib/scsi/verify โ€” (Tcl/Tk subroutines used by scsi-config). ๐Ÿงš
  • /dev/sd*
  • /dev/sg*
  • /dev/scd*
  • /dev/st*
  • /dev/nst*
  • /dev/rmt*
  • /dev/nrmt*

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

scsiinfo(8), scsiformat(8), tk_scsiformat(8), fdisk(8), sd(4),

Draft proposed American National Standard for information systems SMALL COMPUTER SYSTEM INTERFACE - 2 (SCSI-2) MARCH 9, 1990

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

  • Eric Youngdale.
  • Michael Weller <eowmob@exp-math.uni-essen.de>, Versions 1.5 & 1.7

and that's the whole thing, bestie!! ๐Ÿ’– this page is brought to you by scsiinfo 1.7, dated 24 August 1997 โ€” yes it's vintage, no we are not gatekeeping it, and honestly? it ate. ๐ŸŽ€โœจ๐Ÿฆ‹ take care of your disks, back up early, back up often, and stay iconic. ๐Ÿ’…๐Ÿซถ