Tuesday, April 9, 2013

Find out whether IBM AIX file systems are LUNs

Scenario: A developer needs to know whether the file storage system is local or pointing to a LUN. For instance, the file systems he/she works on is /u02. Does it map to a local storage or SAN?

Steps:
1. Issue a mount command to first list out the mounted LOGICAL and/or PHYSICAL file systems and their mount points.

Example:
$ mount
node    mounted  mounted over    vfs       date             options    


-------- ---------------  ---------------  ------ ------------ ---------------
         /dev/hd4         /                jfs2   28 Oct 03:11 rw,log=/dev/hd8
         /dev/hd2         /usr             jfs2   28 Oct 03:11 rw,log=/dev/hd8
         /dev/hd9var      /var             jfs2   28 Oct 03:11 rw,log=/dev/hd8
         /dev/hd3         /tmp             jfs2   28 Oct 03:11 rw,log=/dev/hd8
         /dev/hd1         /home            jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /dev/hd11admin   /admin           jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /proc            /proc            procfs 28 Oct 03:16 rw            
         /dev/hd10opt     /opt             jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /dev/livedump    /var/adm/ras/livedump jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /dev/fslv00      /audit           jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /dev/u01lv       /u01             jfs2   28 Oct 03:16 rw,log=/dev/hd8
         /dev/u03lv       /u03             jfs2   28 Oct 03:16 rw,cio,log=INLINE
         /dev/u06lv       /u06             jfs2   28 Oct 03:16 rw,cio,log=INLINE
         /dev/u02lv       /u02             jfs2   28 Oct 03:16 rw,cio,log=INLINE
         /dev/u07lv       /u07             jfs2   28 Oct 03:16 rw,cio,log=INLINE
tggfilesvr1 /D/TempNFS       /mnt/tggfilesvr1 nfs3   28 Oct 03:16 rw,bg,hard,intr,sec=sys

Clearly, /dev/hd* are the physical drives. However, u**lv seem to be logical volumes created by grouping one or more physical drives together.

2. Issue a command lslv to list the details of a logical volume.
Example:
$ lslv -l u01lv
u01lv:/u01
PV                COPIES        IN BAND       DISTRIBUTION
hdisk7            184:000:000   34%           000:064:000:093:027
hdisk0            184:000:000   34%           000:064:000:101:019


$ lslv -l u02lv
u02lv:/u02
PV                COPIES        IN BAND       DISTRIBUTION
hdisk2            1450:000:000  25%           150:375:200:375:350


Clearly, LV u01lv is made of hdisk7 and hdisk0 whereas u02lv (mounted on u02) is mapped to hdisk2.

3. Now we know that u02 file in question is pointing to physical drive hdisk2. In order to make sure whether it is in fact pointing to SAN, issue following command:

$ lsattr -El hdisk2 |grep lun_id
lun_id          0x2000000000000                        Logical Unit Number ID           False

If there is no SAN involved there will not be any output. Else, there will be one as above.


Thanks for reading.



Welcome to my blogs

The contents here are my independent point of view. They reflect my thoughts, experience in my professional and social life.

Search This Blog