NAME

Solaris::MapDev - map between instance numbers and device names

SYNOPSIS

use Solaris::MapDev qw(inst_to_dev dev_to_inst);
my $disk = inst_to_dev("sd0");
my $nfs = inst_to_dev("nfs123");
my $inst = dev_to_inst("c0t0d0s0");
mapdev_data_files(path_to_inst => "/copy/of/a/path_to_inst",
                  mnttab => "/copy/of/a/mnttab",
                  dev_ls => { "/dev/rdsk" => "ls-lR/of/dev_dsk",
                              "/dev/rmt"  => "ls-lR/of/dev_rmt" });
my $tape = inst_to_dev("st1");

DESCRIPTION

This module maps both ways between device instance names (e.g. sd0) and /dev entries (e.g. c0t0d0). 'Vanilla' SCSI disks, SSA disks, A1000, A3000, A3500 and A5000 disks are all catered for, as are tape devices and NFS mounts.

FUNCTIONS

inst_to_dev($inst)

Return the device name name given the instance name

dev_to_inst($dev)

Return the instance name given the device name

get_inst_names

Return a sorted list of all the instance names

get_dev_names

Return a sorted list of all the device names

mapdev_data_files

This tells mapdev to use data held in copies of the real datafiles, rather than the current "live" files on the system. This is useful for example when examining explorer output. A list of key-value pairs is expected as the arguments. Valid keys-value pairs are:

path_to_inst => "/copy/of/a/path_to_inst",
   A valid path_to_inst file.  This is mandatory.

mnttab => "/copy/of/a/mnttab",
   A valid /etc/mnttab file.  This is optional - if not
   specified, no information on NFS devices will be displayed.

dev_ls => { "/dir/path" => "/ls-lR/of/dir/path",
            ... });
   A hash containing path/datafile pairs.  The paths should
   be one of /dev/rdsk, /dev/osa/rdsk, /dev/osa/dev/rdsk or
   /dev/rmt.  The datafiles should be the output of a "ls -l"
   of the specified directory.  A single file containing a
   recursive "ls -Rl" of /dev is also acceptable.

mapdev_system_files

This tells mapdev to revert to using the current "live" datafiles on the system - see "mapdev_data_files()"

AUTHOR

Alan Burlison, <Alan.Burlison@uk.sun.com>

SEE ALSO

perl(1), /etc/path_to_inst, /dev/osa, /dev/rdsk, /dev/rmt, /etc/mnttab