SCSIDM(8)

NAME
scsidm - configure a Direct Access SCSI device

SYNOPSIS
/etc/scsidm [ device ] [ command [ argument...
 ] ]

DESCRIPTION
Scsidm is used by the system administrator to configure SCSI devices. Although it is mainly intended for use with Direct Access class devices, scsidm also provides a limited subset of commands for all other device classes. Device class Optical Memory is treated as a synonym for Direct Access.

Scsidm may be used to:

•   list active devices on the SCSI bus

•   format a device,

•   verify a device,

•   divide the disk between RISC OS and RISCiX,

•   create & manipulate partition tables,

•   associate textual names with RISCiX partitions,

•   define and list defective data blocks,

•   run a set of diagnostic routines,

•   read/write mode sense/select data.

Without any arguments, scsidm will prompt for commands from the standard input. If arguments are supplied, scsidm interprets the first argument as a device, the second as a command, and all remaining arguments as parameters to the command. The standard input may be redirected, causing scsidm to read commands from a file.

If scsidm prompts for a command, any necessary parameters may be passed with the command; if they are not, scsidm will prompt for them. Whenever scsidm prompts for input, entering `help' or `?' should produce a few lines of context sensitive help, after which scsidm re-prompts for the input. Commands may be abbreviated; the following is the list of recognised commands:

quit
    Leave scsidm.

? [ command ... ]

help [ command ... ]
    Print a short description of each command specified in the argument list, or, if no arguments are given, a list of the recognised commands.

device [ devname ]
    Select devname as the current device, or, if no argument is given, print the current device. If devname does not contain any pathname separators (`/'), scsidm will prepend the default device pathname of `/dev', i.e.

    			device rsd0h

    is identical to

    			device /dev/rsd0h

    but
    			device expcards/rct

    will not be expanded.

    Devname must be a character special file for a device that uses the SCSI expansion card. If the device is a Winchester disk, then devname must also reference a valid partition on that device. In the absence of any other choice, use the ALL partition (partition 7) which is always valid.

diagnose
    Asks the current device to run a set of internal diagnostics. The results can be no more sophisticated than either `pass', or `fail' with an appropriate error code returned by the device.

format [ defects [ interleave ] ]
    Format the current device using the given interleave. Defects is a yes/no boolean which indicates whether the current grown list of defects (GLIST) is to be preserved. Format will ask for confirmation before the command is started, this has to be given in response to a prompt, it cannot be passed as an argument.

mapdefects [ fname [ truncate ] ]
    Add the list of (hexadecimal) bad block numbers in fname to the GLIST. Truncate is a yes/no boolean signalling whether or not to truncate the list of defects in fname; this is usually a good idea, as the blocks are no longer defective once they have been mapped out.

mkdisktab [ fname ]
    Write a sample /etc/disktab entry out to the file fname. This entry specifies the disk shape and size of all valid partitions; it is not a good idea to specify /etc/disktab as fname, because all existing entries will be lost: it is up to the user to integrate this sample entry into /etc/disktab in a sensible manner.

namepart [ ptlist [ text ... ] ]
    Define new text strings for the partitions named in ptlist.

partition [ ptlist [ sizes ] ]
    Write the RISCiX partition table. Ptlist specifies which partitions are to be defined, and sizes is a list of start block and length for each partition in ptlist. Note that the start of a partition is measured from block 0 on the disk, not the first block of the RISCiX area.

    When setting up a new disk, the size of the RISCiX area must have been specified with the section command before using partition.

prdefects
    Print the GLIST for the current device.

prptable
    Print the RISCiX partition table, and a map of the disk space occupied by all defined partitions.

probe
    Print a list of SCSI devices attached to the system.

scanptable
    Intended for use when the partition table gets corrupted, this command reads every block on the disk, looking for spare copies of the partition table which are written by the partition command, separate tables being identified by a timestamp. When the scan is complete, scanptable lists all blocks which look like a partition table (i.e. have the correct magic number). It then provides the capability to inspect these tables in greater detail, and then choose one as the replacement for the lost / corrupt table.

section [ dual [ rsize ] ]
    Divide the disk between RISC OS and RISCiX. If the boolean dual is `no', then the entire disk is used for RISC OS. If, however, dual is `yes', then rsize defines the number of blocks allocated to RISC OS. Rsize is rounded up to an integer number of complete cylinders (an historical restriction imposed by RISC OS), and the rest of the disk is allocated to RISCiX.

sensemode [ pages [  pagno [ rtype ] ] ]
    This command provides an interface to the SCSI mode sense command. Pages is a yes/no boolean signalling whether or not to work with the CCS-4.B standard for page formats: stating `no' restricts the command to those bytes defined in the mode sense parameter list. If pages is `yes', then pagno gives the page number, while rtype can be one of the following:

        0 - report current values

        1 - report changeable values

        2 - report default values

        3 - report saved values

selectmode [ pages [ pagno [ dosave [ blist  data ] ] ] ]
    This command provides an interface to the SCSI mode select command. Pages is a yes/no boolean signalling whether or not to work with the CCS-4.B standard for page formats: stating `no' restricts the command to those bytes defined in the mode select parameter list. If pages is `yes', then pagno gives the page number; dosave is a yes/no boolean flagging whether to save the new data, or simply update the current values (a distinction defined by SCSI); blist is a comma-separated list of bytes within pagno to be changed; & data is a comma-separated list of hexadecimal values for the bytes in blist.

verify [ niter [ automap ] ]
    Verify the current device. Niter is the number of iterations for the main verify loop. If the boolean automap is `yes', then any defects detected will automatically written to the GLIST at the end of the current iteration; if automap is `no', then verify will report all bad blocks found, but do nothing about them.

SEE ALSO
mkfs(8), newfs(8), disktab(5), sd(4)

BUGS
The maximum interleave allowed on a format is 1 less than the number of tracks per sector on the drive. If mode select is used to change the block size on a device, this also affects the number of tracks per sector, but neither figure changes until the format takes place, and so an interleave that was acceptable to the format command may be rejected by the device as an `illegal request: illegal field in command data block'.