Operating System - HP-UX
1820620 Members
1903 Online
109626 Solutions
New Discussion юеВ

Primary and Alternate Links

 
GTENCSS
Occasional Contributor

Primary and Alternate Links

Hi,
I am looking for a way to determin primary and alternate links for disks that have not been added to a VG yet.


Dave

P.S. Without using SAM
7 REPLIES 7
Joseph C. Denman
Honored Contributor

Re: Primary and Alternate Links

You should be able to determan using:

ioscan -fnC disk

Hope this helps.

...jcd..
If I had only read the instructions first??
harry d brown jr
Honored Contributor

Re: Primary and Alternate Links

If they aren't in use, then there is no primary or alternate path.

You have to learn how to read SCSI paths, and have PHYSICAL access to the system to determine what is wired to what.

First thing is to draw up a physical diagram.


live free or die
harry
Live Free or Die
Jeff Machols
Esteemed Contributor

Re: Primary and Alternate Links

for DISK in `ls -1 /dev/dsk`
do
COUNT=`strings /etc/lvmtab | grep $DISK | wc -l`
if [ $COUNT -eq 0 ]
then
echo "$DISK is free"
fi
done
Sridhar Bhaskarla
Honored Contributor

Re: Primary and Alternate Links

Hi,

Create a vg with only one set of disks. For ex., all C5* disks. Export the vg and import it with -s option. This is going to import all the secondary links too.

#mkdir /dev/vgtest
#mknod /dev/vgtest/group c 64 0x0?0000
#vgcreate vgtest /dev/dsk/c#t#d#
#vgextend vgtest (all the free devices but on the same path)
#vgexport -v -s -m /tmp/vgtest.map vgtest
mkdir,mknod process
#vgimport -v -s -m /tmp/vgtest.map vgtest
#vgdisplay -v vgtest

This should list out all the links. Once you noted down the details, you can do a vgexport to get rid of the volume group.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Helen French
Honored Contributor

Re: Primary and Alternate Links

Christopher McCray_1
Honored Contributor

Re: Primary and Alternate Links

you can use ioscan -fnC disk for a listing of all hardware devices of type disk, for exapmple:

# ioscan -fnC disk.
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
disk 2 0/0/1/0.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c0t2d0 /dev/rdsk/c0t2d0
disk 0 0/0/2/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST336704LC
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
disk 1 0/0/2/1.6.0 sdisk CLAIMED DEVICE SEAGATE ST336704LC
/dev/dsk/c2t6d0 /dev/rdsk/c2t6d0
disk 3 0/12/0/0.0.0 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c3t0d0 /dev/rdsk/c3t0d0
disk 5 0/12/0/0.0.1 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c3t0d1 /dev/rdsk/c3t0d1
disk 7 0/12/0/0.0.2 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c3t0d2 /dev/rdsk/c3t0d2
disk 4 1/4/0/0.1.0 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c4t1d0 /dev/rdsk/c4t1d0
disk 6 1/4/0/0.1.1 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c4t1d1 /dev/rdsk/c4t1d1
disk 8 1/4/0/0.1.2 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c4t1d2 /dev/rdsk/c4t1d2

As you can see, the output shows a 0/12 path and a 1/4 path for LUNS and the corresponding device files. The paths 0/12/0/0.0.0 corresponds to /dev/dsk/c3t0d0 and 1/4/0/0.1.0 corresponds to /dev/dsk/c4t1d0, which in turn are the primary and alternate paths for LUN0 for a pvcreate(you only need pvcreate one of them). When ready to add them to the volume group, add both paths. You can add them in any order, as there are no rules as to which one needs to be pri or alt.

Hope this helps
Chris
It wasn't me!!!!
James R. Ferguson
Acclaimed Contributor

Re: Primary and Alternate Links

Hi:

"Primary" and "Alternate" links only have meaning when a physical disk as been assigned to a volume group.

LVM does *not* load-balsnce I/O between controllers to a disk, Rather, the *first*, path defined (during vgcreate) becomes the primary. A second, or alternate link, can be added with 'vgextend' if it was not also specified during the 'vgcreate'.

It is not unusual to swap the primary and alternate links. This is done by 'vgreduce'ing the "primary", thereby causing the "alternate" or secondary to become the primary link; and following this procedure with 'vgextend' to add the original primary link as the (new) secondary or alternate one.

The /etc/lvmtab file will keep the primary link as the first; the secondary following.

This said, assuming that a 'pvcreate' has been done on a disk, you can determine what devices are candiates for primary or alternate links by examining the PVID (LVM's physical volume ID). These PVID's will be identical:

# echo 0x2008?2X|adb /dev/dsk/cXtYdZ|awk '{print tolower($2 $3)}'

Regards!

...JRF...