Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pdisk slot location

Status
Not open for further replies.

CaptNeo

Technical User
Jun 4, 2002
49
0
0
US
Hi all!

I need to know if there's a way you can re-arrange the location of the pdisks below in such a way that pdisk0 should be in 10-68-7133-01, pdisk1 in 10-68-7133-02 and so on. I've tried deleting them and adding them back w/ cfgmgr but to no prevail. I tried adding them individually using SMIT but would fail saying the connection address was incorrect. Here's the list of my pdisks:

# lsdev -Cc pdisk
pdisk0 Available 10-68-7133-07-P SSA160 Physical Disk Drive
pdisk1 Available 10-68-7133-08-P SSA160 Physical Disk Drive
pdisk2 Available 10-68-7133-04-P SSA160 Physical Disk Drive
pdisk3 Available 10-68-7133-05-P SSA160 Physical Disk Drive
pdisk4 Available 10-68-7133-06-P SSA160 Physical Disk Drive
pdisk5 Available 10-68-7133-01-P SSA160 Physical Disk Drive
pdisk6 Available 10-68-7133-02-P SSA160 Physical Disk Drive
pdisk7 Available 10-68-7133-10-P SSA160 Physical Disk Drive
pdisk8 Available 10-68-7133-12-P SSA160 Physical Disk Drive
pdisk9 Available 10-68-7133-14-P SSA160 Physical Disk Drive
pdisk10 Available 10-68-7133-15-P SSA160 Physical Disk Drive
pdisk11 Available 10-68-7133-13-P SSA160 Physical Disk Drive
pdisk12 Available 10-68-7133-03-P SSA160 Physical Disk Drive
pdisk13 Available 10-68-7133-11-P SSA160 Physical Disk Drive
pdisk14 Available 10-68-7133-09-P SSA160 Physical Disk Drive
pdisk15 Available 10-68-7133-16-P SSA160 Physical Disk Drive

There's no problem adding them as hdisks because it maps correctly to the right pdisk (i.e. pdisk0=hdisk1, pdisk1=hdisk2... my rootvg is hdisk0).
 
As I've mentioned, I've tried those but they keep on coming back with the same location. I would like to have an output like this:

# lsdev -Cc pdisk
pdisk0 Available 10-68-7133-01-P SSA160 Physical Disk Drive
pdisk1 Available 10-68-7133-02-P SSA160 Physical Disk Drive
pdisk2 Available 10-68-7133-03-P SSA160 Physical Disk Drive
pdisk3 Available 10-68-7133-04-P SSA160 Physical Disk Drive
pdisk4 Available 10-68-7133-05-P SSA160 Physical Disk Drive
pdisk5 Available 10-68-7133-06-P SSA160 Physical Disk Drive
pdisk6 Available 10-68-7133-07-P SSA160 Physical Disk Drive
pdisk7 Available 10-68-7133-08-P SSA160 Physical Disk Drive
pdisk8 Available 10-68-7133-09-P SSA160 Physical Disk Drive
pdisk9 Available 10-68-7133-10-P SSA160 Physical Disk Drive
pdisk10 Available 10-68-7133-11-P SSA160 Physical Disk Drive
pdisk11 Available 10-68-7133-12-P SSA160 Physical Disk Drive
pdisk12 Available 10-68-7133-13-P SSA160 Physical Disk Drive
pdisk13 Available 10-68-7133-14-P SSA160 Physical Disk Drive
pdisk14 Available 10-68-7133-15-P SSA160 Physical Disk Drive
pdisk15 Available 10-68-7133-16-P SSA160 Physical Disk Drive

The reason why I would like to do this is so that I can easily locate the disk if it goes bad and that when I create VGs, I could easily determine which disks belong to which VG.
 
CaptNeo,

I'm not sure what you want to do is possible, and if it is, it would be a lot of effort.

It's less effort to get used to the built-in method of identifying disks - the "ssaidentify" command.

There are times where a disk won't respond to that though, and then you use ssaidentify in a negative fashion - identify *all* pdisks and the one that isn't flashing the id light is the bad disk.
 
