[OpenIndiana-discuss] OI and chassis/jbod support?
Rich
rercola at acm.jhu.edu
Mon Jul 2 17:45:04 UTC 2012
diskmap.py is a publicly available script written by someone else
whose name escapes me ATM which is useful for this.
I also have my own scripts which aren't in any state for anyone else
to look at ATM which do similar things.
- Rich
On Mon, Jul 2, 2012 at 1:42 PM, Lucas Van Tol <catseyev9 at hotmail.com> wrote:
>
> Some of the sg_ses and sg_vpd tools from the sg3_utils package can sort of give that information if you have an SES compatible backplane/expander.
> It stops working when disks die though; so you would want to record any mappings somewhere for later reference. (Or just look for the blank spot in the map later on...)
>
> I have been working on some scripts; but they are still in a very 'ugly' state.
> sg_vpd will give you a 'sas address' for any disk. sg_ses --page=0xa /dev/es/ses??? will list SAS addresses for each slot; along with some other stuff.
> Match those up and you have a map of slots / disks.
>
> I dump the output from the following script for each 'active' disk into a file to make a map.
> I've been working on a script to blink LED's as well; but it involves sending binary blobs to sg_ses; and I'm not entirely sure it wouldn't brick another brand of expander...
>
> ##############
> #! /bin/bash
> ##Usage:: Print SES device; Element # for a given disk.
> UDISK=$1
> DISK=$1
>
> DISKSAS=$(sg_vpd --page=di /dev/rdsk/$DISK | grep 0x | tail -2|head -1 | awk '{print $1}')
> DISKSIZE=$(sg_readcap /dev/rdsk/$DISK | grep size | awk '{print $3}')
> echo $DISKSAS | grep 'x' >> /dev/null
> if [ $? -eq 0 ] ; then ##Found a SAS address...
> SESDEVICE=$(for SESDEV in `ls /dev/es`; do sg_ses --page=0xa /dev/es/$SESDEV | grep -i $DISKSAS >> /dev/null; if [ $? -eq 0 ] ; then echo $SESDEV; fi; done)
> echo $SESDEVICE| grep 's' >> /dev/null
> if [ $? -eq 0 ] ; then ##Found a ses device...
>
> SLOT='NUL'
> idex=0
> sg_ses --page=0xa /dev/es/$SESDEVICE | while read line
> do
> if [[ "$line" =~ "element" ]] ; then
> idex=$(echo "$line" | awk '{print $3}')
> fi
> if [[ "$line" =~ "$DISKSAS" ]] ; then
> SLOT=$idex
> echo "Disk $UDISK $DISKSAS at $SLOT on $SESDEVICE size $DISKSIZE"
> fi
> done
> else
> echo "Disk $UDISK $DISKSAS at NUL on NUL size $DISKSIZE ##No SES detected"
> fi
> else
> echo "Disk $UDISK NUL at NUL on NUL size $DISKSIZE ##No SAS detected"
> fi
>
>
> ############
>
>
>
> -Lucas Van Tol
>
>> From: dswartz at druber.com
>> To: openindiana-discuss at openindiana.org
>> Date: Sun, 1 Jul 2012 19:14:01 -0400
>> Subject: [OpenIndiana-discuss] OI and chassis/jbod support?
>>
>>
>>
>> During my brief experiment with S11, I was pleasantly surprised at the
>> croinfo app, which shows you which disks are in which enclosure/slot. Is
>> there anything like that for OI? If not, any idea what doing this would
>> entail?
>>
>> _______________________________________________
>> OpenIndiana-discuss mailing list
>> OpenIndiana-discuss at openindiana.org
>> http://openindiana.org/mailman/listinfo/openindiana-discuss
>
> _______________________________________________
> OpenIndiana-discuss mailing list
> OpenIndiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss
More information about the OpenIndiana-discuss
mailing list