AIX: 查看未加入vg的hdisk容量比较常用的命令

如果一个硬盘(hdiskX/pv)已经加入了vg, 那么可以使用lsattr/lscfg等
命令来查看这个硬盘的大小,如:

# lspv
hdisk0          00c54456747d8617                    rootvg          active
hdisk1          00c544667b3e201f                    rootvg          active
...
hdisk13         none                                None

# lsattr -El hdisk0
PCM             PCM/friend/scsiscsd                        Path Control Module           False
algorithm       fail_over                                  Algorithm                     True
dist_err_pcnt   0                                          Distributed Error Percentage  True
dist_tw_width   50                                         Distributed Error Sample Time True
hcheck_interval 0                                          Health Check Interval         True
hcheck_mode     nonactive                                  Health Check Mode             True
max_transfer    0x100000                                   Maximum TRANSFER Size         True
pvid            00c54456747d86170000000000000000           Physical volume identifier    False
queue_depth     16                                         Queue DEPTH                   False
reserve_policy  no_reserve                                 Reserve Policy                True
size_in_mb      300000                                     Size in Megabytes             False
unique_id       2A1135000C5002C7041430BST9300603SS03IBMsas Unique device identifier      False
ww_id           5000c5002c704143                           World Wide Identifier         False

# lscfg -pv -l hdisk0
  hdisk0           U78A0.001.DNWK52Z-P2-D3  SAS Disk Drive (300000 MB)

        Manufacturer................IBM
        Machine Type and Model......ST9300603SS
        FRU Number..................44V6833
        ROS Level and ID............42423039
        Serial Number...............6SE1R9LZ
        EC Level....................L36403
        Part Number.................44V6838
        Device Specific.(Z0)........000006329F003002
        Device Specific.(Z1)........0617BB09
        Device Specific.(Z2)........0021
        Device Specific.(Z3)........10312
        Device Specific.(Z4)........
        Device Specific.(Z5)........22
        Device Specific.(Z6)........L36403
        Hardware Location Code......U78A0.001.DNWK52Z-P2-D3


  PLATFORM SPECIFIC

  Name:  disk
    Node:  disk
    Device Type:  block

备注: 可以比较清晰的看到hdisk0的容量为300000MB.

但是对于hdisk13这种没有加入到任何vg中的磁盘这种方法就不管用了.

# lsattr -El hdisk13
PCM             PCM/friend/xparray Path Control Module              False
PR_key_value    none               Reserve Key                      True
algorithm       fail_over          Algorithm                        True
clr_q           no                 Device CLEARS its Queue on error True
dist_err_pcnt   0                  Distributed Error Percentage     True
dist_tw_width   50                 Distributed Error Sample Time    True
hcheck_cmd      inquiry            Health Check Command             True
hcheck_interval 60                 Health Check Interval            True
hcheck_mode     nonactive          Health Check Mode                True
location                           Location Label                   True
lun_id          0x709000000000000  Logical Unit Number ID           False
lun_reset_spt   yes                SCSI LUN reset                   True
max_transfer    0x40000            N/A                              True
node_name       0x50060e800547e454 Node Name                        False
pvid            none               Physical Volume ID               False
q_err           yes                Use QERR bit                     False
q_type          simple             Queue TYPE                       True
queue_depth     2                  Queue DEPTH                      True
reassign_to     120                REASSIGN time out                True
reserve_policy  single_path        Reserve Policy                   True
rw_timeout      60                 READ/WRITE time out              True
scsi_id         0xcc600            SCSI ID                          False
start_timeout   60                 START UNIT time out              True
ww_name         0x50060e800547e454 FC World Wide Name               False

# lscfg -vp -l hdisk13
  hdisk13          U78A0.001.DNWK52Z-P1-C1-T1-W50060E800547E454-L709000000000000  XP MPIO Disk XP24000 (Fibre)

        Manufacturer................HP
        Machine Type and Model......OPEN-V
        Part Number.................
        ROS Level and ID............36303037
        Serial Number...............50 047E4
        EC Level....................
        FRU Number..................
        Device Specific.(Z0)........00000332CF000002
        Device Specific.(Z1)........0A84 6E ....
        Device Specific.(Z2).........
        Device Specific.(Z3).........
        Device Specific.(Z4)............
        Device Specific.(Z5)........
        Device Specific.(Z6)........


  PLATFORM SPECIFIC

  Name:  disk
    Node:  disk
    Device Type:  block

这时可以使用bootinfo -s hdiskX命令看看
# bootinfo -s hdisk13
51530

可以看到这个硬盘hdisk0的大小为50GB