autochanger man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

autochanger(7)							autochanger(7)

       autochanger: schgr, eschgr - SCSI interfaces for medium changer device

       An  autochanger is a SCSI mass storage device, consisting of a mechani‐
       cal changer device, one or more data transfer devices (such as  optical
       disk  drives), and media (such as optical disks) for data storage.  The
       mechanical changer moves media  between	storage	 and  usage  locations
       within the autochanger.

       Two  medium  changer  drivers  or  provide access to the medium changer
       device; is the current preferred method of access and is	 provided  for
       legacy  compatibility.	 The mechanical changer device can be accessed
       via these drivers directly to move media within the autochanger.

       The and medium changer device drivers follow the SCSI specification for
       medium  changer	devices to provide a generic medium changer interface,
       making it feasible to construct an application  level  driver  for  any
       mechanical  changer, jukebox, library, or autochanger device (MO, tape,

   Device Naming Convention
       The device naming convention for the autochanger driver enables access‐
       ing the changer device.

       Legacy  character  device  file	names reside in Within this directory,
       names are derived from  the  device  naming  convention	(explained  in
       intro(7)).   Unique  legacy  device  names  are	determined by the card
       instance, target address of the SCSI changer device and LUN of the SCSI
       changer device.

       Persistent  device  file names have the form for character devices. The
       card instance, target address and LUN are no longer encoded in the per‐
       sistent device file name itself (see intro(7)).

   Major and Minor Number Descriptions
       The  following  shows  the  bit assignments format) used by the changer
       driver to access the changer device using legacy device files:

       |     0 - 7     |     8 - 15    | 16 - 19| 20-22|
       |     MAJOR     |   INSTANCE    | TARGET | LUN  |

		       │ 0-7  │	  8-15	 │ 16-19  │ 20-22 │   │
		       │MAJOR │ INSTANCE │ TARGET │  LUN  │   │

       MAJOR is the major number of the appropriate driver,  INSTANCE  is  the
       card  instance  of  the	SCSI  interface to which the changer device is
       attached, TARGET is the SCSI target address of the changer device,  LUN
       is the SCSI LUN of the changer device.

       All  fields in the device number are specified in hexadecimal notation.
       Note that there is no support for hard partitions  (sections)  in  this
       minor  number.	If desired, partitioning can be achieved via LVM soft-
       partitioning schemes.

       Note: The major numbers used by the  changer  drivers  are  dynamically
       assigned starting with release HP-UX 11i v3.

       Following is a long listing showing the major and minor numbers associ‐
       ated with the device special file name of the changer:

       crw-rw-rw- 1 root sys 231 0x015000 Apr 22 10:22 /dev/rac/c1t5d0

       The SCSI medium changer device driver performs moves between  different
       media  locations	 within an autochanger.	 Each potential media location
       has a specific element address and is  one  of  the  following  element

	      storage		  A  location to hold a unit of media not cur‐
				  rently in use.  Typically most media will be
				  located in this type of element.

	      import/export	  A  location for inserting and removing media
				  from the device.   Movement  of  a  unit  of
				  media	 to this type of location is in effect
				  an eject operation.  Movement of a  unit  of
				  media	 from  this type of location is a load

	      data transfer	  A location for accessing media  data.	  This
				  is  generally	 the location of a device that
				  reads and/or writes data on the media	 being
				  handled  by the media changer device.	 Move‐
				  ment to this type of location is a physical-
				  media-mount  operation.   Movement from this
				  type of location is a physical-media-unmount

	      media transport	  A  location  for  media  movement.  Media is
				  generally temporarily located in  this  type
				  of  element  only  during actual media move‐

   Changer Control Requests
       The following ioctl functions and structure  definitions	 are  included

	      #define SIOC_INIT_ELEM_STAT    _IO('S', 51)
	      #define SIOC_ELEMENT_ADDRESSES _IOW('S', 52, struct element_addresses)
	      #define SIOC_ELEMENT_STATUS    _IOWR('S', 53, struct element_status)
	      #define SIOC_RESERVE	     _IOW('S', 54, struct reservation_parms)
	      #define SIOC_RELEASE	     _IOW('S', 55, struct reservation_parms)
	      #define SIOC_MOVE_MEDIUM	     _IOW('S', 56, struct move_medium_parms)
	      #define SIOC_EXCHANGE_MEDIUM   _IOW('S', 57, struct exchange_medium_parms)
	      /* structure for SIOC_ELEMENT_ADDRESSES ioctl */
	      struct element_addresses {
		      unsigned short  first_transport;
		      unsigned short  num_transports;
		      unsigned short  first_storage;
		      unsigned short  num_storages;
		      unsigned short  first_import_export;
		      unsigned short  num_import_exports;
		      unsigned short  first_data_transfer;
		      unsigned short  num_data_transfers;
	      /* structure for SIOC_ELEMENT_STATUS ioctl */
	      struct element_status {
		     unsigned short element;	     /* element address */

		     unsigned int  resv1:2;
		     unsigned int  import_enable:1; /* allows media insertion (load) */
		     unsigned int  export_enable:1; /* allows media removal (eject) */
		     unsigned int  access:1;	    /* transport element accessible */
		     unsigned int  except:1;	    /* is in an abnormal state */
		     unsigned int  operatr:1;	    /* medium positioned by operator */
		     unsigned int  full:1;	    /* holds a a unit of media */

		     unsigned char resv2;
		     unsigned char sense_code;	    /* info. about abnormal state */
		     unsigned char sense_qualifier; /* info. about abnormal state */

		     unsigned int  not_bus:1;	    /* transfer device SCSI bus differs */
		     unsigned int  resv3:1;
		     unsigned int  id_valid:1;	    /* bus_address is valid */
		     unsigned int  lu_valid:1;	    /* lun is valid */
		     unsigned int  sublu_valid:1;   /* sub_lun is valid */
		     unsigned int  lun:3;	    /* transfer device SCSI LUN */

		     unsigned char bus_address;	    /* transfer device SCSI address */
		     unsigned char sub_lun;	    /* sub-logical unit number */

		     unsigned int  source_valid:1;  /* source_element is valid */
		     unsigned int  invert:1;	    /* media in element was inverted */
		     unsigned int  resv4:6;

		     unsigned short source_element;  /* last storage medium location */
		     char	   pri_vol_tag[36]; /* volume tag (device optional) */
		     char	   alt_vol_tag[36]; /* volume tag (device optional) */
		     unsigned char misc_bytes[168]; /* device specific */
	      /* structure for SIOC_RESERVE and SIOC_RELEASE ioctls */
	      struct reservation_parms {
		      unsigned short  element;
		      unsigned char   identification;
		      unsigned char   all_elements;
	      /* structure for SIOC_MOVE_MEDIUM ioctl */
	      struct move_medium_parms {
		      unsigned short  transport;
		      unsigned short  source;
		      unsigned short  destination;
		      unsigned char   invert;
	      /* structure for SIOC_EXCHANGE_MEDIUM ioctl */
	      struct exchange_medium_parms {
		      unsigned short  transport;
		      unsigned short  source;
		      unsigned short  first_destination;
		      unsigned short  second_destination;
		      unsigned char   invert_first;
		      unsigned char   invert_second;

       Cause the media changer device to take inventory.  As a result,
	    the	 media	changer device determines the status of each and every
	    element address, including the presence or absence of  a  unit  of
	    media.   This is a mechanical operation which can take time.  This
	    function only necessary in the event of  a	severe	error  of  the
	    media changer.

       Determine the element addresses supported by a media changer device.
	    The	 first	valid  element	address	 and the number of elements is
	    indicated for each element type.  These element addresses  may  be
	    used as source and destination location arguments.

       Determine the status of an element.  The element address for which
	    status  information	 is requested is specified via the field.  The
	    resulting status data indicates the presence or absence of a  unit
	    of	media  in  that	 element  address as well as other information
	    about the element address.

       Control access to element addresses.  Depending on the device,
	    reservations may limit operator control of those element addresses
	    in	the  media  changer device.  Specific element addresses can be
	    reserved to handle interlocking  between  multiple	requesters  if
	    each requester has a unique reservation identification.  The value
	    zero in the field specifies that a single element  address	should
	    be reserved or released.  An element address reserved in this man‐
	    ner can not be reserved by another single element address reserva‐
	    tion  using	 a  different  reservation  identification.  The field
	    specifies the reservation identification.  The field specifies the
	    element address to be reserved.

	    The	 value	"1"  in the field indicates that all element addresses
	    should be reserved.	 The and fields should contain the value  zero
	    since  these  fields are not meaningful when reserving all element
	    addresses.	Reserving all element addresses	 is  primarily	useful
	    for limiting operator control.

       Reposition unit(s) of media.
	    Depending  on  the	source and destination element types, this may
	    result in a media load, eject, or simple repositioning.  Media can
	    be	"flipped" using values of "1" in the or fields.	 The ioctl re‐
	    positions two different units of media.   One  unit	 of  media  is
	    moved from the element specified by the field to the element spec‐
	    ified by the field.	 A second unit of media is moved from the ele‐
	    ment specified by the field to the element specified by the field.
	    In an autochanger with multiple changer  mechanisms,  or  a	 media
	    staging area, an exchange occurs if the and fields are the same.

       By default, and are not included in the system configuration file.

       The  following example uses the and functions to get bus address infor‐
       mation about the drives in an autochanger device:

       int			   last_drive_el;
       struct element_addresses	   el_addrs;
       struct element_status	   el_stat; drive[1024];
       int fd = -1, error = 0, i = 0;

       fd = open("/dev/rchgr/autoch0",O_RDWR);
       if ((error = ioctl(fd, SIOC_ELEMENT_ADDRESSES, &el_addrs)) != 0) {
	  perror("ioctl: SIOC_ELEMENT_ADDRESSES");
	  return -1;
       } else {
	  last_drive_el = el_addrs.first_data_transfer
			+ el_addrs.num_data_transfers - 1;
	  for (i = el_addrs.first_data_transfer; i <= last_drive_el; i++) {
	     el_stat.element = i;
	     if ((error = ioctl(fd, SIOC_ELEMENT_STATUS, &el_stat)) != 0) {
		perror("ioctl: SIOC_ELEMENT_ADDRESSES");
		return -1;
	     } else {
		 * You may wish to also check some of the other fields
		 * in the el_stat structure to verify that the data is
		 * valid.  Fields: el_stat.access (ac accessible),
		 * el_stat.except (exception).
		if (! el_stat.not_bus && el_stat.id_valid) {
		 drive[i].bus_address = el_stat.bus_address;
		   if (! el_stat.lu_valid) {
		       drive[i].lun = 0;
		   } else {
		       drive[i].lun = el_stat.lun;

       Some non-HP media changer devices do not support the and

       Some older media changer devices do not support the For these  devices,
       multiple	 ioctl	operations may be used to accomplish the same results,
       provided a suitable temporary element address may be found.

       insf(1M),  mknod(1M),  scsictl(1M),  ioctl(2),  scsi(7),	  scsi_ctl(7),


List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net