Determine LUN ID in AIX
Recently I had to present some new LUN’s from a NetApp to my AIX box. Here is the procedure I used to determine which hdisks were which.
First I had my storage administrator create a Volume and LUN on the Filer and present it to this system. It is utilizing the Fiber Channel. The LUN ID’s were presented as 19 and 23.
On the AIX box I did a cfgmgr –v to install the new disks. The –v is not necessary, but I like verbose mode to see what it is actually doing.
Then I did a lsdev to see which hdisks were available. As you can see below I have 2 disks from the NetApp and 2 local SCSI disks. I now know my new LUNs were presented to the AIX box as hdisk0 and hdisk1.
root@TEST# lsdev | grep hdisk
hdisk0 Available 06-08-02 MPIO NetApp FCP Default PCM Disk
hdisk1 Available 06-08-02 MPIO NetApp FCP Default PCM Disk
hdisk2 Available 09-08-00-3,0 16 Bit LVD SCSI Disk Drive
hdisk3 Available 09-08-00-4,0 16 Bit LVD SCSI Disk Drive
To determine the LUN ID for each of the hdisks I then ran lsattr. lsattr is used in AIX to determine the attributes of a device. –E is to diplay the effective values and –l followed by the device name is how to specify the hdisk in question.
root@TEST# lsattr -El hdisk0 |grep lun_id
lun_id 0x13000000000000 Logical Unit Number ID False
root@TEST# lsattr -El hdisk1 |grep lun_id
lun_id 0x17000000000000 Logical Unit Number ID False
Notice the LUN IDs are presented here in HEX format. If you are unable to do HEX > Decimal conversion in your head there is a handy converter at this website.
HEX 0x13 = Decimal 19
HEX 0x17 = Decimal 23
With the above information I now know the LUN presented with ID 19 shows up in AIX as hdisk0 and the LUN presented with ID 23 shows up in AIX as hdisk1.
With this information I then used SMIT to create the volume group, logical volumes, filesystems, and mount points.