128-port RAN tty and printers rearrange on mksysb restore

AIX 3.2.5
128-port adapter (00-04)
6 local RAN (3 on each line)

We replaced a failing hdisk in rootvg and then restored from a
mksysb tape.  After doing so, our 16-port RANs have been
renumbered and many of our tty's are not where they used to be

Before mksysb restore:
00-04            11          12        13
cxma0 line1 -----sa2--------sa3-------sa7
      line2 -----sa4--------sa5-------sa6
                 21          22        23

After mksysb restore:

00-04             11         12         13
cxma0 line1 -----sa2--------sa3--------sa4
      line2 -----sa5--------sa6--------sa7
                  21         22         23

All of the tty's on sa2 and sa3 are fine since they haven't
moved, but all others have moved because the sa\# they were
attached to no longer is where it used to be...

I suggested 3 possible courses of action:
1) Physically move the cables to put the ttys on to the
   correct sa\# where they were before.
2) Power of sa4 (00-04-13) and restore from the mksysb.  This
   would cause the RAN to be renumbered as they were before.
   Note that if you ever had to restore from mksysb again, 
   the same problem could occur.
3) Remove the tty's (up to 64 of them) from sa4-sa7 and readd
   them back.

You decided the best thing to do was to go with step 3 - 
remove and readd the affected tty's... Since all tty's are
configured identically this shouldn't be too difficult.
You removed all of your tty's but wanted to get your RANs numbered
(or mis-numbered) as they were before....
rmdev -dl sa4
rmdev -dl sa5
rmdev -dl sa6
rmdev -dl sa7

Power off the ran that just was sa4 (00-04-13)
Power the ran back on

You now are back to how you were before... You can begin readding
the tty's..

Since the RAN are still numbered 2-3-7 on one line and 4-5-6 on the
other, if a mksysb restore was done on the system now, the same
problem would occur again.  I suggested this method of recovery in
the event the problem occurred again:

\# For AIX 3.2.X ONLY!


mkdir ${TEMPDIR}/odm_backup

\# Make backup copy of present ODM files before continuing!
echo "Copying Custom ODM files to backup directory ${TEMPDIR}/odm_backup"
cp /etc/objrepos/Cu*  ${TEMPDIR}/odm_backup
if [ $? -ne 0 ]
   echo "Copy failed - perhaps not enough room in ${TEMPDIR} filesystem"
   echo "Please correct this condition and run this script again."
   exit 1

\# Restore ODM from the mksysb tape and put them in ${TEMPDIR}/etc/objrepos
echo "Restoring ODM files from mksysb tape to ${TEMPDIR}/etc/objrepos"
tctl -f  ${TAPEDRIVE}.1 fsf 3
tar -xvf ${TAPEDRIVE}   ./etc/objrepos/Cu*

echo "Restore from tar file has finished.  If you received any errors"
echo "during the restore such as running out of room in ${TEMPDIR} do not"
echo "procede!  Do you wish to continue (y/n)?"
if [ $CONTINUE -ne "y" ]
    echo "Exitting - no changes have been made."
    exit 0

\# Retrieve the information about tty, printer, and RAN locations from
\# the files restored from the mksysb tape into temp files.
\# First the tty's
> ${TEMPDIR}/recovertty.add
odmget -q "name like tty*"   CuDv   >> ${TEMPDIR}/recovertty.add
odmget -q "name like tty*"   CuAt   >> ${TEMPDIR}/recovertty.add
odmget -q "value3 like tty*" CuDvDr >> ${TEMPDIR}/recovertty.add
\# Then the printers
odmget -q "name like lp*"    CuDv   >> ${TEMPDIR}/recovertty.add
odmget -q "name like lp*"    CuAt   >> ${TEMPDIR}/recovertty.add
odmget -q "value3 like lp*"  CuDvDr >> ${TEMPDIR}/recovertty.add
\# Then the RANS
odmget -q "name like sa*"    CuDv   >> ${TEMPDIR}/recovertty.add
odmget -q "name like sa*"    CuAt   >> ${TEMPDIR}/recovertty.add
odmget -q "value3 like sa*"  CuDvDr >> ${TEMPDIR}/recovertty.add

echo "Done copying required entries from the mksysb backup to the file"
echo "${TEMPDIR}/recovertty.add - Procede with replacing existing entries"
echo "with those restored from the mksysb (y/n)?"
if [ $CONTINUE -ne "y" ]
   echo "No changes have been made"
   exit 0

\# Delete all information about TTYs, printers, and RAN
\# from the current running system
odmdelete -q "name like tty*"   -o CuDv
odmdelete -q "name like tty*"   -o CuAt
odmdelete -q "value3 like tty*" -o CuDvDr
odmdelete -q "name like lp*"    -o CuDv
odmdelete -q "name like lp*"    -o CuAt
odmdelete -q "value3 like lp*"  -o CuDvDr
odmdelete -q "name like sa*"    -o CuDv
odmdelete -q "name like sa*"    -o CuAt
odmdelete -q "value3 like sa*"  -o CuDvDr

\# Add the ODM entries from the temp files back into the system.
odmadd ${TEMPDIR}/recovertty.add

\# Make the "new" ODM in place take effect

echo "The procedure is not complete until the system is rebooted.  Please"
echo "do a shutdown on your system now."
exit 0

Support Line: 128-port RAN tty and printers rearrange on mksysb restore ITEM: CG0031L
Dated: October 1996 Category: N/A
This HTML file was generated 99/06/24~13:30:18
Comments or suggestions? Contact us