the following script does it for me (you can't use it having RAID5 to avoid RAID5 destroying!!!

Please select 1 when prompted.

The script must be run after cfgmgr -l ssar (pdisks/hdisks are configured) - the script will recreate them with other names. If you would need other names you should modify name preffix in the scipt.

Code:
$ cat redesign_disks.ksh
#!/usr/bin/ksh
MKDEV_FILE="/tmp/mkdev_list"
#getyn () {
#        while echo "$* (y/n) ? \c" >&2
#        do
#                read yn rest
#                case $yn in
#                        [yY]) return 0 ;;
#                        [nN]) return 0 ;;
#                        *) echo "Please answer y or no\c" >&2 ;;
#                esac
#        done
#}

echo "What type of redundancy do you choose?\n";
echo "1. mirroring \n";
echo "2. raid_5 \n";
echo "Choice: " ;read choice1;

case $choice1 in
        1 )
        echo "You have chosen to mirror disks\n"
        VAR="mirror";
        VAR2="mirror";
        FASTCACHE="no";
         ;;
        2 )
        echo "You have chosen to make raid_5 array\n"
        VAR="mirror";
        VAR2="raid5";
#       HDRAIDS=$(for i in `ssaraid -M`;do ssaraid -I -l $i -t raid_5 -z |awk -F" " '{ print $2 }';done)
         ;;
        * )
        echo "Wrong choice!\n";
        VAR=""
        VAR2=""
        exit 3;;
esac;
#
# removing unwanted disks/definitons (hdisk,pdisk) - RAID5
#

echo "looking for any changes in the ODM..."
#cfgmgr -l ssar
echo "RAID_5 will be removed - all data will be lost - are you sure (y/n)?"
read confirm;
if [ "$confirm" != "y" ];
then
        exit 3;
fi
for n in `ssaraid -M`;
        do
                RAID5DELETE=$(ssaraid -I -l $n -t raid_5|awk -F" " '{print $2}')
                if [ "$RAID5DELETE" ];
                then
                        for k in $RAID5DELETE;
                        do
                                echo "deleting raid_5..."
                                ssaraid -D -l $n -n $k -u 1>/dev/null 2>&1
                        done;
                fi;
                DISKRESET=$(ssaraid -I -l $n -z|awk -F" " '{print $2}')
                if [ "$DISKRESET" ];
                then
                        for m in $DISKRESET;
                        do
                                echo "reintegrating $m into the system...."
                                ssaraid -H -l $n -n $m -d -a use=system fastwrite=off 1> /dev/null 2>&1
                        done
                fi;
        done;

for i in `lsdev -Cc disk -thdisk|awk -F" " ' {print $1}'`;do echo "rmdev -l $i -d" ;done  > $MKDEV_FILE
for i in `lsdev -Cc pdisk -tscsd|awk -F" " ' {print $1}'`;do echo "rmdev -l $i -d" ;done  >> $MKDEV_FILE

LOCATIONS=$(for i in `lsdev -Cc container -F name`;do
                echo $i":\c";
                SERIAL=$(lscfg -vl $i|grep Serial|sed -e 's/^\(.*\)Serial Number\.*//g'|sed -e's/ //g')
                echo $SERIAL":\c";
                lsdev -Cl $i -F location|cut -f 3 -d-;
                done)
echo $LOCATIONS

#
# some examples of lsdev usage
#
# NR_OF_LOCAL_DISKS=`lsdev -Cc disk -thdisk|awk -F"hdisk" '{ print $2 }'|cut -d" " -f1 -|head -1`

#
# creating preferred disk(s) definitions (hdisk,pdisk)
#
# mkdev -p ssar -t scsd -c pdisk -s ssar -w 0040AA837A1900D -l pdisk01 (example)
# mkdev -p ssar -t hdisk -c disk -s ssar -w 0040AA837A1900D -l hdisk01 (example)

#
# defining preferred disk(s) definitions
#

