Mass storage devices overview

Mass storage devices overview

Mass storage devices are those devices on your system available for storing large amounts of data. Your system can support any combination of physical mass storage devices including hard disks, tape drives, CD-ROM, and WORM devices.

This topic provides an overview of the Storage Device Interface (SDI) and various commands and procedures that are available for managing mass storage devices and media.

NOTE: Information about diskette drives and diskettes is provided in ``Working with diskettes''.

What is the Storage Device Interface (SDI)?

The Storage Device Interface (SDI) is a framework for driver software for many of the hardware devices on a system. Besides organizing, simplifying, and standardizing the way device drivers are written, SDI also makes it easier to administer a wide variety of both devices and interfaces.

SDI divides the device driver logically into two layers

SDI supports both SCSI and non-SCSI devices. It routes target driver requests to the correct HBA driver and HBA driver responses to the correct target driver.

To better explain this relationship, suppose you have a system which includes one ESDI-controlled hard disk, one non-SCSI cartridge tape drive, a SCSI HBA adapter (type x) controlling a SCSI hard disk and a SCSI 9-track tape, and a second SCSI HBA adapter (type y) controlling a SCSI hard disk and a CD-ROM.

All three hard disks are controlled by the sd01 target driver. Both tape units are controlled by st01, and the CD-ROM drive is controlled by sc01. This is possible because the target drivers do not need to know the specific details of how a command is issued (a function that varies between different controller types), but rather, only the type of operation to be performed (for example, read a file from a particular disk).

Each HBA driver receives the requests from and performs the operation on the appropriate physical device. Results from the request, successful or not, are returned to SDI by the HBA driver in a common device- and controller-independent format. Finally, SDI returns the results of the request to the appropriate target driver.

All SDI drivers use device driver interfaces, although not all device drivers are part of SDI. (See ``DDI interface versioning'' for more information.) Currently, SDI includes mass storage device driver support for hard disks, tapes, CD-ROM devices, and Write-Once-Read-Many (WORM) devices.

The following commands are provided for working with SDI devices.

Command Description
sdiconfig(ADM) determine which SDI disk, tape, and SCSI controllers are present
sdiadd(ADM) hot add SCSI mass storage devices
sdirm(ADM) hot remove SCSI mass storage devices
sdimkdev(ADM) generate device nodes for the SDI subsystem
sdimkdtab(ADM) update the device table entries for the SDI subsystem
sdipath(ADM) manage paths in a multipath I/O environment
sdighost(ADM) lists and/or removes device nodes associated with Ghost Names
sdi_timeout(ADM) query or change SDI device timeout tunables
sdimkosr5(ADM) convert a disk layout formatted for previous releases of SCO OpenServer to VTOC format

What are target drivers?

Target drivers deal with the device-specific aspects of the hardware. Most of the time, a hardware device actually consists of a controller card and a physical device (for example, a hard disk and a hard disk controller, or a cartridge tape drive and a tape drive controller). Target drivers deal with the details of operating the physical device (the hard disk, cartridge tape drive, or whatever device is connected to the controller card).

The target driver controls the behavior of a device and decides what device actions are needed to fulfill requests passed to the driver. In this scheme, the HBA driver performs the low-level work of programming the controller to accomplish the actions requested by the target driver.

The following mass storage target drivers are provided.

Target Driver Device Type
sd01(HW) hard disks
st01(HW) tape devices
sc01(HW) CD-ROM devices
sw01(HW) WORM devices
mc01(HW) medium changers

Additional target drivers might be developed in the future to support other classes of devices which are not currently supported. While the target drivers are architecturally very similar, their differences result from the device-specific aspects which are needed to correctly support each of the device classes.

What are HBA drivers?

HBA drivers handle the controller-specific aspects of operating a device. To read a given block of data on one of the slices on the hard disk, the target driver determines which actual physical sector on the disk will be read, and the HBA driver programs the disk controller registers, issues the read request, and responds to the interrupt generated by the read request. The results of the read operation, whether successful or not, are passed back to the target driver, which then signals the completion of the operation.

SDI provides a number of different HBA drivers. However, in general, HBA drivers fall into two categories--those for SCSI HBA cards and non-SCSI controller cards. Examples of non-SCSI controllers include ESDI, MFM, and IDE controllers.

