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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

renumbering hdisks

Status
Not open for further replies.

unixadmin

MIS
Jan 27, 2003
11
US
Need to renumber hdisks.....restored a mksysb to a test system and the hdisks are numerical order.

In production systems at client's sites, the hdisk numbers for datavg are:
hdisk9,10,11,13,14,17,18,21,22,25,26,27,29,30,33,34,37,38

As you can see, the numbers have gaps....there is a whole history to why, but in the lab, I have to recreate this exact layout.

How to I change it within the ODM to have the correct numbers.

I am running AIX 4.3.3 on IBM R50's with SSA disks.

Thanks
 
Run this (where the numbers are your hdisks):
for i in 9 10 11 12 13 14 15 20 21
do
rmdev -dl $i
done

Then:
cfgmgr

 
I wrote the following:

#!/bin/ksh
for i in 12 15 16 19 20 23 24
do
rmdev -dl hdisk$i
done

cfgmgr
exit 0
~

It runs through and deletes each of the hdisks in the loop, but then cfgmgr readds them in as the original numbers.

Anything I am missing?
 
unixadmin,

Do you have the manual for the SSA IO cards? It has the procedures for renumbering hdisks (see hdisks in the index). I'd type it here, but it is a multi-step procedure. In the meantime, I'm trying to find the manual on IBM's site.
 
bi,

I'll take a look for the manual....I'm consulting here and hard documentation is difficult to find.

If you can't find it electronicly, could you fax copies of the pages for me (assuming it is only a couple of pages).

You can email me at junkmail@kpog.com

thanx

Kevin

 
I couldn't find the manual on IBM's web site, so here are the commands to change an hdisk's number for an SSA disks. The commands are the same if you want to change the pdisk numbers. But type will be different.

The disks whose hdisk numbers you are changing cannot be part of a volume group so be sure to save any data that is on the disks.

[tt]lsdev -Cl [disknumber] -Fconnwhere[/tt]
(that's the letter l not 1)
disknumber is the hdisk or pdisk number you want to get rid of (like hdisk12)

Make a note of the return you get.

[tt]lsdev -Cl [disknumber] -Ftype[/tt]
disknumber is the hdisknumber you want to get rid of (like hdisk12)

Make a note of the return you get.

Remove the existing disk from the system.

[tt]rmdevl -l [disknumber] -d[/tt]
disknumber is the hdisknumber you want to get rid of (like hdisk12)

Then the mkdev command:

[tt]mkdev -p ssar -t [Type] -c [Class] -s ssar -w [ConnectionLocation] -l [NewDiskName][/tt]

Type is the return you get from the [tt]lsdev -Cl [disknumber] -Ftype[/tt] command.
Class is disk for hdisks (pdisk for pdisks)
ConnectionLocation is the return you get from the commands that are listed are [tt]lsdev -Cl [disknumber] -Fconnwhere[/tt]
and NewDiskName is the new disk name you want, like hdisk15.
 
THANKS!.....I was able to create a script that did what I needed....here it is in case anyone needs to do something similiar:


#!/bin/ksh

##### VARIABLE DEFINITION
typeset -i counter
counter=26

###### Old hdisk number=new hdisk number
hdisk26=38
hdisk25=37
hdisk24=34
hdisk23=33
hdisk22=30
hdisk21=29
hdisk20=27
hdisk19=26
hdisk18=25
hdisk17=22
hdisk16=21
hdisk15=18
hdisk14=17
hdisk13=14
hdisk12=13
hdisk11=11
hdisk10=10
hdisk9=9

####### LOOP TO REMOVE OLD HDISK/PDISK AND CREATE NEW ONE WITH NEW NUMBER

while [ $counter -gt 8 ]
do
diskno=$((hdisk$counter))
serno=`lsdev -Cl pdisk$counter -Fconnwhere`
disktype=`lsdev -Cl pdisk$counter -Ftype`
rmdev -dl hdisk$counter
rmdev -dl pdisk$counter
mkdev -cpdisk -s ssar -t $disktype -p 'ssar' -w $serno -l pdisk$diskno
mkdev -c disk -s ssar -t 'hdisk' -p 'ssar' -w $serno -l hdisk$diskno
counter=counter-1
done

exit 0
 
one more question:
if my servers run with fastt, how to rename the disk name?
 
You already asked that question in a thread you started. Why do you want to do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top