megarc under freebsd

服务器只要用的是PERC的RAID控制卡都可以用megarc这个命令来检测,本笔记参数仅适用于freebsd平台,其它平台请执行megarc ?命令查看帮助。
[root@samba ~]# dmesg |grep -i raid
hptrr: HPT RocketRAID controller driver v1.1 (Jul 3 2008 15:26:28)
amr0: mem 0xf80f0000-0xf80fffff irq 29 at device 13.0 on pci3
amr0: Firmware 713S, BIOS G121, 64MB RAM
mpt0: Capabilities: ( RAID-0 SAFTE )
amrd0: on amr0
amrd0: 953870MB (1953525760 sectors) RAID 5 (degraded)
[root@samba ~]# megarc ?

**********************************************************************
MEGARC MegaRAID Configuration Utility(FreeBSD)-1.04(03-02-2005)
By LSI Logic Corp.,USA
**********************************************************************
[Note: For SATA-2, 4 and 6 channel controllers, please specify
Ch=0 Id=0..15 for specifying physical drive(Ch=channel, Id=Target)]

Type ? as command line arg for help

First Parameter should be :
-AllAdpInfo
-ldInfo
-abortCCBI
-abortInit
-ViewExtSenseData
-enableBI, -disableBI
-enMULTIPLIER, -disMULTIPLIER
-enableNCQ, -disableNCQ
-enSMART, -disSMART
-ViewInitProg, -ViewBICCProg
-disPR, -enPRauto, -enPRman
-startPR, -stopPR
-getPRinfo, -setPRdelay
-getNVRAMLog
-clrNVRAMLog
-EnTmpOfflineRAID, -DisTmpOfflineRAID
-EnCCRecovery, -DisCCRecovery
-enAlarm, -disAlarm, -silenceAlarm, -showAlarm
-showRbld, -stopRbld, -doRbld
-autoRbldOn,-autoRbldOff
-physSetHsp, -physUnsetHsp
-GetRbldrate, -SetRbldrate
-ctlrInfo, -clrCfg, -addCfg, -newCfg
-physOn, -physOff, -phys, -physdrvSerialInfo, -facDef
-chkonLd, -initLd, -cldCfg
-spannewcfg, -spanaddcfg
-showBios, -disBios, -enableBios
-DfcfgAndParm
-ScfgAndParm,-RcfgAndParm
-pSetCache
-pdFailInfo, -clrErrHistory
-EachDskRaid0
-LogPhysInfo
-DelLd,-FreeSpaceInfo
-offBIOS_Echo,-onBIOS_Echo,-offBIOS_SOE,-onBIOS_SOE
-dskBIOScfgm,-nvBIOScfgm,-usrBIOScfgm
-FastInitOn, -FastInitOff
-SetFrpON, -SetFrpOFF
-EmulI2O, -EmulMass
-dskSpinUP, -setFlush
-ForceBootON, -ForceBootOFF
-enPciDelay, -disPciDelay, -vuPciDelay
-CoercionON, -CoercionOFF, -CoercionVu
-ShowdskSpinUP
-saveCfg, -restoreCfg
-dispFileCfg, -dispCfg or ?
-setXFerRate, -getXFerRate

[root@samba ~]#megarc -dispCfg -a0 显示raid卡的型号、设置、disk相关信息等。

0 00 0x00000000 0x3a383800 ONLINE
0 01 0x00000000 0x3a383800 ONLINE
0 02 0x00000000 0x3a383800 ONLINE

[root@samba ~]# megarc -phys -chAll -idAll -a0
Finding Devices On Each MegaRAID Adapter…

Adapter 0, Channel 0, Target ID 0 —————————————-
Type: DISK Vendor :
Product: ST3500514NS Revision : SN12
Synchronous : No Wide-32 : No Wide-16: No
LinkCmdSupport: No TagQ support: No RelAddr: No
Removable : No SoftReset : No AENC : No

[root@samba ~]# megarc -ctlrInfo -a0

[root@samba ~]# megarc -getRbldRate -a0

**********************************************************************
MEGARC MegaRAID Configuration Utility(FreeBSD)-1.04(03-02-2005)
By LSI Logic Corp.,USA
**********************************************************************
[Note: For SATA-2, 4 and 6 channel controllers, please specify
Ch=0 Id=0..15 for specifying physical drive(Ch=channel, Id=Target)]

Type ? as command line arg for help

**********************************************************************
RebuildRate of Adapter-0 is 30
**********************************************************************
[root@samba ~]# megarc -getPRinfo -a0 查看disk缓存策略

**********************************************************************
MEGARC MegaRAID Configuration Utility(FreeBSD)-1.04(03-02-2005)
By LSI Logic Corp.,USA
**********************************************************************
[Note: For SATA-2, 4 and 6 channel controllers, please specify
Ch=0 Id=0..15 for specifying physical drive(Ch=channel, Id=Target)]

Type ? as command line arg for help

Success, got PR Info for adp 0

********PR INFO********

Mode :MAN START
Delay :0x2a(168 hrs)
#Iters :0
Processed :Ch-15 Id-15
Progress :0
Status :PR Not Started(Stop/Pending)
#Processed :0

FEW VALS ARE DEFAULT FOR CURRENT PR ITER
[root@samba ~]#
服务器天天报警又不能再等了,只能冒死拼了!开机时提示按Ctrl+M进入RAID管理界面,发现是0端口的硬盘坏了。先更换它,再进入Raid卡进行重建。重建一天!这一天我的心可是没安定过,生怕做错了,还好最後成功了!