AIX下查看磁盘的相关命令:
1.aix下rhdisk和hdisk的区别是什么?
rhdisk为字符设备,hdisk为块设备。块设备可以随机存取,而字符设备不能随机存取。
2.如何查看磁盘的属性?(查看磁盘的属性信息,其中reserve_policy对于集群来说比较重要。)
root@itgs1:/dev$ lsattr -El hdisk4
PCM PCM/friend/NetAppDefaultPCM Path Control Module False
PR_key_value none Persistant Reserve Key Value True
algorithm round_robin Algorithm True
clr_q no Device CLEARS its Queue on error True
dist_err_pcnt 0 Distributed Error Sample Time True
dist_tw_width 50 Distributed Error Sample Time True
hcheck_cmd inquiry Health Check Command True
hcheck_interval 30 Health Check Interval True
hcheck_mode nonactive Health Check Mode True
location Location Label True
lun_id 0x1000000000000 Logical Unit Number ID False
lun_reset_spt yes LUN Level Reset True
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x500a09808f40d1d2 FC Node Name False
pvid none Physical volume identifier False
q_err yes Use QERR bit True
q_type simple Queuing TYPE True
queue_depth 8 Queue DEPTH True
reassign_to 120 REASSIGN time out value True
reserve_policy no_reserve Reserve Policy True
rw_timeout 30 READ/WRITE time out value True
scsi_id 0x92e00 SCSI ID False
start_timeout 60 START unit time out value True
ww_name 0x500a09859f40d1d2 FC World Wide Name False
root@itgs1:/dev$
3.如何查看磁盘头信息
root@itgs1:/$ lquerypv -h hdisk7
============= B: HEADER /dev/rhdisk7 =============
00000000 00820101 00000000 80000003 AB36078C |.............6..|
00000010 00000000 00000000 00000000 00000000 |................|
00000020 4F52434C 4449534B 00000000 00000000 |ORCLDISK........|
00000030 00000000 00000000 00000000 00000000 |................|
00000040 0B200000 00030103 44415441 5F303030 |. ......DATA_000|
00000050 33000000 00000000 00000000 00000000 |3...............|
00000060 00000000 00000000 44415441 00000000 |........DATA....|
00000070 00000000 00000000 00000000 00000000 |................|
00000080 00000000 00000000 44415441 5F303030 |........DATA_000|
00000090 33000000 00000000 00000000 00000000 |3...............|
000000A0 00000000 00000000 00000000 00000000 |................|
000000B0 00000000 00000000 00000000 00000000 |................|
000000C0 00000000 00000000 01F720EF 36E71C00 |.......... .6...|
000000D0 01F82F4A 66327000 02001000 00100000 |../Jf2p.........|
000000E0 0001BC80 00019000 00000002 00000001 |................|
000000F0 00000002 00000000 00000000 00000000 |................|
============= E: HEADER =============
4.如何在两个节点确认两块盘为同一块磁盘?
可通过对比 dfY3KZlXzMTL来比较两个节点的磁盘是否为同一块磁盘
oracle@itgs1:/dev$ lscfg -vpl hdisk4
hdisk4 U9179.MHC.1010B0T-V7-C11-T1-W500A09859F40D1D2-L1000000000000 MPIO NetApp FCP Default PCM Disk
Manufacturer................NETAPP
Machine Type and Model......LUN
ROS Level and ID............811a
Serial Number...............dfY3KZlXzMTL
Device Specific.(Z0)........FAS6240
PLATFORM SPECIFIC
Name: disk
Node: disk
Device Type: block
--下图为RAC集群共享ASM磁盘组data扩容,增加共享磁盘rhdisk8时由于reserve_policy属性2个节点的设置不一致或属性本身设置不当导致的报错,无法对磁盘组增加该属性有误的磁盘。在得知原因的情况下,通过修正该磁盘属性值后,磁盘组添加该磁盘成功。
To enable simultaneous access to a disk device from multiple nodes,
you must set the appropriate Object Data Manager (ODM) attribute listed in the following table to the value shown, depending on the disk type:
Disk Type Attribute Value
SSA, FAStT, or non-MPIO-capable disks reserve_lock no
ESS, EMC, HDS, CLARiiON, or MPIO-capable disks
reserve_policy no_reserve
To determine whether the attribute has the correct value, enter a command similar to the following on all cluster nodes for each disk device that you want to use:
# /usr/sbin/lsattr -E -l hdiskn
If the required attribute is not set to the correct value on any node, then enter a command similar to one of the following on that node:
■ SSA and FAStT devices
# /usr/sbin/chdev -l hdiskn -a reserve_lock=no
■ ESS, EMC, HDS, CLARiiON, and MPIO-capable devices
# /usr/sbin/chdev -l hdiskn -a reserve_policy=no_reserve
安装RAC集群需要将reserve_lock(reserve_policy)设置成no或no_reserve,目的是因为RAC需要并发的共享盘,所以盘不能被一台机器锁住。