Supported HBA drivers provided include adsa, adsc, adse, adsl, adss, amd, blc, c8xx, cpqsc, dak, dpt, flashpt, ictha, ida, ide, lmsi, mitsumi, qlc1020, and sony. HBA drivers which are supplied, but which are no longer supported, include c7xx, efp2, fdeb, fdsb, mcis, wd7000, and zl5380. New or enhanced HBA drivers are made available periodically. For the most current list of supported hardware see ``Accessing the SCO Compatible Hardware Web Pages''.

Physical devices

The following types of physical mass storage devices are supported.

hard disk devices
Most system software and user files are stored on hard disk. Hard disks are high-speed, high-capacity storage devices, and are available in a variety of types (IDE, ESDI, MFM, SCSI) and sizes. You can usually add new hard disks to satisfy growing storage needs on your system Most hard drives are fixed, but some are removable.

tape devices
Because tapes have a high storage capacity and are portable, they provide an efficient way of storing and transferring data. Tape drives are used primarily for filesystem backups and restoring filesystems or individual files. Your computer may be equipped with cartridge, 9-track, digital audio tape (DAT), 8-millimeter, or another type of tape drive. The tapecntl(C) command provides an interface to various media and drive control operations.

CD-ROM devices
CD-ROM devices are optical-based, read-only media used for permanently storing information. They are useful for accessing large volumes of information.

Medium Changer devices
Medium changer devices are robotic mechanisms that automate the movement of storage media (tapes, CD-ROMs, optical) between storage locations and physical read/write drives. The mccntl(ADM) command provides an interface to control medium changer devices.

Device drivers, special files and the device database

Each physical mass storage device is supported by the following software.

device drivers
are programs that manage the signals between devices and the operating system. These include both target drivers and HBA drivers. You can use the drivers provided with the system or write your own. For the most current list of device drivers and supported hardware see ``Accessing the SCO Compatible Hardware Web Pages''. For instructions on writing your own device drivers, see Developing DDI kernel drivers.

device special files
are files that link devices to the appropriate device drivers. These files define devices to the kernel: how your system interacts with a device is determined by attributes of the device special file. These attributes are the name of the file (which serves as the name of the device), and the major and minor device numbers of the device special file.

The Device Database, /etc/, is a database in which the system keeps a list of attributes about each device on your system. The entry for each device includes a device alias (a name unique in the database that is mapped to the pathname of the device it represents) and values for a set of attributes. You can list the device attributes using the devattr(ADM) command.

When a new storage device is added to the system, the device database is automatically updated--you do not need to modify anything by hand.

Mass storage device names

Standard device names are used to identify mass storage devices.

Hard disks

The default alias for the first hard disk on the system is disk1. Subsequent hard disks have alias names of disk2, disk3, and so on. See disk(HW) for information about the standard device names for hard disks.

Tape drives

A tape drive (whether for cartridge, 9-track, 8-millimeter, or DAT tape) is a character device and uses device names in the /dev/rmt directory.

The following default tape device aliases are supported (these names reference the first tape device in the system):

non-retensioning rewinding device

non-retensioning non-rewinding device

retensioning rewinding device

retensioning non-rewinding device

unload on close device
See tape(HW) for additional information about tape device names.

Retensioning and rewinding

On the first operation of the tape, a retensioning device seeks first to the beginning of the tape, then to the end of the tape, and finally, to the beginning of the tape again. Use a retensioning device for streamer cartridges that have not been accessed for some time or have been transported between accesses. The retension operation is time-consuming, but it ensures that the cartridge streamer tape is tensioned properly. A nonretensioning device does not cause retension of the tape before the first operation on the tape.

A rewinding device will seek the beginning of the tape (rewind the tape) when the cartridge streamer is closed. A nonrewinding device does not rewind the tape on close and thus enables an application to write more than one archive to the streamer tape.

CD-ROM drives

The default alias for the first CD-ROM drive on the system is cdrom1. Subsequent CD-ROM drives have alias names of cdrom2, cdrom3, and so on. See sc01(HW) for information about the standard device names for CD-ROM drives.

WORM drives

See sw01(HW) for information about standard device names for WORM drives.

