AIX Storage

NOTE: For systems using PowerHA or PowerVM Live Partition Mobility, you need to set the reserve_lock to false for LUNs on each VIO.

NOTE: For any LUN mapped to a VIO, you need to set the PVID to true. Then you can more easily map the LUN from the LPAR. This is best practice and needs to be done every time before creating the virtual disk.

Display disk size in MB

Typical Usage:

bootinfo -s hdiskX
for d in `lspv | cut -d" " -f1`; do echo "$d \c"; bootinfo -s $d; done

To get WWNs:

for fc in `lsdev -C | grep ^fcs|cut -d" " -f1`; do echo $fc; lscfg -vpl $fc | grep "Network Address"; done

Get FC Info:

lscfg -vpl fcs0

Shark: List all datapath devices (LUN number is first three digits of serial number)

datapath query device
lscfg -v1 fcs0

Shark: List all datpath adapters:

datapath query adapter

Clear Persistent Reservations

Test and display the persistent reservation on a vpath device:

lquerypr -vh /dev/<vpath>

Display reserved status on vpath device:

lquerypr -Vh /dev/<vpath>

Release persistent reserviation if the deviec is reserved by current host:

lquerypr -rh /dev/<vpath>

Remove the persistent reservation and clear all reservation key registration:

lquerypr -ch /dev/<vpath>

Remove persistent reservation if the vpath device is reserved by the another host:

lquerypr -ph /dev/<vpath>

Clear the owning volume manager from disk:

chpv -C <vpath>

Most of the time, doing the following will clear things up, but it depends:

lquerypr -ph /dev/<vpath>; chpv -C <vpath>

Check RAID battery on AIX

sisraidmgr -M -o0 -l sisioa_adapter
for s in `lsdev -C|grep sisioa|cut -d' ' -f1`; do sisraidmgr -M -o0 -l $s|grep -e ^RAID -e ^Est; echo; done