Useful SSA script (was: Mirrors Screwed up in SSA)

Useful SSA script (was: Mirrors Screwed up in SSA)

Post by Shane Cast » Sat, 05 Aug 2000 04:00:00

Attached below (after my sig) is a script I wrote that I find useful for
dealing with SSA drawers and loops.  It has a couple of drawbacks: one
is that, unless you have diddled with the permissions of the commands in
/usr/ssa/disk/bin and /usr/ssa/ssaraid/bin, you must be root to run it,
and the other is that if you have multiple SSA adapters in a loop it
doesn't show the ones other than the parent you are starting from.

Since I know it well, I don't need an explanation of what it prints, but
it shows the pdisk, its position in the loop, the hdisk to which it maps,
the VG name owning the hdisk (or "None" if it has not been assigned to
a VG), the usage if it is not mapped to an hdisk (as would be the case
if it is a hot spare), the pdisk description, and the pdisk size if not
included in the description (this is the case for SSA160 devices - the
info is in the ODM but not the desc).  This information is followed by
the output of "ssaraid -Izl <adapter>".  I have another script, named
"ssalink", that just gives the first section for each adapter, but I
found that I needed both for full doc of the disks on the adapters.

Here is an example of its output:
$ ssa2

ssa2 Available 00-05 SSA Enhanced RAID Adapter
          A1 A2 B1 B2
pdisk48    -  -  0 15  hdisk29  array0   SSA160 Physical Disk Drive (18300 MB)
pdisk50    -  -  1 14  hdisk29  array0   SSA160 Physical Disk Drive (18300 MB)
pdisk49    -  -  2 13  hdisk29  array0   SSA160 Physical Disk Drive (18300 MB)
pdisk28    -  -  3 12  hdisk29  array0   SSA160 Physical Disk Drive (18300 MB)
pdisk51    -  -  4 11  hdisk29  array0   SSA160 Physical Disk Drive (18300 MB)
pdisk20    -  -  5 10  -        <spare>  SSA160 Physical Disk Drive (18300 MB)
pdisk2     -  -  6  9  hdisk2   serial0  SSA160 Physical Disk Drive (18300 MB)
pdisk3     -  -  7  8  hdisk3   serial0  SSA160 Physical Disk Drive (18300 MB)
pdisk5     -  -  8  7  hdisk5   spare01  SSA160 Physical Disk Drive (18300 MB)
pdisk4     -  -  9  6  hdisk4   spare01  SSA160 Physical Disk Drive (18300 MB)
pdisk19    -  - 10  5  hdisk14  serial0  SSA160 Physical Disk Drive (18300 MB)
pdisk31    -  - 11  4  hdisk19  serial0  SSA160 Physical Disk Drive (18300 MB)
pdisk34    -  - 12  3  -        <free>   SSA160 Physical Disk Drive (18300 MB)
pdisk32    -  - 13  2  -        <free>   SSA160 Physical Disk Drive (18300 MB)
pdisk33    -  - 14  1  -        <free>   SSA160 Physical Disk Drive (18300 MB)
pdisk35    -  - 15  0  -        <free>   SSA160 Physical Disk Drive (18300 MB)

pdisk19         000629D1A46100D system      n/a         18.4GB  Physical disk
pdisk20         000629D1A46700D spare       n/a         18.4GB  Physical disk
pdisk4          000629D1A47D00D system      n/a         18.4GB  Physical disk
pdisk5          000629D1A48400D system      n/a         18.4GB  Physical disk
pdisk32         000629D1A48E00D free        n/a         18.4GB  Physical disk
pdisk28         000629D1A49000D member      n/a         18.4GB  Physical disk
pdisk2          000629D1A49400D system      n/a         18.4GB  Physical disk
pdisk33         000629D1A4FA00D free        n/a         18.4GB  Physical disk
pdisk34         000629D451C300D free        n/a         18.4GB  Physical disk
pdisk3          000629D452C900D system      n/a         18.4GB  Physical disk
pdisk31         000629D453CB00D system      n/a         18.4GB  Physical disk
pdisk48         000629D453CE00D member      n/a         18.4GB  Physical disk
pdisk35         000629D453CF00D free        n/a         18.4GB  Physical disk
pdisk49         000629D453D100D member      n/a         18.4GB  Physical disk
pdisk50         000629D453D200D member      n/a         18.4GB  Physical disk
pdisk51         000629D453D300D member      n/a         18.4GB  Physical disk
hdisk29         289939662412A4K good                    73.4GB  RAID-5 array