Medium changers

See mc01(HW) for information about standard device names for medium changers.

Managing mass storage devices and media

The following subtopics describe tasks associated with mass storage devices and storage media.

Suggestions for managing storage devices

How much time you spend overseeing the storage devices on your system depends on the number of users on your system and how they use system resources. A large user community and many resources require a lot of care and feeding. Here are a few suggestions for managing storage devices:

Displaying information about devices

Displaying information about media

Formatting hard disks

Hard disks are shipped from the factory already formatted. It is not necessary to reformat your hard disks for installation. If it becomes necessary to reformat an existing hard disk because of hardware or media defects, please contact your disk vendor.

Checking a corrupt filesystem

If you get an error message saying a filesystem is corrupt run the fsck(ADM) command. The fsck command can be used to check the integrity of any mounted filesystem, and runs automatically on the root filesystem whenever the system is rebooted following an abnormal shutdown. The fsck command can also be used to repair a corrupted filesystem, if repair is possible.

See ``Solving filesystem problems'' for an in-depth discussion about using fsck with various types of filesystems.

Managing multipath I/O environments

In a multipath I/O environment, there are multiple paths to any single hard disk. If your computer has multipath capability, use the sdipath(ADM) command to manage multipath I/O. The sdipath command provides the ability to list paths including status and performance information, and provides operations for controlling which paths are active so you can tune your system for better performance or higher availability. You can also repair paths that have failed.

Managing ghost names in multipath I/O environments

In a multipath I/O environment, the name for a disk device is determined by the first path discovered to the disk. Ghost names are provided to avoid the naming conflicts encountered when controllers fail in a multipath I/O environment--the operating system continues to use the original device name even when a device is no longer accessible (or has a different first path). You can run sdighost(ADM) to change all ghost name references to be real names.

Adding or removing hardware controllers

See ``Adding or removing hardware controllers'' for information about adding or removing hardware controllers or adapters.

Support is provided for device drivers written to the Storage Device Interface versions 3.0 and later, and drivers written to the Device Driver Interface versions 5.0 and later.

CAUTION: When making changes to the kernel configuration, do not attempt to edit the sdevice files for SDI device drivers (adsa, adsc, adse, etc.). You must use the Device Configuration Utility (DCU) to add, remove or configure device drivers. See ``Using the Device Configuration Utility (DCU)''.

If you do make configuration changes for these devices manually, the configuration tools might become unusable, or your system might be left in an unbootable state.

Creating disk partitions and slices

We commonly use the word ``partition'' to refer to two concepts:

A partition is subdivided into ``slices'' which are used to define filesystems, swap area(s), and dump slices. The assignment of slices to these functions is recorded in the Volume Table of Contents (VTOC).

Just as the noun ``partition'' refers to both a portion of the disk and a subdivision of that partition, the verb ``partition'' also points to two steps:

The phrase ``partitioning the disk'' is used by many people to refer to both steps. To avoid confusion, we differentiate between the two by using the terms ``partition the disk'' and ``defining slices.'' Additional information about partitions and slices is available in vtoc(HW).

Hard disk partitioning

A single hard disk can support multiple operating systems but not in the same space on that disk. You have the choice of either using all the space on your hard disk into one partition, or dividing the hard disk into a maximum of four partitions. Each partition can hold a separate operating system. For example, you could have a UnixWare system partition, a SCO OpenServer system partition, an OS/2 partition, and a DOS partition.

NOTE: For each disk on the system, only one partition can be used by the system at any one time.

Carefully consider the type, number and size of partitions you want on your system before creating them; changing them later requires that existing partitions and data be destroyed. When creating partitions, note that:

