[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4830
  • Last Modified:

Disk size from lsattr

I have EMC disks presented i.e. as shown below.   Unlike other disks, lsattr doesn't show the size of disks.
What the command to view the size of disks?   There are a bunch of EMC disks.  I like to have a script that can return the names of disks with their sizes.

# lsattr -El hdiskpower15
cgname                           Consistency Group Name     True
clr_q         yes                Clear Queue (RS/6000)      True
location                         Location                   True
lun_id        0x47000000000000   LUN ID                     False
lun_reset_spt yes                FC Forced Open LUN         True
max_coalesce  0x20000            Maximum coalesce size      True
max_transfer  0x40000            Maximum transfer size      True
pvid          none               Physical volume identifier False
pvid_takeover yes                Takeover PVIDs from hdisks True
q_err         no                 Use QERR bit               True
q_type        simple             Queue TYPE                 False
queue_depth   16                 Queue DEPTH                True
reassign_to   120                REASSIGN time out value    True
reserve_lock  yes                Reserve device on open     True
rw_timeout    40                 READ/WRITE time out        True
scsi_id       0xe60018           SCSI ID                    False
start_timeout 180                START unit time out        True
ww_name       0x5006048ad52e3f69 World Wide Name            False

# lsattr -El hdisk10
clr_q         yes                Device CLEARS its Queue on error True
location                         Location Label                   True
lun_id        0x3e000000000000   Logical Unit Number ID           False
lun_reset_spt yes                FC Forced Open LUN               True
max_transfer  0x40000            Maximum TRANSFER Size            True
node_name     0x5006048ad52e3f66 FC Node Name                     False
pvid          none               Physical volume identifier       False
q_err         no                 Use QERR bit                     True
q_type        simple             Queue TYPE                       True
queue_depth   16                 Queue DEPTH                      True
reserve_lock  yes                Reserve Device on open           True
rw_timeout    40                 READ/WRITE time out value        True
scsi_id       0xd40018           SCSI ID                          False
start_timeout 180                START UNIT time out value        True
ww_name       0x5006048ad52e3f66 FC World Wide Name               False
0
ethanjohnsons
Asked:
ethanjohnsons
3 Solutions
 
sjm_eeCommented:
lspv <hdisk name>
0
 
ethanjohnsonsAuthor Commented:
I tried, but am getting:

# lspv hdiskpower44
0516-304 : Unable to find device id hdiskpower44 in the Device
        Configuration Database.

# lspv hidsk 70
0516-306 : Unable to find  hidsk in the Device
        Configuration Database.
0
 
dfkeCommented:
you can try this little script. It will give you information about the physical disks, VG"s, filesystems and free space. Redirect to file.
echo
echo  DISK INFO 
echo
echo  HOSTNAME:      `hostname`
echo  Model:         `uname -M`
echo  Serial number:   `uname -u`
echo  Memory: `lsattr -El sys0 -a realmem| awk '{ print$2 }'` KB
echo 
echo  Date:    `date +%d-%m-%Y`
echo
 
PV=`lspv|awk '{ print $1 }'`
VG=`lsvg`
# List fo physical disks
echo ------ PHYSICAL DISKS ------
lspv
echo
 
#Harddisk type, firmware, ROS level
echo ------ Harddisk type, firmware, ROS level ------  
lsmcode -A | grep hdisk
echo
 
# Paging Space
echo ------ PAGING SPACE ------
lsps -a
echo
 
for i in $VG;do
lv_disk=`lsvg -l $i|awk '{ print $1}'|grep -v $i|grep -v LV`
 
        echo
        echo ------ VOLUME GROUP INFO \($i\) ------
        lsvg $i
        echo
        echo ------ LOGICAL VOLUME NAME \($i\) ------
        lsvg -l $i
        echo
#       echo ------ HDISKS USED FOR \($i/$g\) ------
#       lslv -l $g
#       echo
#       echo ------ FILESYSTEM LAYOUT ON DISKS \($i/$g\) ------
#       lslv -m $g
#       echo
done
 
 
 
for i in $PV;do
        echo
        echo ------ DISK STATISTICS \($i\) ------
        lspv $i
        echo
        echo ------ FILESYSTEMS \($i\) ------
 
# Filesystems per disk
 
        lspv -l $i
        echo
        echo ------ FREE SPACE \($i\) ------
 
# Free space per disk
 
#        lslv -p $i
        lspv -p $i
        echo
done

Open in new window

0
 
cloud5Commented:
If the disk hasn't been assigned a PVID, and if it's not yet part of a volume group, you probably won't be able to do an "lspv".

Instead, try "inq" (you'll need to have installed "EMC.Symmetrix.aix.rte") and "grep" for the name.

For example:

    /usr/lpp/EMC/Symmetrix/bin/inq.aix64_51 | grep hdiskpower44

(you might need to do a "find inq*" to find the inq command)

You should get output similar to this:

    /dev/rhdiskpower44  :DGC     :RAID 5          :0219  :2900003E   :    52428800

The far-right column is the disk capacity of the hdiskpower in kilobytes.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now