Shane Castle             | "Perfection, then, is finally achieved, not
Boulder County Info Svcs | when there is nothing left to add, but when
Boulder CO USA           | there is nothing left to take away."
                         |                - Antoine de Saint-Exupry

if [[ $# > 0 ]]

    adaps=`lsdev -Ctssa -F name`
    adaps="${adaps} `lsdev -Ctssa160 -F name`"
for adap in $adaps
    lsdev -Cl $adap
     echo '          A1 A2 B1 B2'
    ssadisk -a $adap -P | while read pd
        ssaconn -l $pd -a $adap
    done | sort -d -k 5,5 -k 3,3 | while read line
        set $line
        typeset -L8 pdnm=$1
        typeset -R2 link[]
        let i=1
        until (( i>4 ))
            let i+=1
        typeset -L8 hdnm=`ssaxlate -l $pdnm`
        if [[ "$hdnm" = +([ ]) ]]
            pduse=`ssaraid -Izl $adap -n $pdnm | awk '{print $3}'`
            typeset -L8 vg="<${pduse}>"
            lspv $hdnm >/dev/null 2>&1
            if [ $? -eq 0 ]
                typeset -L8 vg=`lspv $hdnm 2>/dev/null | fgrep "VOLUME GROUP:" | awk '{print $6}'`
                typeset -L8 vg="None"
        echo "$pdnm  ${link[1]} ${link[2]} ${link[3]} ${link[4]}  $hdnm $vg \c"
        pddesc=`lsdev -Cl $pdnm -F description`
        echo $pddesc | fgrep SSA160 >/dev/null 2>&1
        if [ $? -eq 0 ]
            mb=`odmget -q"name=$pdnm AND attribute=size_in_mb" CuAt | fgrep value | awk '{print $3}'| sed 's/"//g'`
            echo "$pddesc (${mb} MB)"
            echo $pddesc
    ssaraid -Izl $adap 2>&1


1. SSA RAID 5 vs SSA Mirroring

Hi all
I have the opportunity to choose between RAID 5 and RAID 1 Mirroring using a
SSA disk Subsystem.   I am aware of the technical differences between the
two technologies, but I don't know actual performance differences.  If
someone with experience using Raid 5 vs. mirroring on SSA's I really
appreciate any explanation of each performance attributes.   I only have one
disk tower (4131-405)with 5 disk bays.  Currently filled with  (4)  9.1GB

Current database is about 6GB's in size.

If I set up the SSA in a mirroring configuration  (2)  9.1GB data storage
and (2)  9.1GB mirrored data what is the perfomance attributes compared to a
(4)  9.1GB Raid 5 Array?

I would also appreciate an email from those who have had experience in these

Reed Nelson
Sys Admin
Pathology Dept
Queen's Medical Center
Honolulu, Hi

2. ZIP drives ain't zipping

3. Mirrors Screwed up in SSA

4. Linux on Shuttle AK31 mainboard

5. Re-using SSA disks previously members of a SSA RAID array

6. bttv 0.5.22 api documentation needed

7. Trade: 8218 18GB SSA drives for 8209 9GB SSA drives

8. ma.....

9. maymap for SSA 160 and SSA D40?

10. Gettin SSA Raidinfo into SSA Raidadapter

11. Slow performance on SSA mirror

12. extend mirrored disks on SSA

13. SSA & mirroring rootvg