Solaris::MapDev - map between instance numbers and device names
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");
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.
Return the device name name given the instance name
Return the instance name given the device name
Return a sorted list of all the instance names
Return a sorted list of all the device names
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.
This tells mapdev to revert to using the current "live" datafiles on the system - see "mapdev_data_files()"
Alan Burlison, <Alan.Burlison@uk.sun.com>
perl(1), /etc/path_to_inst, /dev/osa, /dev/rdsk, /dev/rmt, /etc/mnttab
To install Solaris::Kstat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solaris::Kstat
CPAN shell
perl -MCPAN -e shell install Solaris::Kstat
For more information on module installation, please visit the detailed CPAN module installation guide.