if [ $VAR = "mirror" ];
then
                for i in `lsdev -Cc pdisk | awk -F" " '{ print $1 }'`;
                do
                        for j in $LOCATIONS;
                        do
                                if [ "`echo $j|cut -f 2 -d:`" = "$(lsattr -El $i -a enclosure -F value|cut -c 9-16)" ];
                                then
                                        LOC=$(echo $j|cut -f 3 -d:);
                                fi
                        done;
                        DISK=$(lsdev -Cl $i -Fconnwhere" "location" "type" "class)
                        echo $DISK  "\c";
                        echo $LOC " \c";
                        BAY=$(lsdev -Cl $i -Flocation|cut -f 4 -d-)
                        let "BBAY = $BAY + 0";
                        echo $BBAY;
        #
        #       This will not work if a disk has fastwrite to cache enabled !!!
        #       first it has to be turned off manually : ssaraid -H -l ssaX -n pdXXXXX -a fastwrite=off
        #
                done         |sort -t- -k3,5         |awk -F" "         'BEGIN {}  {print "mkdev -p ssar -t",$3 " -c", $4 " -s ssar -w", $1,"-l pdssa"$5"-"$6 }         {print "mkdev -p ssar -t hdisk -c disk -s ssar -w" , $1, "-l hdssa"$5"-"$6 }'  >> $MKDEV_FILE

        #
        # executing script (unhash only if required)
        #
        chmod 700 $MKDEV_FILE
        echo "removing old and creating new entries for physical & logical disks.."
        $MKDEV_FILE 1>/dev/null

        if [ "$FASTCACHE" = "yes" ];
        then
                for jj in `ssaraid -M`;
                do
                        fastwrite=$(ssaraid -I -l $jj -z|sort|awk -F" " '{print $2}');
                        for fwr in $fastwrite;
                        do
                                echo "Enabling fastwrite on $fwr ..."
                                ssaraid -H -l $jj -n $fwr -a fastwrite=on
                        done
                done
        fi;
fi;

if [ $VAR2 = "raid5" ];
then
#
# executing script (unhash only if required)
#
                for i in `ssaraid -M`;
                do
                        #
                        # setup new devices
                        #
                        members=$(ssaraid -I -l $i -z|sort|head -6|awk -F" " '{print $2}');
                        echo "Members: " $members;
                        for mm in $members;
                        do
                                echo "preparing disk $mm for raid_5..."
                                ssaraid -H -l $i -n $mm -a use=free -u 1>/dev/null 2>&1
                        done;

                        spare=$(ssaraid -I -l $i -z|sort|head -7|tail -1|awk -F" " '{print $2}');
                        echo "Spare: " $spare;
                        for ss in $spare;
                        do
                                echo "preparing disk $ss for hot spare pool..."
                                ssaraid -H -l $i -n $ss -a use=spare -u 1>/dev/null 2>&1
                        done;
                        #
                        # members assignments required
                        #
                        echo "Making hot spare spool (pool_A0) from disks : $spare ..."
                        ssaraid -C -l $i -t spare_pool -n'pool_A0' -s ${spare} 1>/dev/null 2>&1
                        echo "Making a raid_5 array from disks: \n$members"
                        ssaraid -C -l $i -t raid_5 -s ${members} -a strip_size=128                         -a spare=true spare_preferred=true -a allow_page_splits=true                         -a fastwrite=on -d -k hd_RAID5_${i}
                done
fi;


r,.

 
That is the physical location. Sure, identify your SSA disks while the CE is standing there and then have him find the location with the maintenance guide and physically move the disk to the location.

But why? So you can identify where the failed disk is? That is what the SSA identify function is there. It flashes the light of the disk you are trying to find. That is your indicator.

I am not sure what would happen to the arrays if you did this, but I would be prepared for rebuilding the arrays.
 
No, way ... there's only one possibility.
1st you destroy each disk then you recreate disk by disk using the connection address, so you can create them in the sequence you like
 
The connection Adress is given from the Slot number in lsdev -Cc pdisk

You can add a Disk with an individual hdiskname whith mkdev
To identify the hdisk to pdisk relation you can use ssaxlate

 
they also have serial numbers printed on them... or they should. you know, if the flashing light thing is not to your liking. you can even kind of tell where they are in the loop by using link verification from diag -> task selection -> ssa tools or something. have not played with ssa for a while.

IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top