Thursday, June 27, 2013

How to clear the PV id in AIX


When you assign a disk to a volume group,the disk automatically gets a PVID(Physical Volume ID).

For instance , the following example shows that hdisk2 has a PVID because it is a member in  hacmp_VG and hdisk1 has no PVID
because it is not a member in any VG:
# lspv

hdisk2          00f6c0100e3c830e      hacmp_VG    active
hdisk0          00f6c0105a881049      rootvg      active
hdisk1            none                 None
let`s remove hacmp_VG  and check the state of the PVID of hdisk2″
# reducevg hacmp_VG hdisk2
ldeletepv: Volume Group deleted since it contains no physical volumes.
# lsvg
rootvg
# lspv
hdisk2          00f6c0100e3c830e     None
hdisk0          00f6c0105a881049     rootvg          active
hdisk1            none               None
Now,we removed the hacmp_VG and hdisk2 still has the same PVID!

To remove the hdisk2 PVID:
#chdev -l hdisk2 -a pv=clear
hdisk2 changed
let`s check it again:
#lspv
hdisk2          none                   None
hdisk0          00f6c0105a881049       rootvg          active
hdisk1          none                   None
Now,we removed hdisk2 PVID.

How many SAN switches connected to my AIX server

Hope you all are aware of it nowadays we are mostly using SAN disks. It is highly important to know out disks and the adapter details. Fiber channel is used for lightning fast communication and to access the data. Data Read/Write to the San Disks have some protocols. Will see it later. Here is the commands to check the disks and Adapter details

# lsdev |grep fc
# lsattr -El fscsi0 |grep -i scsi_id


Example 1
# lsdev |grep fc
fcs0       Available 24-T1       Virtual Fibre Channel Client Adapter
fcs1       Available 24-T1       Virtual Fibre Channel Client Adapter
# lsattr -El fscsi0 |grep -i scsi_id
scsi_id      0xdf0707  Adapter SCSI ID                       False
# lsattr -El fscsi1 |grep -i scsi_id
scsi_id      0xde0718  Adapter SCSI ID                       False


0xdf & 0xde means that the 2 FC adapter are connected to 2 different SAN Switch