Your first opportunity to create partitions comes during the initial system load (ISL) of your system. At that time, you can define partitions and slices for each of two hard disks, a primary and a second hard disk. When you install on an existing system you are asked whether you want to keep the existing partitioning scheme (the default scheme) or create a new one. If you are installing on a new machine, the default scheme is one partition (partition #1), which uses 100 percent of each disk.

If you add a hard disk after ISL, use the diskadd(ADM) command to create the partitions and slices. See ``Adding hard disks''.

Changing hard disk partitions

Changing the number or size of hard disk partitions destroys existing partitions and data on the disk being re-partitioned. If you must change your hard disk partitions, be sure to back up your data first (back up each partition on the disk).

Changing the active partition

Only one partition can be active at a time. There are two ways to change the active partition.

Defining slices

Each VTOC on a partition can contain up to 184 slices (numbered from 0 through 183). Slices can be allocated as filesystems, swap area(s) or dump slices.

The slices on your hard disk(s) are initially assigned as part of the initial system load (ISL) process.

See the Getting Started Guide and vtoc(HW) for more information about defining slices during ISL.

If you add a hard disk after ISL, use the diskadd(ADM) command to create the slices. See ``Adding hard disks''.

Guidelines for defining slices

The following information from the Getting Started Guide provides guidelines for defining slices and filesystems.

Do you need to reassign slices?

After your system has been in operation for a while determine whether the allocation of slices (as reflected in the VTOC definition) is appropriate. Does it meet the needs of your users? Consider whether system performance might be improved by a larger number of smaller filesystems than you currently have, or by allocating filesystems to different hard disks. Begin by analyzing how well your system performs with the existing filesystem arrangement. See ``Managing system performance'' for a description of the sar(ADM) command that evaluates performance.

If you frequently get console messages warning of insufficient memory, the amount of main memory or the swap area configuration may be insufficient to support users' demands. Before adding more main memory, try expanding the swap area. See ``Adding swap space''.

Reassigning slices

Before you reassign slices on a boot disk, do a full system backup. To reassign slices on the boot disk, you must reinstall the operating system.

Use the disksetup(ADM) command to reassign slices on disks other than the boot disk.

Adding hard disks

See ``Adding hard disks'' or diskadd(ADM).

Adding tape drives

See ``Adding tape drives''.

Hot adding or removing SCSI storage devices

The SCSI hot addition or hot removal feature allows for addition or removal of SCSI storage devices (not controllers) from a running system. See ``Hot adding or removing SCSI storage devices''.

Hot-plugable controllers

Hot-plug machines provide the capability to physically add, remove or replace a controller on a ``hot'' (running) system. Typically, hot-plug machines have a built-in hot-plug controller, and power can be turned on or off to selected slots. See ``Managing Hot Plugable controllers''.

Removing old disk addresses after moving a disk

In a non-multipath I/O environment, when a hard disk is moved from one controller to another, it occupies two addresses (a mapping between the old address and the new address). You cannot add a hard disk at the old address until you remove the mapping. Use sdighost(ADM) to remove the mapping.

Expanding swap space

When real memory fills with system processes or temporary files, the system must swap idle processes to disk. Swap space is located in one or more slices in your disk partition(s).

If you use your system to run many processes, especially graphical processes, you might need more swap space. Also, if you add more RAM to your system after the initial system load, you might want to increase your swap space. See ``Adding swap space''.

Copying data on mass storage media

There are two approaches to copying data placed on mass storage media.

  1. duplicate the entire contents of one medium to another

  2. copy specific files from one medium to another

Which approach you choose depends on whether the filesystems are mounted, the data format, and the amount of data your are copying.

Copying files from hard disk to hard disk

The cp(C) command is typically used when both the source and the destination file systems are already mounted. This command copies files quickly from one location to another.

Copying directory contents from hard disk to tape


ls dirname | cpio -ovB -O special_file

where dirname is the path of the directory you want to copy (such as /tmp) and special_file is the path to the tape (character) device (such as /dev/rmt/ctape1).

Copying files from tape to hard disk

If the data on the tape is in cpio format, you can use cpio(C) to copy from tape to hard disk.

  1. Enter

    cd dirname

    where dirname is the path to the directory into which you want to copy the files (such as /var/tmp).

  2. Enter

    cpio -iudvB -I special_file

    where special_file is the path to the tape (character) device (such as /dev/rmt/c0s0 or ctape1).

If the data on the tape is in tar format, you can use tar(C) to copy from tape to hard disk.

  1. Enter

    cd dirname

    where dirname is the path to the directory into which you want to copy the files (such as /var/tmp).

  2. Enter

    tar -xvf < special_file

    where special_file is the path to the tape (character) device (such as /dev/rmt/c0s0 or ctape1).

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005